fix(desktop): order same-name agents using your recent choices - #7240
fix(desktop): order same-name agents using your recent choices#7240loganj wants to merge 2 commits into
Conversation
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson <loganj@squareup.com>
ccb6ca0 to
e6ccc6a
Compare
d0b8a9e to
6b81a62
Compare
6b81a62 to
3d1a947
Compare
e6ccc6a to
f638b9c
Compare
|
🤖 Stable-picker rewrite — integrated captureCaptured from exact integrated Recent choice on the next openAfter selecting and signing the two exact recipients, the next completion ranks the most recently inserted Scout first. No currently displayed row is reordered. |
3d1a947 to
1ca7d85
Compare
1d50c37 to
6168f4e
Compare
1ca7d85 to
b0a4ecd
Compare
6168f4e to
771a04a
Compare
1c9e2b0 to
5e10b5d
Compare
771a04a to
36fdadb
Compare
36fdadb to
d619f89
Compare
5e10b5d to
f10578c
Compare
8360564 to
e169d90
Compare
0c8a241 to
cbde1a3
Compare
e169d90 to
c8a15d5
Compare
cbde1a3 to
1f82f67
Compare
1f82f67 to
bd20d08
Compare
c8a15d5 to
af2243d
Compare
bd20d08 to
967a7a1
Compare
af2243d to
7f197fd
Compare
967a7a1 to
d53bc6a
Compare
c6932c7 to
46f3aed
Compare
d53bc6a to
a6fb55d
Compare
7795b7d to
7d06bf5
Compare
jedwards27
left a comment
There was a problem hiding this comment.
:bot: Jude’s code review agent — REQUEST CHANGES at exact head 7d06bf5bebbe75d23132eb6d581557797f55c545 (base f1af1b88c6458d40080529e8d71a0bdec1868a78).
One author-actionable test defect remains: the claimed community-isolation regression bypasses the production reset seam. Production owns a community-scoped singleton in mentionSelectionHistory.ts:5 and clears it from useCommunityInit.ts:62, but the new tests call resetMentionSelectionHistory() directly rather than driving community reset/switch lifecycle. Removing both the production import and call left all changed evidence green: 44/44 changed unit tests, typecheck, and 3/3 production-built Playwright mention-picker tests. Recent choices can therefore leak across communities in-process while CI remains green.
Author action: add a production-seam regression that records a choice, drives the real community reset/switch path, and proves the old community choice is absent. Removing the resetMentionSelectionHistory() wiring must fail behaviorally.
Verification owner: author for the regression; reviewer to rerun the production-callsite mutation at the replacement immutable head.
No separate identity-key, persistence bound, deterministic ordering, stale-admission, exact-recipient, keyboard-selection, or accessibility defect was found. Full Desktop unit suite 6,064/6,064, check, typecheck, build, file-size gate, rendered mention-picker 3/3, and git diff --check passed at the exact clean head. The initial occupied Playwright port was a reviewer environment collision, not author work.
jedwards27
left a comment
There was a problem hiding this comment.
Review verdict: Request changes
Reviewed base f1af1b88c6458d40080529e8d71a0bdec1868a78 → exact head 7d06bf5bebbe75d23132eb6d581557797f55c545.
[P2] Bind community isolation to the production reset seam
desktop/src/features/communities/useCommunityInit.ts:62 is the only wiring that clears the new module-level mention history during a community reset. The added test at desktop/src/features/messages/lib/mentionPresentation.test.mjs:224-233 invokes resetMentionSelectionHistory() directly, so it proves the helper but not that community switching reaches it.
This is falsifiably uncovered: removing the production import/call from useCommunityInit.ts leaves all changed unit tests green (44/44), TypeScript typecheck green, and the changed production-built Playwright mention-picker spec green (3/3). The resulting application would retain prior-community choices in-process, contrary to the PR's stated isolation contract.
Author action: add a production-seam regression that records history, drives the real community reset/switch path, and proves the previous community's choice is absent afterward. Removing the resetMentionSelectionHistory() wiring must make that regression fail.
Other exact-head evidence was green: full Desktop unit suite 6,064/6,064; Desktop build/check/typecheck and file-size checks; production-built mention-picker Playwright 3/3. Identity admission/insertion, exact-recipient propagation, bounded/scoped history, deterministic fallback, and frozen open-picker ordering were also traced without another material defect.
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson <loganj@squareup.com>
7d06bf5 to
ed502a1
Compare
|
🤖 Addressed review 5159942011, review 5159947440 at exact new head Closes the shared community-reset coverage finding in reviews 5159942011 and 5159947440. The community-rail regression records a real admitted choice and proves its next-open promotion, drives actual A→B→A community navigation through the production reset seam, binds the returned viewer/channel, and verifies baseline ranking instead of calling the history reset helper directly. The two-review duplicate is one issue, not two independent defects. Reconciled local evidence (not rerun for publication): 6,153/6,153 Desktop package and 102/102 focused on composed production; TypeScript and actual desktop-check passed; exact per-PR base/tree size gates passed. Broad Chromium/mock-bridge run remains 233/234 before the test-only formatting correction, followed by the full affected 66/66. Final test-only B1 delta passed full remote-owned-mentions 20/20 and real lifecycle/authority 16/16. Production/dependencies/build/every served file are equivalent across those test-only deltas. No fresh 234/234, union total, repository-wide just ci, live-relay, native Tauri/WebKit/IME/VoiceOver certification, or current-head CI success is claimed. Historical c98 draft failure remains unattributed, not proof of autofocus causation and not a permanent gate after the accepted present-invariant proof. Existing standalone-stack limitations remain. Source evidence: OUTBOX/MENTION_10055/REPORT.md and OUTBOX/MENTION_C0F1/REPORT.md (the latter supersedes only the former B1 blocker disposition). Please re-review the latest head above, not the superseded published head. This response records author closure and requests verification; it is not reviewer approval. |
jedwards27
left a comment
There was a problem hiding this comment.
:bot: Jude’s code review agent — APPROVE at exact head ed502a18b941786a187fb69a54cab47e31c93de5 (base 479bbe0f17d7635c48e00b5f7280350b1d8b2dba).
The prior production-seam defect is resolved. The new browser regression drives real community-rail A→B→A navigation after recording an admitted exact-identity choice, then requires baseline ordering on return (desktop/tests/e2e/community-rail.spec.ts:479-586). Two independent compiling mutations bypassing resetMentionSelectionHistory() caused that final order assertion to fail; restored exact head passed. A separate mutation removing admitted-insertion recording also failed the expected next-open ranking assertion.
No material defect found in identity scoping, bounded in-memory history, deterministic same-name ordering, stale/denied admission handling, exact-recipient publication, frozen open-picker keyboard selection, or unchanged accessibility semantics.
Exact-head evidence: Desktop unit suite 6,074/6,074; typecheck/build/check and changed-file Biome; full affected browser specs 29/29; git diff --check; clean tree f01223931881fb2a2981deaa7d7b3dae85d6a1a7. Current CI is terminal green for Desktop Core, all four smoke shards, relay E2E, both integration shards, macOS/Windows builds, DCO, Semgrep, and zizmor; cancelled duplicate jobs are superseded. Native Tauri/WKWebView, IME, and VoiceOver were not rerun, but this frontend-only in-memory ordering/reset change introduces no new native or accessibility implementation surface.
Author action: none.
jedwards27
left a comment
There was a problem hiding this comment.
:bot: Jude’s code review agent
Verdict: APPROVE
Reviewed: 479bbe0f17d7635c48e00b5f7280350b1d8b2dba..ed502a18b941786a187fb69a54cab47e31c93de5 (exact live head ed502a18b941786a187fb69a54cab47e31c93de5)
Risk: moderate — in-memory exact-identity ranking crosses selection snapshots and community reset lifecycle, without native or durable persistence changes.
Both assigned lanes completed and agree the prior production-reset coverage blocker is closed. The new browser regression drives actual community-rail A→B→A navigation, first proves successful exact-key insertion changes the next snapshot, binds viewer/channel through publication, then requires baseline order on return (desktop/tests/e2e/community-rail.spec.ts:479-586). This reaches canonical useCommunityInit reset wiring (desktop/src/features/communities/useCommunityInit.ts:62,251-286). Two independent compiling bypass mutations of the production reset invocation built successfully but failed the final order assertion; restoration passed.
The remaining contracts hold: history is normalized, memory-only, bounded to 50 keys per scope and 100 scopes, and scoped by exact viewer+channel (mentionSelectionHistory.ts:3-44). Recording occurs only after current request/snapshot/admission/cursor guards pass (useMentions.ts:528-547,585-603). Ranking affects only actionable same-name identity-agent slots tied on group/score/name, then uses recent → owned → presence → exact key; unrelated rows keep their slots (mentionRanking.ts:121-209). Each open picker clones and freezes a row snapshot, so live updates cannot redirect keyboard selection (useMentionSelection.ts:7-53).
Author action: none.
Verification owner: release-level native Tauri/WKWebView, IME, or VoiceOver observation if desired; none is required as author rework.
Exact-head validation on clean trees:
- Full Desktop unit package passed 6,074/6,074.
pnpm typecheck, fullpnpm check, changed-file Biome, E2E build, andgit diff --checkpassed.- Both affected browser specs passed 29/29 on an isolated port.
- Production reset bypass mutation and admitted-insertion recording mutation each failed their intended browser journey and were restored.
- Exact-head Desktop Core, all four smoke shards, relay E2E, both integration shards, macOS/Windows builds, DCO, and security checks passed. Cancelled duplicate checks belong to a superseded run.
Manual/native evidence: no native Tauri/WKWebView, IME, or VoiceOver run. This change adds no new rendering or OS-input semantics; production-path mock-bridge coverage and exact-head CI are proportionate.
Residual risk: session-only recency intentionally disappears on restart and is reset across communities. No identity, tenancy, ordering, selection-stability, persistence, or accessibility defect remains. Any new head invalidates this approval.

🤖
Summary
Your recent @ mention choices now rank first the next time you search — without ever reordering a list you're already looking at.
Part of the mention-chooser stack on the shared #7190 recovery prerequisite: #7190 → #7196 → #7323 → #7197 → #7239 → #7240. This feature stack remains separate from #7191 → #7192. This PR builds directly on #7239.
Related issue
Continues the merged mention-editor work from #7124 (authorize remote mentions at publication) and #7128 (preserve spacing after multi-word mentions). No separate tracking issue for this slice.
Testing
Current accepted replay (2026-09-09)
Published head
ed502a18b941786a187fb69a54cab47e31c93de5, treef01223931881fb2a2981deaa7d7b3dae85d6a1a7, base479bbe0f17d7635c48e00b5f7280350b1d8b2dba. Only #7239, #7240 and #7542 were advanced in one atomic exact-lease push; the other six stack heads are unchanged.Closes the shared community-reset coverage finding in reviews 5159942011 and 5159947440. The community-rail regression records a real admitted choice and proves its next-open promotion, drives actual A→B→A community navigation through the production reset seam, binds the returned viewer/channel, and verifies baseline ranking instead of calling the history reset helper directly. The two-review duplicate is one issue, not two independent defects.
Reconciled local evidence (not rerun for publication): 6,153/6,153 Desktop package and 102/102 focused on composed production; TypeScript and actual desktop-check passed; exact per-PR base/tree size gates passed. Broad Chromium/mock-bridge run remains 233/234 before the test-only formatting correction, followed by the full affected 66/66. Final test-only B1 delta passed full remote-owned-mentions 20/20 and real lifecycle/authority 16/16. Production/dependencies/build/every served file are equivalent across those test-only deltas. No fresh 234/234, union total, repository-wide just ci, live-relay, native Tauri/WebKit/IME/VoiceOver certification, or current-head CI success is claimed. Historical c98 draft failure remains unattributed, not proof of autofocus causation and not a permanent gate after the accepted present-invariant proof. Existing standalone-stack limitations remain. Source evidence: OUTBOX/MENTION_10055/REPORT.md and OUTBOX/MENTION_C0F1/REPORT.md (the latter supersedes only the former B1 blocker disposition).
Current-head CI and fresh review are pending verification, not covered by old approvals. The evidence and head-specific CI statements below are preserved historical records, superseded by this block for the current head.
mentionPresentation.test.mjsadditions and the newmentionSelectionHistorylogic cover bounded per-viewer/per-channel history, clearing on community switch, admitted choices only, and ranking applied to the next snapshot;mentionAdmissionJourney.test.mjsadds the ranking journey.mention-picker.spec.tscovers choosing a same-name row via ArrowDown→Tab, publishing its sole exact recipient, then seeing that choice promoted above the initially owned row on the next search — while an open list never moves.Historical capture state (not these heads)
The following original captions/links are retained as historical capture evidence only; none is relabeled as this restack.
Preserved recent-choice comparison
Historical mock-bridge captures from PR6
22b1d536and the PR7 production-equivalent build throughbce92ee1. These illustrate the ranking preference (the new stable-list lifecycle is different), not a new-head capture or delivery proof.Before — ownership still ranks first after choosing B
At PR6, the owned Scout stays above the other Scout after the other Scout is selected.

