Repository navigation
Preview /park for: as it's typed (#200, 2/3) - #216
Open
NinjaLikesCheez wants to merge 2 commits into
Open
NinjaLikesCheez wants to merge 2 commits into
NinjaLikesCheez wants to merge 2 commits into
Conversation
Second of the stack for #200. core/time-suggest.ts turns a typed time into autocomplete suggestions that show what Pixel understood ("fri 8pm → Fri 16 Oct 2026, 20:00", "2h → until 12:30") or why it can't use it, followed by examples that contain what was typed. Picking one submits the text, and the handler reads it again. Used by /park for and by from, until, for and reset in /admin → Parking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/admin → Parking is one subcommand that opens a panel; its times are typed on forms, which can't autocomplete, so the suggestions on its operations never ran. /park for is the only slash option that takes a time. Keep core/time-suggest.ts to what it uses: previewSuggestions and whyNot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second PR of the stack for #200 (spec: #200 (comment)). Merge #215 first. PR 3 (every input on the shared pieces, consistent form text) stacks on this one.
What changes
/park for:previews what you type:2h2h → until 12:00h1h → until 11:00,2h → until 12:00,4h → until 14:00(the offered lengths that contain it, as before, now with their end)rest of dayrest of day → until 23:59agesNot understood yet. Try 30m, 2h30, rest of daysrc/core/time-suggest.ts(new):previewSuggestionsshows what was typed and what it means first, then the examples that contain it, each with what it means. When nothing can be offered, a single suggestion says why. Its value is what was typed, so picking it gets the full refusal with examples.whyNotgives that text: the reason fromtime-help.ts, in plain text, or examples while it isn't understood yet.AGENTS.mdasks.services/parking-time.tsgetspreviewParkingDuration. For now it reads parking's own durations andrest of day. PR 3 moves/parkontoreadHowLong, sountil 17:00works and previews too.Why only
/park forThe spec asked for a preview on every slash option that takes a time.
/park foris the only one:/admin→ Parking is one subcommand that opens a panel, and its From, Until, How long and Reset are typed on forms, like/schedule's times. Discord forms (modals) can't autocomplete. An earlier version of this PR added suggestions to the panel's operations, but nothing calls them. That code is gone (thanks to the Sentry review). On forms, the draft or reply shows what was understood, and PR 3 gives those fields consistent placeholders. When a time becomes a slash option later (#197, #199),previewSuggestionsandwhyNotare ready for it.After deploying
Nothing extra:
/park for:already had autocomplete.Review
Core: one new file,
core/time-suggest.ts. Suggestions go throughDispatcher.suggestas before (same access checks, 25 at most, names clipped). Nothing typed is logged. No rule 14 paths are touched.Testing
just checkpasses.tests/core/time-suggest.test.ts, the/park forsuggestion test (now with previews and the not-understood hint), andpreviewParkingDurationtests.Part of #200.
🤖 Generated with Claude Code