Skip to content

fix: retire mention searches after chips and refuted prose - #303

Merged
kalvinnchau merged 3 commits into
mainfrom
cid/composer-autocomplete-lifecycle
Sep 25, 2026
Merged

kalvinnchau merged 3 commits into
mainfrom
cid/composer-autocomplete-lifecycle

Conversation

@kalvinnchau

Copy link
Copy Markdown
Contributor

After a mention chip is inserted, typing prose next to it no longer reopens "Searching community…" or the retry suggestions, and no longer sends a relay profile search on every keystroke.

Changes

  • Host (completion.ts, ComposerCompletions.tsx, MessageComposer.tsx): a trigger that starts inside a resolved recipient chip is not treated as an open query. Triggers typed after the chip stay eligible. Chip ranges are applied only when they were measured against the current draft text.
  • Mention provider (MentionCompletion.tsx): a multi-word query that doesn't continue a known name closes with no items, status or retry row, matching detectPrefixQuery in block/buzz.
  • Directory (useMentionDirectory.ts): a prefix search that completes empty is remembered per relay session. Queries that only extend that prefix skip the search; Retry still searches.

Verification

  • pnpm check (biome, tsc, design checks)
  • Vitest: completion.test.ts and session-agents.test.tsx, including new regression tests
  • Playwright typeahead.spec.mjs and completion-work.spec.mjs in chromium and webkit. A new spec covers prose after a chip, the caret next to a chip, dismissal, fresh triggers and search-traffic counts.
  • Manually verified in the app: typing after a chip no longer queries per keystroke.

@kalvinnchau
kalvinnchau requested review from a team, comp615 and wesbillman as code owners September 25, 2026 21:53
Signed-off-by: cid <d9f92a72922bf45c17379a47d64dae84b6020397c2d5a52b5317d512068cd9d3@buzz.block.builderlab.xyz>
@kalvinnchau
kalvinnchau force-pushed the cid/composer-autocomplete-lifecycle branch from 5fd333b to ac5a483 Compare September 25, 2026 21:55

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Star Lord automated source review, published via Wes’s account.

Reviewed head ac5a48352f802453d99dd9dc41d5735bd66ce507 against base/merge-base 07f071a58ec27ff1fbe9f19d1489f572c23f9c43.

Two P2 correctness findings and one P3 regression-test ordering finding are inline. The chip-range exclusion and current-draft-text fence are consistent with the existing composer observation/recipient lifecycle; the remaining issues concern directory lookup semantics, error recovery, and whether the late-search cases actually hold an in-flight request.

Scope: complete 10-file diff, both directory-hook consumers, mention admission, exact-key/name lookup, composer observation/insertion, and related tests/docs. Source-only: no tests, builds, app launches, or PR-code execution. The PR’s reported Vitest/browser/manual passes were not independently rerun; CI was not inspected. Native editing/runtime behavior and human acceptance remain unverified. This is a non-blocking COMMENT, not approval or merge authorization.

Comment thread src/bundled/mentions/useMentionDirectory.ts Outdated
Comment thread src/bundled/mentions/MentionCompletion.tsx Outdated
Comment thread tests/browser/completion-work.spec.mjs
cid added 2 commits September 25, 2026 15:18
Signed-off-by: cid <d9f92a72922bf45c17379a47d64dae84b6020397c2d5a52b5317d512068cd9d3@buzz.block.builderlab.xyz>
Signed-off-by: cid <d9f92a72922bf45c17379a47d64dae84b6020397c2d5a52b5317d512068cd9d3@buzz.block.builderlab.xyz>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Star Lord automated source review, published via Wes’s account.

Reviewed head 1790a0a28484815d54d99c583b4c3c1d6bced242 against base/merge-base 07f071a58ec27ff1fbe9f19d1489f572c23f9c43. This follow-up checks the fixes since ac5a48352f802453d99dd9dc41d5735bd66ce507 and regressions introduced by those fixes, rather than reopening unchanged areas.

No actionable findings in this follow-up source review. All three findings from review 5323141727 are addressed in source:

  • useMentionDirectory.ts:38–62 lets exact 64-hex author lookups bypass negative name-prefix evidence and prevents exact-key results from populating that cache. The added regression covers an empty partial-key search followed by the complete key.
  • MentionCompletion.tsx:129,170–203 preserves the error and Retry action for failed multi-word directory searches; the regression covers recovery to an outside recipient.
  • completion-work.spec.mjs:247,267 waits for the current query to reach the held-search gate before Tab/Escape. The fixture records that intermediate state, and both cases retain release-in-finally and pending-read completion barriers.

Also checked the strict-extension/non-word cache changes, fresh same-query remount behavior, both directory-hook consumers, and the existing composer revision/cancellation boundary. The five-file follow-up is bounded; the prior composer/insertion source remains byte-identical. The pinned diff whitespace check is clean.

Limitations: source-only; no tests, builds, installs, app launches, or PR-code execution. Added tests were inspected, not run. Author-reported checks/manual verification were not independently rerun; CI was not inspected. Browser/native runtime behavior and human acceptance remain unverified. This is a non-blocking COMMENT, not approval or merge authorization.

@kalvinnchau
kalvinnchau merged commit d4fa23b into main Sep 25, 2026
23 of 25 checks passed
@kalvinnchau
kalvinnchau deleted the cid/composer-autocomplete-lifecycle branch September 25, 2026 22:52
loganj pushed a commit that referenced this pull request Sep 25, 2026
…oser

Main gained two mention changes while this branch was open: archived
identities leave choices but never hide the viewer (#256), and prose after
an unknown name closes the menu without extra directory reads (#303).

- One archivedMention rule now owns the viewer exemption for candidates,
  disabled installed rows and the send-entry guard. The old per-surface
  predicate is removed.
- The directory keeps #303's exhausted-prefix refutation. Only non-empty
  pages are cached, so an empty result is refuted by prefix evidence and a
  fresh search for the same query reads again.
- Inline completion withdraws its menu for prose once local and directory
  evidence settle.
- Tests from main follow this branch's rules: shown rows stay in place while
  disabled, and public keys match no choice.

Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
zrmarley added a commit that referenced this pull request Sep 28, 2026
…ad-on-send

* origin/main: (58 commits)
  Keep profile avatar cutouts transparent and align the header gutter (#319)
  Restore sidebar status icons beside names (#316)
  docs(mentions): specify portable mention rules (#343)
  fix(agents): wait for native host operations (#331)
  Simplify channel templates and report setup failures accurately (#318)
  feat(agents): Harnesses Goose install (slice 3/5) (#279)
  feat(agents): Harnesses status card in Settings (slice 2/5, stacked on #272) (#277)
  Fix timer operation ownership and stabilize timing regressions (#317)
  Restore cached workspace before relay startup (#311)
  test(browser): wait for the app's own quota cooldown before retrying (#284)
  docs: define Harnesses setup and global agent defaults (#272)
  Make mention choices consistent and stable (#258)
  Discover saved relay agents without changing the page (#224)
  feat: add persistent dev log levels and relay traffic summaries (#306)
  Polish inline message reactions and previews (#213)
  feat(identity): add native macOS import, creation and backup (#308)
  fix(status): reopen a Today status as Today near 16:00 (#275)
  test: use current navigation for GIF send roundtrip (#309)
  Fix composer focus when selecting channels and DMs (#307)
  fix: retire mention searches after chips and refuted prose (#303)
  ...

# Conflicts:
#	src/features/messages/MessageComposer.test.tsx
#	src/features/messages/MessageComposer.tsx
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.

2 participants