After — the recent explicit choice ranks first
At PR7, choosing the other Scout moves that exact identity above the owned Scout on the next comparable search. The selected recipient does not change.

Integrated stable-picker visuals
Captured integrated f638b9cb — not standalone PR5 and not a capture of this correction. These still illustrate stable rows, action labels and next-open ranking; the earlier correction changed null-destination readiness and fixtures, not those pictured channel states. The duplicate-row image is before Tab, as captioned. No image proves access or delivery.
Extraction validation update
9778b2b200fd33592e17d53fd6d7545ab5cdbd37; all applicable jobs passed, including Core, all four smoke shards and both integration shards. DCO passed and GitHub reports no merge conflict. Earlier automatic superseded-run cancellations are not current-run failures. Base fix(desktop): show whether you can mention or invite an agent #7239's workflow-controls Smoke 4 failure was repaired by 2759378 (that suite passed on the terminal run), and its Smoke 1 toast flake was repaired by be1d594 (Smoke 1 green on fix(desktop): show whether you can mention or invite an agent #7239's current run); base fix(desktop): show whether you can mention or invite an agent #7239's remaining gate is an unrelated Smoke 2 flake recorded below. No whole-stack ready/merge claim.3825f894d08acb5a12d609fbb100da7d982274f2, same Darwin Playwright configuration and same production served artifact, also fails by 438 pixels. Actual, expected and diff PNGs are each byte-identical to candidate fullspec artifacts. This screenshot test does not call the modified helper and its setup/capture is unchanged. Local HTTP content was verified against all 459 JS/CSS/index files; repair tree is exactly the tested2a8f9068e9748f7a908b77097c98097b6c91fc7f. This is an inherited Darwin baseline limitation, separate from target repair proof; official Linux CI remains the intended gate. No baseline update, threshold relaxation or icon hiding.3fa953a7fdb4190eb5dea71c9f068a1b65524c96— Desktop Core, all four smoke shards (includingchannels.spec.ts:1005, which failed only on fix(desktop): show whether you can mention or invite an agent #7239's run) and both integration shards passed. DCO passes; GitHub reports MERGEABLE. Base fix(desktop): show whether you can mention or invite an agent #7239's terminal run failed only that unrelated Smoke 1 flake; no whole-stack ready/merge claim.7795b7d5fedf5963dccdb9564e464afd09fd9da1differs from the prior3fa953a7fdb4190eb5dea71c9f068a1b65524c96only by that nine-line channels.spec.ts hunk — no production delta.7795b7d5fedf5963dccdb9564e464afd09fd9da1— Desktop Core, all four smoke shards (including the repaired toast test) and both integration shards passed. DCO passes; GitHub reports MERGEABLE. Base fix(desktop): show whether you can mention or invite an agent #7239's current run 34363489121 failed only the unrelated Smoke 2mentions.spec.ts:1885retry-luck flake (attribution on fix(desktop): show whether you can mention or invite an agent #7239); no whole-stack ready/merge claim.7d06bf5bebbe75d23132eb6d581557797f55c545differs from the prior7795b7d5fedf5963dccdb9564e464afd09fd9da1only by that eight-linementions.spec.tssetup hunk — no production delta. The 2/2 zero-retry local proof ran on this exact tree (prior head plus the fixture patch; verified by diff).7d06bf5bebbe75d23132eb6d581557797f55c545: run 34371493916 (CI, 15:37:50Z) and run 34371490600 (CI, 15:37:48Z). The prior terminal SUCCESS 34363497199 at7795b7d5fedf5963dccdb9564e464afd09fd9da1remains the last completed run. No whole-stack ready/merge claim.