Skip to content

fix(flow-chat): accept directories from the context picker on Enter and click - #3336

Merged
kev1n77 merged 1 commit into
GCWing:mainfrom
kev1n77:fmy/bugfix
Oct 10, 2026
Merged

kev1n77 merged 1 commit into
GCWing:mainfrom
kev1n77:fmy/bugfix

Conversation

@kev1n77

@kev1n77 kev1n77 commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

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, Enter on 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 and Enter Select, 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 (Enter accepts 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 plus tsc --noEmit) -> passed.
  • pnpm run i18n:audit -> passed with 0 warnings after adding flow-chat.contextPicker.openDirectory to en-US, zh-CN, and zh-TW.
  • Not covered: no manual run on a live desktop build. The changed behavior is exercised through the JSDOM keyboard and pointer contracts above only.

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 a title tooltip; 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

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

…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.
@kev1n77
kev1n77 merged commit 166ab04 into GCWing:main Oct 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant