Skip to content

Support multiword mention autocomplete sessions - #2345

Open
jshph wants to merge 3 commits into
get-bb:mainfrom
jshph:fix/spaced-mention-autocomplete
Open

Support multiword mention autocomplete sessions#2345
jshph wants to merge 3 commits into
get-bb:mainfrom
jshph:fix/spaced-mention-autocomplete

Conversation

@jshph

@jshph jshph commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What was wrong

The prompt mention trigger scanner treated every whitespace character as the end of an @ query. Thread matching already supported multiword titles, but the editor stopped dispatching the query at the first space, so those matches were unreachable. The menu also treated its initially highlighted row as intentional keyboard selection, which made a longer-lived autocomplete session unsafe for Return/Send behavior.

What changed

Mention queries now preserve spaces verbatim while stopping at natural delimiters, with editor-local session state for explicit dismissal and settled no-match suppression. A silent no-match session can reopen after backspacing to a viable query, while an explicitly dismissed occurrence stays closed. Passive Enter no longer applies a suggestion; desktop Tab or intentionally navigated Enter can apply, and coarse-pointer users apply by tapping. Touch layouts get a dedicated 44×44 close target that does not overlap results. Thread suggestions retain fuzzy match and relationship priority, then prefer active and recently attended threads. No wire contracts or protocol versions changed.

How you verified

Added regressions that fail before this change and pass after for multiword/verbatim whitespace queries, punctuation and newline exits, silent no-match reopening, dismissal persistence, passive desktop and coarse-pointer Enter, tap application, touch close sizing, copy/text preservation, and activity/recency ranking.

pnpm exec turbo run test --filter=@bb/client-core -- --run test/find-active-trigger.test.ts
pnpm exec turbo run test --filter=@bb/app -- --run src/components/promptbox/PromptBoxInternal.ipados.test.tsx src/components/promptbox/PromptBoxInternal.test.tsx src/hooks/threadMentionSuggestions.test.ts
pnpm exec turbo run typecheck --filter=@bb/client-core --filter=@bb/app
pnpm exec turbo run lint --filter=@bb/app
pnpm exec oxfmt --check apps/app/src/components/promptbox/PromptBoxInternal.test.tsx apps/app/src/components/promptbox/PromptBoxInternal.tsx apps/app/src/components/promptbox/mentions/MentionMenu.tsx apps/app/src/hooks/threadMentionSuggestions.test.ts apps/app/src/hooks/threadMentionSuggestions.ts packages/client-core/src/prompt/mentions/find-active-trigger.ts packages/client-core/test/find-active-trigger.test.ts
git diff --check

All checks passed. App lint reported 181 pre-existing warnings and zero errors.

Fixes: N/A (no linked issue).

AGENT GENERATED

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