Repository navigation
Conversation
Make the two composer menus behave the same way and explain themselves: - Tab completes the highlighted name in the / menu instead of running the command, matching the @ menu; Enter still selects. - Esc keeps a menu closed until its / or @ is deleted and typed again, and a click outside the editor and menu closes it. - A message starting with 、 opens the / menu, and @ typed directly after CJK text opens the @ menu; @ after Latin text stays closed. - The / menu gets a Commands heading and skill icons, both menus get a key hint footer, and outdated file rows are replaced by a searching row. - The empty composer placeholder says how to use @ and /.
🦋 Changeset detectedLatest commit: 750ea97 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edbca58fb7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…action-table-59a701 # Conflicts: # packages/app-components/src/composer/Composer.vue
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a09d64e404
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…action-table-59a701 # Conflicts: # packages/app-client/src/composables/useMentionMenu.ts # packages/app-client/test/useMentionMenu.test.ts # packages/app-components/src/composer/Composer.vue # packages/app-components/src/composer/MentionMenu.vue # packages/app-composer/src/shared/icons.ts
Requirement or Bug
The desktop and web composer has two typeahead menus,
/for commands and skills and@for references, and they disagreed with each other. Tab ran a command in one and completed a name in the other, Esc did not stick in either, stale file results stayed on screen but could not be selected, and nothing told a new user that either menu exists. This PR makes the two menus behave the same way and adds the missing guidance.Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
Core idea. Each menu's state lives in one composable, and the composer only forwards keys to it. The change adds the same three verbs to both composables, so the composer can treat them identically:
complete(Tab),dismiss(Esc, sticky) andclose(blur, outside click, session switch; not sticky).Sticky dismissal. Esc records what was dismissed: for
/a flag, for@the offset of the trigger character.update()returns early while the caret's token is still that one. A synchronous watcher on the text clears the record as soon as the trigger character is gone, so deleting and retyping reopens the menu, and so does a programmatic clear such as submit. A plainclose()also clears it, which keeps a dismissal from leaking into another session's draft.Triggers.
/menu: the token test is now^[/、]\S*$. Chinese IMEs type、for the slash key. Selecting or completing rewrites the whole token, so the text is normalized to/. A、token opens the menu only when at least one command matches, so a message that really starts with、is left alone.@menu: a token still has to start a word, but an@whose preceding character is CJK now counts too. The check uses Unicode property escapes:scx(Script_Extensions) is used instead ofScriptbecause it also covers CJK punctuation such as。and、. Full-width forms such as,belong to no CJK script property and JavaScript has no\p{Block=…}, hence the one literal range.Stale file rows. The
fileStaleflag is gone. When the query changes, the old file results are dropped immediately, and the view renders a non-selectable "Searching for “x”…" row under a Files heading until the new results land. Skills, attachments and browser references are local and stay visible throughout.Views.
Both menu roots now prevent the default on
mousedownin the popup layout, so clicking a heading or padding no longer blurs the editor and closes the menu. The viewport clamp counts the footer height.Reading guide. Start with
useSlashMenu.tsanduseMentionMenu.tsfor the behaviour, thenhandleKeydownand the pointerdown watcher inComposer.vue. The two menu views andComposerMenuHints.vueare presentational. The rest is strings and tests.No screenshots are attached yet.
Behavior Changes and Affected Users
The renderer is shared, so every row applies to the desktop app and to the web UI once the web bundle is synced, unless the row says otherwise. Side chat is unaffected: both menus are disabled there.
/menu/newand/clear, inserts the skill tag/menu on a skill whose name contains whitespace/or@is deleted and typed again, or after blur、/menu when a command matches; Enter or Tab replaces the token with the command、followed by text that happens to match a command name or description@directly after CJK text, e.g.你好@@menu; selecting replaces only the@token@after Latin text, e.g.abc@,user@example.com@search is pending@menu when other rows exist/menu headingsModules.
packages/app-client(the two composables),packages/app-components(composer and menu views),packages/app-i18n(en and zh strings).Coverage. Each row with a behaviour change has a unit or component test:
slash-menu.test.ts(、trigger and normalization, Tab completion, dismissal),useMentionMenu.test.ts(CJK trigger matrix including the unchanged Latin cases, dismissal, dropped stale rows) andslashMenuPointer.test.ts(headings, skill icon, footer, searching row). The/menu, Tab, Esc, outside click,、,你好@andabc@were also checked by hand in a local web build.Not verified by hand: the
@menu with real file results and skill rows in the/menu, because the scratch instance had no project or skills. The pointerdown listener and the Tab and Esc key paths inComposer.vuehave no automated test; they were only exercised by hand.Test run details
app-components,app-client,app-i18n,app-core) pass: 312 files, 4446 tests. The run used Node 26 withNODE_OPTIONS=--no-experimental-webstorage; without that flag 60 tests in 9 files that this PR does not touch fail on Node 26's built-inlocalStorage. Not run on Node 24.15.vue-tscfor the renderer andoxlintpass. The ratchet check reportsscripts/release.test.mjs, which this PR does not touch.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.