fix(components): make a chip click select its mention, and ArrowLeft walk one path level - #6
Draft
pythonlearner1025 wants to merge 2 commits into
Draft
Conversation
added 2 commits
September 2, 2026 00:25
…walk one path level Two defects in the `@` composer. A committed chip answers no click. `MentionInput` already hit-tests the click point against the highlight mirror, but the hit only forwards to the optional `onMentionClick`; nothing happens to the range itself, so for every kind without a kind-specific handler the click has no visible outcome. A committed mention is already atomic to every other input path — Backspace deletes the whole range and the horizontal arrows step over it — so a caret dropped inside one is a position no edit can use. Select the range on a hit, and call the optional handler on top of it. The chip mirror already paints a selected range; until now only a drag could reach it. The file drill-down leaves the Files category. Descending into a directory writes a bare path (`@src/`), which carries no `<namespace>:` prefix, so `selectMentionMenuView` falls back to the aggregate level and lists slash commands and issues beside the files. ArrowLeft then closes the menu instead of going up a level, because `tryNavigateBack` only pops a `<namespace>:` prefix. - `MentionCategory` gains `ownsBareSearch`; the file category claims a search containing `/`, so the selector stays neutral and asks the categories rather than naming one. - `getMentionDrillDownParent` answers the search one level up — `<ns>:` to the bare trigger, `src/components/` to `src/` — and is shared by ArrowLeft and the menu's own Back button, so both move by one rule. - `onNavigateBack` takes the destination search, defaulting to the bare trigger. Backspace is deliberately unchanged: inside a path it still deletes one character at a time. Model: claude-opus-5[1m]
…search owner Model: claude-opus-5[1m]
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.
Two defects in the
@composer.A committed chip answers no click.
MentionInputalready hit-tests the clickpoint against the highlight mirror, but the hit only forwards to the optional
onMentionClick; nothing happens to the range itself, so for every kind withouta kind-specific handler the click has no visible outcome. A committed mention is
already atomic to every other input path — Backspace deletes the whole range and
the horizontal arrows step over it — so a caret dropped inside one is a position
no edit can use. Select the range on a hit, and call the optional handler on top
of it. The chip mirror already paints a selected range; until now only a drag
could reach it.
The file drill-down leaves the Files category. Descending into a directory writes
a bare path (
@src/), which carries no<namespace>:prefix, soselectMentionMenuViewfalls back to the aggregate level and lists slashcommands and issues beside the files. ArrowLeft then closes the menu instead of
going up a level, because
tryNavigateBackonly pops a<namespace>:prefix.MentionCategorygainsownsBareSearch; the file category claims a searchcontaining
/, so the selector stays neutral and asks the categories ratherthan naming one.
getMentionDrillDownParentanswers the search one level up —<ns>:to thebare trigger,
src/components/tosrc/— and is shared by ArrowLeft and themenu's own Back button, so both move by one rule.
onNavigateBacktakes the destination search, defaulting to the bare trigger.Backspace is deliberately unchanged: inside a path it still deletes one
character at a time.
Compatibility
Every change is additive at its default. With the new prop, parameter or flag
absent, the touched components render and behave exactly as they do today, and
no existing call site in this repository passes one.
Testing
packages/componentstypecheck and the full vitest suite pass. Addstests/mention-drill-down.test.ts, coveringgetMentionDrillDownParentat every level and the bare-path routing throughselectMentionMenuView. The chip-click half is not unit tested here:isPointInsideMentionHighlightmeasures real client rects, which jsdom does not produce.Notes for the reviewer
ui/mention/AGENTS.mdsays ArrowLeft shares Backspace's namespace-only rule. That sentence is superseded by this change; the doc file is left untouched so the merge surface stays at the five source files, and it should be updated with (or right after) this PR.Review metadata
BlitzOS fork only. Delete this section before sending the PR to
LodyAI/Lody.blitz/seam-11-mention-chip-click-and-path-drilldownf3474894 (the pinned upstream commit)