Repository navigation
fix(flow-chat): accept directories from the context picker on Enter and click - #3336
Merged
Merged
Conversation
…nd click Enter, Tab, and a row click in the '@' reference picker now add the highlighted directory or file as context instead of descending into a directory, so accepting a row never changes the browsing level. Entering a directory stays on the explicit affordances: the arrow keys and a click on the trailing chevron, which now carries a localized tooltip. Adds one locale string per locale for that tooltip.
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.
Summary
Fix the
@reference picker so accepting a row never changes the browsing level:Enter,Tab, and a mouse click on a row now add the highlighted directory or file as context, while the arrow keys and the trailing chevron stay the explicit way to enter a directory or go back up one level.Fixes: N/A (no linked issue)
Type and Areas
Type:
bug fix
Areas:
web UI
Motivation / Impact
Before this change,
Enteron a directory in the@reference picker descended into that directory instead of adding it as context, and a mouse click on a directory did the same. The picker footer already promised→Enter andEnterSelect, so the acceptance key silently navigated instead of accepting, and a directory could not be referenced at all with the mouse. Now the picker separates the two intents on every input device:Enter,Tab, and a row click accept the highlighted directory or file,→or a click on the trailing chevron enters a directory, and←goes back up one level. File rows, search mode, the source level, skills, MCP, and session references keep their existing behavior. The trailing chevron on a directory row gains a localized tooltip that names its action.Verification
pnpm --dir src/web-ui run test:run src/flow_chat/components/ChatContextPickerOverlay.test.tsx src/flow_chat/components/overlayClippingContract.test.ts src/flow_chat/utils/chatInputKeyOwnership.test.ts-> 3 files, 39 tests passed. Two new picker cases cover the keyboard contract (Enteraccepts a directory,→still enters it) and the pointer contract (a row click accepts a directory, the trailing chevron enters it); reverting either fix makes the matching new case fail.pnpm run check:web(Appearance contract plustsc --noEmit) -> passed.pnpm run i18n:audit-> passed with 0 warnings after addingflow-chat.contextPicker.openDirectoryto en-US, zh-CN, and zh-TW.Reviewer Notes
The picker renders rows through the design system
ListboxOption, which is one<button>per row, so the open-a-directory affordance is a hit region on that same button ([data-openbitfun-part="indicator"]) rather than a nested button, which would be invalid HTML and would break the option's accessibility tree. The hit test is limited to a directory row in browse mode, so sources, actions, files, and search results are unaffected. The chevron only gains atitletooltip; no new hover styling, theme token, or color baseline is involved. Right-click on a directory row still enters it, unchanged, and remains available as a second pointer path for browsing.Checklist