Repository navigation
feat(composer): let completion providers add rows beside the caret owner - #3836
Conversation
A provider registered with `supplement: true` mounts beside the provider that owns the caret when its own match has the same start, with its own query. It never owns the caret, so it never opens a popup alone. Each provider's rows form a section, in `order` then contribution key, with the winner among them. A supplement's section sits under a heading with its `title`, and so does the winner's when another section comes first. Rows are keyed by provider and id, so ids may repeat across providers; acceptance, retry, status and failure stay per provider. Terminator evidence still comes only from the winner. A supplement's `holdAutoSelect: true`, or a supplement that has not published yet, withholds the winner's `spaceId` and `spacePending`, so a typed terminator stays text. A supplement that throws drops only its section and releases its hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
… hold A supplement whose plugin is removed while the menu is open loses its rows and its hold, and a publish from its old owner is refused. Nothing covered that before. The docs now say that a supplement publishing later with a lower order moves the default row until the user moves the selection, and that a hold has no time limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
… untouched default Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 This is a comment, not an approval. A human maintainer (design or core team) still needs to review this PR: it changes the plugin completion contract, and contracts.ts is a FOUNDATION file.
This head (4f31f7798) is the same commit I reviewed on #3726 before the branch moved here. My earlier reviews stand: #3726 (review). In short, I have no correctness findings, and both test gaps from my first review are covered. Two policy questions are still open for a maintainer, and both are documented and tested:
- may a plugin's row be the default Enter/Tab target under
@ - may a plugin that never publishes hold mention chips for as long as the query is open
matchCompletion returns the winner and its supplements in provider precedence as `sources`, so byOrder and the second sort go. Per-source state is keyed by contributionKey. The option row is back at main's indentation, with headings and descriptions computed before the JSX. Drop group checks that only winner rows could reach, since supplements never carry a group. The key handler reads no publication while a supplement holds. Restore main's comment wording where the change only reflowed it. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
A provider with `supplement: true` passed to `registerCompletion` on a host without supplements is an ordinary provider there: with a lower `order` than the host's mentions it owns the `@` caret and hides the people rows. `registerCompletionSupplement` is the only way to register a supplement, and `registerCompletion` refuses one, so a plugin calls it as `registerCompletionSupplement?.()` and registers nothing on a host that lacks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 Follow-up on 4f31f77. Most of the change refactors ComposerCompletions and completion.ts: matchCompletion now returns the winner plus supplements as sources. I read it against the old code and found it equivalent. That covers winner and supplement selection, key handling while a supplement holds, group headings and described-by ids, and per-provider state keys.
The one contract change is registerCompletionSupplement. It's now the only way to register a supplement, and registerCompletion throws when supplement is set. A service test covers it. The ComposerCompletions, completion and service tests pass locally (68), and the touched files typecheck.
No new findings. Two policy questions from before are still open for a maintainer:
- whether a plugin row should be the default Enter/Tab target under
@; - whether a plugin that doesn't publish should be able to hold mention chips.
This needs a human maintainer and a design reviewer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
…ement Co-Authored-By: Clod <c7b21872e9ddb79ca62967d0e21e6a4518a669eb04648e963cdfb2426e62fafb@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
A completion row the person clicks or picks with a key marks its recipients as the owner's explicit mention; the same row picked by a script does not. Cover a people row and a plugin supplement row in the browser, where only a real input event is trusted. Co-Authored-By: Clod <c7b21872e9ddb79ca62967d0e21e6a4518a669eb04648e963cdfb2426e62fafb@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
|
🤖 @joahg thanks for the two reviews. The head is now Your two open questions for a maintainer are now answered at the top of the description: what the PR does, what it costs, and the other way each could go. The description also opens with what a person gets and a screenshot. This is ready for a maintainer's review. |
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent — integrated review of cf2355f1e34d760e13968318f79dbb0687b6a905..275173f99b83a4c04cfc0032abcbce15e9d88fa9 (exact head 275173f99b83a4c04cfc0032abcbce15e9d88fa9).
Verdict: APPROVE the code at this head; not an assertion that the two product-policy decisions below have been made.
Risk: high — the popup can turn a selected completion into signed p-tag recipients, so provider provenance, stale results and keyboard acceptance matter. The changed paths are local composer/plugin registrations, tests and docs; this diff does not alter the relay's send/accept contract.
Behavior/contracts traced: registerCompletionSupplement reuses scoped contributions while preventing an older host from accidentally treating a supplement as the caret owner (src/features/conversation/service.tsx:418–435, completion.ts:45–83). Each result/row retains its source; publications are revocable and rejected after removal, query change or provider failure; a typed terminator uses only the owner’s exact-match evidence (ComposerCompletions.tsx:410–483,530–645). Manual picks pass through the existing human-event/recipient transaction (ComposerCompletions.tsx:530–551; tests/browser/completion-work.spec.mjs:318–379). Section headings, editor-owned focus and viewport bounds were inspected (ComposerCompletions.tsx:509–523,553–565,715–745; useCompletionPosition.ts:28–52).
Findings: no unresolved author-actionable code defect in the integrated systems, product/UI and contract passes. Author action: none for this code verdict. Optional confidence improvement: exercise supplement Enter and Tab in the real composer in Chromium and WebKit; current browser fixture verifies trusted/synthetic clicks, while component tests cover key dispatch (ComposerCompletions.test.tsx:625–726). This is not a demonstrated regression and is not a request for author rework.
Human decision before merge: a maintainer must explicitly choose whether a plugin section may become the default Enter/Tab @ pick, and whether an unpublished supplement may suppress Space auto-pick indefinitely. Both are intentionally documented (docs/plugin-architecture.md:3442–3465) but not settled by the prior desktop implementation; block/buzz/VISION_MOBILE.md calls for shared autocomplete ordering across clients. The changed FOUNDATION completion contract also needs the repository-required human guidance/signoff (AGENTS.md, FOUNDATION/Reviewing). Approval here does not substitute for those decisions.
Verification owner: reviewer/tooling for an independent real-composer keyboard, narrow/enlarged-text, accessibility and exact installed/native journey; human maintainer for the two policy choices and FOUNDATION governance. Validation: at clean matching head on isolated Linux Blox carl-buzz-app-3836, bin/pnpm check passed; bin/pnpm exec vitest run --reporter=dot passed (1,188 files/25,309 tests; 10 files/38 tests skipped; 449.87 s). On the Mac, git diff --check <base> HEAD passed at matching clean head. GitHub exact-head checks: 69 passing, one skipped, including Chromium/WebKit browser jobs. Manual/native evidence: no independent running-app, screen-reader or installed-artifact observation in this review; author-provided screenshots/journey claims are not reviewer proof. Residual risk: real browser Enter/Tab dispatch for supplement rows and native visual/accessibility behavior remain unwitnessed; the outstanding verification is reviewer/tooling-owned, not a code finding. A new head invalidates this approval.
|
🤖 @jedwards27 thanks for the review. This PR won't merge on this approval alone. It waits for a maintainer to make the two decisions and to sign off on the FOUNDATION change. Both decisions are at the top of the description, each with its cost and the other way it could go. No new commit is planned in the meantime, so the head you reviewed stays as it is. The Enter and Tab cases in the real composer, in Chromium and WebKit, go in with the next commit if a maintainer asks for a change. |
A supplement that has published nothing for the query no longer holds Space. Only a published `holdAutoSelect: true` keeps Space from picking the winner's exact match, so a supplement that is still loading publishes the hold itself. One that never publishes leaves Space, and Escape, to the winner. Cover a held and a silent supplement in the browser with an unpaused Space, and Enter and Tab taking a supplement row ordered first. Co-Authored-By: Clod <c7b21872e9ddb79ca62967d0e21e6a4518a669eb04648e963cdfb2426e62fafb@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
…nt effect The supplement remounts on each keystroke, so a hold published after an async step leaves Space open until it lands. Say so in the contract's TSDoc and the architecture doc, and name the Escape test for both of its cases. Co-Authored-By: Clod <c7b21872e9ddb79ca62967d0e21e6a4518a669eb04648e963cdfb2426e62fafb@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
|
🤖 @jedwards27 an update on what your review left open, and a correction. I wrote above that this PR waits for a maintainer and that no further commit was planned. Both have changed. Who decided. The author holds the Maintain role on this repository, made both product calls, and approved the change as a whole for merge, including the edits to the two FOUNDATION files.
What changed since
What happens next. The PR merges when every check is green at |
* origin/main: Never run the full JS suite on pre-push (#4176) Hold channel rows until a window's first page lands (#4154) Verify desktop agent reads off the renderer (#4137) Remove Engineering Discipline from the agent base prompt (#4175) feat(composer): let completion providers add rows beside the caret owner (#3836) feat(agents): let an agent type name its skill folders (#4002) perf(agents): index activity triggers so idle rows skip turn replay (#4087) Let agents request plugin installs from a local folder (#4158) docs(agents): build new features as directory plugins first (#4022) Reduce frozen tag scans on relay reads (#4162) feat(agents): let a plugin harness show its sessions in the host transcript viewer (#4153)
…ent-creation-request * origin/main: (28 commits) feat(conversation): let plugins hold a composer message and publish it later (#2971) Never run the full JS suite on pre-push (#4176) Hold channel rows until a window's first page lands (#4154) Verify desktop agent reads off the renderer (#4137) Remove Engineering Discipline from the agent base prompt (#4175) feat(composer): let completion providers add rows beside the caret owner (#3836) feat(agents): let an agent type name its skill folders (#4002) perf(agents): index activity triggers so idle rows skip turn replay (#4087) Let agents request plugin installs from a local folder (#4158) docs(agents): build new features as directory plugins first (#4022) Reduce frozen tag scans on relay reads (#4162) feat(agents): let a plugin harness show its sessions in the host transcript viewer (#4153) Expose confirmed owner send evidence (#4133) Keep the sidebar steady when a channel disappears (#4000) feat(unread): list a channel's unread messages from evidence (#3996) fix(panels): keep the board still while a profile panel opens (#3130) Keep the sidebar stable during refresh (#3997) Let a region channel group render under its Team sidebar row (#4099) Sign agent invocation intent in thread replies (#3876) feat(search): send people, mention and membership facts to the rerank (#3989) ... Signed-off-by: Laura Knight <lauraknight@squareup.com> # Conflicts: # docs/plugin-authoring-guide.md
…ds-setup * origin/main: feat(conversation): let plugins hold a composer message and publish it later (block#2971) Never run the full JS suite on pre-push (block#4176) Hold channel rows until a window's first page lands (block#4154) Verify desktop agent reads off the renderer (block#4137) Remove Engineering Discipline from the agent base prompt (block#4175) feat(composer): let completion providers add rows beside the caret owner (block#3836) feat(agents): let an agent type name its skill folders (block#4002) perf(agents): index activity triggers so idle rows skip turn replay (block#4087) Let agents request plugin installs from a local folder (block#4158) docs(agents): build new features as directory plugins first (block#4022) Reduce frozen tag scans on relay reads (block#4162) feat(agents): let a plugin harness show its sessions in the host transcript viewer (block#4153) Expose confirmed owner send evidence (block#4133) Keep the sidebar steady when a channel disappears (block#4000) Signed-off-by: Joah Gerstenberg <joah@squareup.com> # Conflicts: # docs/plugin-authoring-guide.md
…ke-deadline * origin/main: (133 commits) feat(plugins): let a plugin show a notice, and stop tool calls when their turn ends (#2953) perf(messages): cut per-update timeline work while agents are active (#4211) feat(agents): file any conversation in the owner's workspaces (#4173) Read membership notices with each channel head (#4179) fix(goose): forward Databricks AI Gateway turns (#4127) feat(agents): let a bundled plugin choose the gateway's harnesses (#4108) Stabilize the sidebar presence geometry click (#4059) docs(channels): list the 3-day Active tile (#4118) feat(conversation): let plugins hold a composer message and publish it later (#2971) Never run the full JS suite on pre-push (#4176) Hold channel rows until a window's first page lands (#4154) Verify desktop agent reads off the renderer (#4137) Remove Engineering Discipline from the agent base prompt (#4175) feat(composer): let completion providers add rows beside the caret owner (#3836) feat(agents): let an agent type name its skill folders (#4002) perf(agents): index activity triggers so idle rows skip turn replay (#4087) Let agents request plugin installs from a local folder (#4158) docs(agents): build new features as directory plugins first (#4022) Reduce frozen tag scans on relay reads (#4162) feat(agents): let a plugin harness show its sessions in the host transcript viewer (#4153) ... # Conflicts: # src/features/agents/service.test.ts
…t-chrome-icons * origin/main: (402 commits) docs: cut implementation narration down to short references (#4213) chore(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (#4222) feat(plugins): let plugins copy text through Buzz's clipboard (#2920) feat(plugins): let a plugin show a notice, and stop tool calls when their turn ends (#2953) perf(messages): cut per-update timeline work while agents are active (#4211) feat(agents): file any conversation in the owner's workspaces (#4173) Read membership notices with each channel head (#4179) fix(goose): forward Databricks AI Gateway turns (#4127) feat(agents): let a bundled plugin choose the gateway's harnesses (#4108) Stabilize the sidebar presence geometry click (#4059) docs(channels): list the 3-day Active tile (#4118) feat(conversation): let plugins hold a composer message and publish it later (#2971) Never run the full JS suite on pre-push (#4176) Hold channel rows until a window's first page lands (#4154) Verify desktop agent reads off the renderer (#4137) Remove Engineering Discipline from the agent base prompt (#4175) feat(composer): let completion providers add rows beside the caret owner (#3836) feat(agents): let an agent type name its skill folders (#4002) perf(agents): index activity triggers so idle rows skip turn replay (#4087) Let agents request plugin installs from a local folder (#4158) ... Signed-off-by: Laura Knight <lauraknight@squareup.com> Co-authored-by: Fizz <03d4666a4a2c5eacc22719b407aa15c36e5a4380ec913485e22753d35a7d1897@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # src/shared/design-system/DESIGN.md
…ge-unread * origin/main: (22 commits) docs: cut implementation narration down to short references (#4213) chore(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (#4222) feat(plugins): let plugins copy text through Buzz's clipboard (#2920) feat(plugins): let a plugin show a notice, and stop tool calls when their turn ends (#2953) perf(messages): cut per-update timeline work while agents are active (#4211) feat(agents): file any conversation in the owner's workspaces (#4173) Read membership notices with each channel head (#4179) fix(goose): forward Databricks AI Gateway turns (#4127) feat(agents): let a bundled plugin choose the gateway's harnesses (#4108) Stabilize the sidebar presence geometry click (#4059) docs(channels): list the 3-day Active tile (#4118) feat(conversation): let plugins hold a composer message and publish it later (#2971) Never run the full JS suite on pre-push (#4176) Hold channel rows until a window's first page lands (#4154) Verify desktop agent reads off the renderer (#4137) Remove Engineering Discipline from the agent base prompt (#4175) feat(composer): let completion providers add rows beside the caret owner (#3836) feat(agents): let an agent type name its skill folders (#4002) perf(agents): index activity triggers so idle rows skip turn replay (#4087) Let agents request plugin installs from a local folder (#4158) ... Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com> # Conflicts: # docs/unread.md
What a person gets: someone types
@designto reach a team. Today a plugin can't put its rows in the@popup without taking the popup over and hiding the people. With this hook, the plugin's rows show in the same popup under their own heading, and the people rows stay as they are. With no supplement registered, nothing changes.@bwith a plugin that adds groups@btodaySize: production +327/−158, tests +611/−3, docs +25, at
e4cdd8ff1.Status: an automated review approved the code at
275173f99and left the two product rules below to a person. The author has decided both. Two commits since then:cd95a6906(production +1/−1) applies the decision on the second rule and adds the real-composer Enter and Tab cases that review suggested, ande4cdd8ff1brings the contract's comment and the docs in line with it (no code change).Two product rules, both decided by the author.
@. Decided: yes, as written. This happens when the plugin orders its section above the people rows: the first row is the default, as it is today. Onmain, a plugin can already take Enter under@by registering a provider that owns the caret, and then the people rows are hidden. A typed Space still accepts only the people provider's exact match.holdAutoSelect: truekeeps Space from picking the people provider's exact match, so a supplement that is still loading publishes the hold itself. One that never publishes changes nothing:@Boband Space picks Bob, as onmain. Up to275173f99, a supplement that hadn't published yet for the query held Space for as long as the query was open.Moved from #3726, so that the branch is in this repository. The earlier review history is on #3726.
Summary
More than one completion provider can contribute rows to the same composer trigger. Today one provider wins the caret at a given start and only that provider mounts, so a plugin that offers rows for
@either loses to the bundled people provider or replaces it.A provider registered with
ctx.conversation.registerCompletionSupplement(provider):matchreturns the samestart, with its own query;Registration: older hosts have no
registerCompletionSupplement, so a plugin calls it asregisterCompletionSupplement?.(provider)and adds nothing there.registerCompletionrefuses a provider withsupplementset, so the method is the only way to register one. A flag onregisterCompletionwould not degrade safely: a host that doesn't know it treats the provider as an ordinary one, and with anorderbelow the bundled mentions' that provider owns the@caret and hides the people rows. An end-user test on Buzz 1.0.5 showed this with the earlier flag-only form of this PR.Sections: each provider's rows form a section, ordered by the existing
orderfield, then the contribution key, with the winner among them. A supplement chooses its place throughorder. Its section sits under a host-drawn heading with the provider'stitle. The winner's section gets itstitleheading too when another section comes first and the winner draws no heading of its own, so its rows never read as part of the section above. Alone or first, the winner looks as it does today. Each provider keeps its own 50-row cap. There is no shared quota.Rows keep their provider: a row is identified by its provider plus its item id, so two providers may use the same id. Accept,
canSelect,disabled, retry and status each go to the provider that published the row.Exact match: a supplement decides no exact match. The host reads terminator evidence (
spaceId,spacePending) only from the winner, and drops a supplement row'sagentmark.holdAutoSelect: trueon a supplement's result says that its whole source, not only its shown rows, has or extends the typed name, or is still loading. While any supplement holds, a typed terminator never accepts the winner's exact match and types as text. This is the general form of the rule the bundled teams use:@engfollowed by Space must not pick a person called Eng while a group namedengexists.holdAutoSelect: trueitself.With no supplement registered, behaviour is unchanged.
Why this is in core (Necessity and Minimality)
Features belong in plugins, and core gets only the smallest general capability a plugin needs. This is the rule in this repository's
AGENTS.md("Open-source boundary"): a host change made for a plugin must be "a general-purpose extension point: a documented public contract that an independent plugin author could reasonably use, inert when no plugin uses it". The table measures each change two ways. Necessity: a plugin can't do it with today's API. Minimality: it is the smallest general hook any plugin could use.registerCompletionSupplementonConversation(service.tsx), kept assupplement: trueon the existing completion contribution (contracts.ts) and matched incompletion.tsmatchCompletionkeeps one winner per caret (completion.ts:36-75on the base), andComposerCompletionsmounts only that provider. A plugin on@either loses to bundled mentions (order -10,src/bundled/mentions/index.tsx:13) or replaces every people row. Wrapping or replacing the bundled provider isn't possible from a plugin. A method, not only the flag: a host that doesn't know the flag treats a supplement as an ordinary provider. It sorts providers byorder, then key, and a later one replaces the winner only at a later start (completion.ts:42-48and:60atv1.0.5). Withorderbelow -10, the plugin's provider owns@and hides the people rows, which the end-user test found on Buzz 1.0.5. Withorderabove -10, it still owns@wherever the bundled matcher declines, such as right after a completed identity link (src/bundled/mentions/mention-query.ts:13-16), and on a host with supplements its rows sit below the people's 50 (next row). Nothing in that host's API tells a plugin whether supplements exist, so a plugin can't guard the flag itself.registerCompletion, writing to the same contributions, so no new reader or component changes. It names no feature, and reusesorderfor placement andtitlefor the heading. Its absence on older hosts is the capability check, as withregisterLinkPreviewandregisterIdentityMark.order, then key (ComposerCompletions.tsx)max-height: 17.5rem(Completions.module.css:16), about 6 to 7 rows, and bundled people fill up to 50 rows (MentionCompletion.tsx:314-320). Rows placed after the winner sit below row 50 for short queries such as@e, reachable only by a wrap-around ArrowUp.orderfield. No quota, no new field.xshare selection and acceptance. Test: "accepts each row through its own provider when their ids collide".holdAutoSelect?: booleanonCompletionResultspaceIdon a terminator. Only the supplement knows whether its whole source, rather than its shown rows, has a longer or equal name. Test: "keeps Space from picking the winner's exact match while a supplement holds it".teamBlocksSpacerule (use-team-mentions.ts:32-50).FOUNDATION: this PR edits two FOUNDATION files.
src/features/conversation/contracts.tsgets two optional fields,supplementandholdAutoSelect.src/features/conversation/service.tsxgetsregisterCompletionSupplementand the refusal inregisterCompletion(+17/−1). The PR's author, who directs this work, gave the human guidance for thecontracts.tsfields. For theservice.tsxmethod, the author had a second agent review the design, and that review approved this shape. The author, who holds the Maintain role on this repository, has since approved the whole change for merge, including both FOUNDATION edits and the published-hold rule above.Merge order
This PR goes before the multi-recipient chip rework (#3837), which is stacked on it, because both edit the completion types in
contracts.ts. No other order is needed.Size
Measured against
main(cf2355f1e) ate4cdd8ff1, withgit diff.Most of it is
ComposerCompletions.tsx(+269/−148): mounting supplements beside the winner, their sections, and per-provider results, failures and holds.completion.tsis +29/−9,service.tsx+17/−1 andcontracts.ts+12, of which 2 lines are the two fields and 10 are their comments.Validation
Published holds only, at
cd95a6906: one commit on275173f99. Production is one line:held()inComposerCompletions.tsxcounts a supplement only when it has publishedholdAutoSelect: true. The docs say the same indocs/plugin-architecture.md.tests/browser/completion-work.spec.mjs, Chromium and WebKit. The fixture's supplement publishes in an effect, as a plugin does.@Mary Janeand Space typed with no pause gives no chip, and the Space stays as text.main.cd95a6906:pnpm checkpasses.src/features/conversationandsrc/features/messagespass, 142 files and 3,860 tests. The nine browser specs for mentions, completions and the composer pass in Chromium and WebKit, 122 of 122.cd95a6906without feat(composer): one chip for several recipients, sent as @label #3837, with the plugin these hooks were built for:@Ops Sharedshows one group row, a pick gives one chip per member, and the sent message has aptag for each. 5 of 5 cases pass. That plugin publishes its own hold while its groups load, so it doesn't depend on the old rule.e4cdd8ff1: a comment, the docs and one test name, after an independent review ofcd95a6906found no code defect and one stale sentence. The comment onsupplementincontracts.tsanddocs/plugin-architecture.mdnow say that a supplement which is still loading publishesholdAutoSelect: truein its mount effect, for every query. No type changes.pnpm checkpasses andsrc/features/conversationpasses, 19 files and 190 tests.Some text below, written at earlier heads, describes the old rule ("the hold before a first answer").
cd95a6906replaces it.Updated from
mainat275173f99: a merge ofmainatcf2355f1e(#4133) and one test commit. #4133 changedacceptinComposerCompletions.tsx, which this PR also changes, so the merge had three conflicts, all in that file:accepttakes Expose confirmed owner send evidence #4133's browser event and keeps this PR's lookup of the row's own provider.withHumanMentionSelectionwraps thereplacecall for every row, a supplement's too. A supplement row that a person picks marks its recipients as the owner's mention, and a scripted pick marks none. That is whatmainalready does for every provider's row, a plugin's ordinaryregisterCompletionrow included:acceptwraps each pick and checks no provider. A supplement gets nothing more.All three callers of
acceptrun inside their key or click event. A supplement ordered above the people rows holds the first row, so Enter or Tab there gives that evidence for the supplement's recipients, as a plugin provider that owns the caret already does onmain. The merge leaves this PR's diff againstmainas it was: production is +326/−158 before and after.The test commit adds one browser case to
tests/browser/completion-work.spec.mjs, run for a people row and for a supplement row. A scripted click puts the chips in and the send is confirmed, but there is no owner mention evidence. A real click gives the evidence, with exactly the send'sp-tag recipients. With the wrap taken out ofaccept, the case fails for both rows in Chromium and WebKit and nothing else fails: #4133's own journeys pick from the member picker, not from the completion list.On a separate Linux machine at
275173f99:pnpm check(Biome, types and design checks) passes.@Ops Sharedshows one group row with its two members. A real click gives one chip per member, and the sent message has aptag for each. 5 of 5 cases pass.accept, but no browser case picks a supplement row with a key.CI passed at
275173f99. The rest of this section describes earlier heads.Checks at earlier heads
Selection fix at
644624b50: one commit. A row the user moved to with the arrow keys stays selected when a supplement is added or removed while the popup is open. Before, that change remounted the popup's rows, and the selection went back to the first row. The selection now lives above that remount, and it is dropped when the winner's query changes. Its test, "drops a supplement removed while the menu is open, with its hold", moves to the second person, removes the supplement and checks that Enter takes that person. The collision test now also accepts the winner's row. The commit removes "never opens for a supplement alone" fromComposerCompletions.test.tsx, becausecompletion.test.tsalready checks that a supplement alone gives no match. One ofmain's comments moves with the state it describes.On a separate Linux machine at
644624b50:pnpm check(Biome, types and design checks) passes.bin/node scripts/check-push.mjs(types and related tests): 72 files, 2,385 tests pass.check-push.mjs --designpasses. No Rust changed.@Ops Sharedshows one group row with its two members. Picking it gives one chip per member, and the sent message has aptag for each. 5 of 5 cases pass.CI passed at that head. The rest of this section describes earlier heads.
Registration at
ba160730f: one commit addsregisterCompletionSupplementand makesregisterCompletionrefusesupplement. Its test, "makes a supplement only through registerCompletionSupplement" (service.test.tsx), registers an owner and a supplement, checks that the refused call throws, and reads back which contribution is a supplement.On a separate Linux machine at
ba160730f:pnpm check(Biome, types and design checks) passes.src/features/conversation/andsrc/bundled/mentions/pass: 28 files, 529 tests.bin/node scripts/check-push.mjs(types and related tests): 72 files, 2,386 tests pass.check-push.mjs --designpasses. No Rust changed.The rest of this section describes earlier heads.
Lint cleanup at
702432464: two commits from a pass with the landmines lint rules, with no behavior change. They remove the prose comments this PR added (production +296/−152 became +278/−151), and they replace the two test helpers' return types withsatisfies Source, which keepssupplement: truea literal. One comment on an added line stays:main's "Only the name ellipsizes" note, which moved with its row. The test doubles stay, because they copy whatmain's tests already do in the same file for what jsdom lacks or what a test observes: thereplacespy, theResizeObserverstub and theconsole.errorspy. The lint found no sleeps, polling, retries or raised timeouts on this PR's lines.On a separate Linux machine at
702432464:bin/node scripts/check-push.mjs(types and related tests):tscpassed. 12 of the 72 related test files failed while two other branches' test runs shared the machine. All 12 then passed when rerun as a set with nothing else running (1,105 tests). This PR changes none of them.check-push.mjs --design: pass.An independent review of the two commits found no behavior or type change. The rest of this section describes earlier heads.
Size cut at
36a7ec245: one commit makes the change smaller with no behavior change. Production went from +390/−216 to +296/−152, and no test changed.matchCompletionreturns the winner and its supplements in provider precedence, so the second sort goes.main's indentation.On a separate Linux machine at that SHA:
src/features/conversation/passes (19 files, 183 tests).An independent review of the commit found no behavior change. The rest of this section describes earlier heads.
Updated from
mainat5d5400bd22: a merge ofmain(46a09dbfd), with no change to this PR's diff. CI passes at this head. The end-user test below ran on that samemainwith this PR's commits.Later commit
4ccb32df12(a test and docs), on a separate Linux machine: Biome andtsc --noEmitare clean, andsrc/features/conversation/passes: 19 files and 181 tests. #3837's runs below contain this commit too.Later commit
4f31f7798(a test only), on the same machine:ComposerCompletions.test.tsxpasses, 40 tests, and so doesvitest relatedon it. Biome andtsc --noEmitare clean. With the ArrowDown pin removed, its "keeps a row the user moved to" case fails. #3837 doesn't contain this commit yet; it adds no app code.At HEAD
3c3191c967dfa1494cdde6cdd64a3977060eb85b:New test cases: 13 in
ComposerCompletions.test.tsxand 1 incompletion.test.ts. 13 of the 14 fail with this PR's three source files reverted to the base. The fourteenth, Escape while a supplement has not answered, passes on the base, which has no supplements; it covers a path this PR adds.Mutation checks: with each guard removed in turn, its test fails. The guards are:
spaceIdandspacePending, and the hold before a first answer;agentmark;A carried result is also cleared for a provider that is no longer beside the query, such as a supplement that stopped matching mid-word. Without this, typing
@xy, then@xyz, then Backspace would paint the stale@xysection for one render before its provider publishes again. No test isolates this, because the test harness keeps one observation per mount.The three pre-push lanes ran on a separate 64-core Linux machine at this SHA:
check-push.mjs(types and related unit tests): 68 files and 2,323 tests passed, with the existing suites unchanged. Two tests failed while three lanes ran at once: a 5-second timeout inInboxPage.test.tsx, and a list count inNewMessage.test.tsx. The same two failed in a concurrent run of another branch. This PR touches neither file. Rerun alone, both files pass at this SHA and at the base: 234 tests each.check-push.mjs --designpasses. The Clippy lane has no Rust inputs to check.tsc --noEmitandbiome checkare clean.Agent reviews: the first found two defects, both fixed. The winner's rows had no heading when a supplement section came first, and the stripping of a supplement's
spaceIdandspacePendingwas dead code, since the host reads that evidence only from the winner. It also named two missing tests, now added: a winner with no rows beside a supplement with rows, and a heldspacePending. A later review found that a failed supplement kept its rows, and that its previews could close the popup; both are fixed, with tests. A fresh review of that fix found no defects.In the app: an agent ran the flow in the app's browser build (
tests/browser, headless Chromium, on the same machine), with a fixture plugin whose supplement offerscrewfor@(order -20,holdAutoSelectwhilecrewstarts with the query).@crshows a "Groups" heading withcrewabove the "Mention" heading and the matching people.@alone shows the same Groups section above all the people. ArrowDown and ArrowUp move across both sections in order.8824d8c1e, which contains this PR: a plain mention (@Grace Hopper, then Space) still gives her person chip. With a member named Crew,@crewthen Space types a space and picks no one. Control: withholdAutoSelectforced tofalse, Space inserts a chip.@cr: the supplement's section above the people@crew, Space: no one pickedEnd-user test (AGENTS.md step 3)
The PR author's agent ran the end-user test again on a separate Linux machine, with this PR at
ba160730f, #3837 at01260a91c, relaymainand the plugin these hooks were built for, which registers its@rows throughregisterCompletionSupplement?.():mainwith both PRs: with a group Bobsled Team saved,@bshows Bob Member and, under a Groups heading, Bobsled Team in one popup.@shows the 29 people and the group row. Alice typed@desand the popup showed the group Design Team (Alice, Bob and Carol; no person matchesdes). Enter made one chip. The sent message,@Design Team, has oneptag each for Bob and Carol; Alice, who sent it, isn't tagged.@lists the same 29 people as the same Buzz with no plugin.@blists only Bob, and no group rows show.The first run of this test used the flag-only form of this PR and found the problem that
registerCompletionSupplementfixes: on Buzz 1.0.5, the plugin's@rows emptied the people picker.@bonmainwith both PRs: Bob Member, then the Groups section@bon Buzz 1.0.5 with the same plugin: Bob Member only@bon Buzz 1.0.5 with no pluginTry it yourself
Run this branch (
just desktop). The test uses a small unsigned plugin, built like the ones inexamples/plugins. Make a folder with these two files:manifest.json{ "id": "example.supplement", "name": "Supplement example", "apiVersion": 1 }plugin.js@e. Working: a "Groups" heading withengsits above a "Mention" heading (the bundled provider's existingtitle) and the people rows.An agent ran the rest of the flow in the app (arrow keys across sections, Space with a namesake, a plain mention); see Validation. With no supplement registered, the existing completion tests pass unchanged.
#3837 contains this PR, so its steps also cover this one.
🤖 Generated with Claude Code