fix(desktop): keep the @ mention list steady and pick the row you see - #7197
fix(desktop): keep the @ mention list steady and pick the row you see#7197loganj wants to merge 3 commits into
Conversation
3916b7d to
d287d89
Compare
e27e770 to
eec6f58
Compare
d287d89 to
a09ca69
Compare
eec6f58 to
8478cfa
Compare
a09ca69 to
1a8a942
Compare
8478cfa to
3d9452a
Compare
|
🤖 Stable-picker rewrite — integrated captureCaptured from exact integrated Fresh Create/Add, then first completionThe newly added Fresh Scout appears in the next opened list. Displayed same-name identities before TabThis capture is BEFORE Tab (despite the filename). The browser then changes presence data, asserts unchanged identities/order, presses Tab and checks the displayed first identity is inserted. Two exact identities after Tab and clickThe first selected Scout keeps its short label; selecting the other reserves the full-key qualified label. The test subsequently checks the exact two signed recipient tags. |
1a8a942 to
86ba5b3
Compare
30795ba to
6372d0e
Compare
6372d0e to
f8bbe95
Compare
6b78dec to
fb593a7
Compare
fa638cb to
4c9aaa8
Compare
15c89f8 to
b1db170
Compare
b354256 to
b326af3
Compare
b1db170 to
ed5a2f4
Compare
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>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson <loganj@squareup.com>
ed5a2f4 to
75f61d7
Compare
b326af3 to
0464384
Compare
jedwards27
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Reviewed: 75f61d7d473829fe11795f96870e20ca8da87d99..0464384b676b7457f51876484e9beac998b690d5 (exact head 0464384b676b7457f51876484e9beac998b690d5)
Risk: high — this changes visible mention selection and the exact recipient identity carried into message publication.
Behavior/contracts traced: :bot: Jude’s code review agent traced request/scope fencing, frozen displayed rows, keyboard/pointer commit behavior, exact pubkey/team-recipient revalidation, current membership/agent authorization at send time, both production composer callers, collision-row disambiguation/accessibility names, and stale/closed request handling.
Findings: no blocking or author-actionable defect found.
- The rendered rows and keyboard index remain stable for the request, while commit revalidates the exact selected identity rather than rebinding a same-name row (
desktop/src/features/messages/lib/useMentionSelection.ts:7-55,useMentions.ts:431-499,725-797). - Pointer selection commits the exact rendered suggestion, and same-name rows expose visible npub disambiguation plus distinct full-key accessible names (
desktop/src/features/messages/components/MentionAutocomplete.tsx:327-390,416-475). - Closed, superseded, caret-moved, and scope-changed requests are fenced from installing or committing stale results (
desktop/src/features/messages/lib/useMentionQuery.ts:14-109). - Publication preserves selected exact keys and still performs fresh agent authorization/current roster handling (
desktop/src/features/messages/lib/useMentions.ts:664-692,useMentionSendFlow.ts:747-890). Scoped caller review found the two production consumers supplying live document/caret state (MessageComposer.tsx:153-158,299-304;ForumComposer.tsx:77-82,131-136).
Author action: none.
Verification owner: none for merge. Optional native macOS/VoiceOver observation and mutation-running the Playwright regression remain reviewer/tooling follow-up, not author defects.
Exact-head validation:
just desktop-test: 6,037 passed, 0 failed.- Desktop typecheck and lint passed with unchanged HEAD and clean tree.
pnpm build:e2epassed.- Isolated-port Playwright
tests/e2e/mention-picker.spec.ts --project=smoke: 2/2 passed, including stable same-name rows/exact publishedptag and rejection after Escape/delayed result/navigation. git diff --checkand the repository policy preflight passed.- Exact-head GitHub checks are successful for Desktop Core, smoke shards 1–4, Desktop relay E2E, integration shards 1–2 and aggregate, macOS/Windows builds, DCO, Semgrep, and zizmor; merge state is
CLEAN.
Manual/native evidence: browser E2E exercised the changed interaction and publication boundary. Native Desktop/VoiceOver was not run.
Residual risk: browser E2E does not independently prove OS-delivered keyboard behavior or screen-reader announcements. Existing autocomplete semantics lack combobox/listbox/active-descendant semantics, but comparison to the supplied base indicates that is pre-existing rather than introduced by this PR. The new Playwright regression was not mutation-run; its causal strength was assessed from assertions and source tracing.
jedwards27
left a comment
There was a problem hiding this comment.
:bot: Jude’s code review agent
Both assigned review lanes clear exact head 0464384b676b7457f51876484e9beac998b690d5.
The picker now keeps displayed rows and keyboard selection stable for each request, commits the exact rendered identity for keyboard and pointer selection, and rejects stale/superseded query results. The systems lane also confirmed that current candidate evidence is rechecked before insertion and that send-time authorization still revalidates exact recipients against the destination channel.
Validation: full Desktop package 6,037/6,037; typecheck and lint; isolated mention-picker Playwright 2/2; clean git diff --check. The live head remained unchanged immediately before this review. Its latest exact-head check suite has 17 successful and 10 skipped checks; an older duplicate run is cancelled.
Residual risk: native Desktop/VoiceOver behavior was not observed locally. This is a reviewer/tooling confidence gap, not an author-actionable defect.
|
Superseded by consolidated #7191 (new head The stable-choice contract this PR introduced — suggestions installed once per request with live availability overlays, and selection preserved by stable identity across background reorder (the P2 wrong-recipient defect from review 5168528058) — is implemented inside #7191's landing unit ( Closing as superseded is not a claim that this branch's old head defect was fixed on its own branch or that its CI is cleared. The branch |



🤖
Summary
Stops the @ mention suggestion list from moving under you, and makes Tab, Enter, and click commit exactly the row you see.
Scope: display stability only. Permission is still checked live when you choose (#7196) and revalidated at publication; the native editor fixes (highlighting, Enter, caret) are #7323, and the recipient persistence evidence is #7190. The obsolete mention debounce helper that used to paper over the Tab/Enter race is deleted here, together with its test suite.
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 #7323.
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
composerAgentKeyboard.test.mjs,useAgentAddressLockPicker.test.mjs, andmentionAdmissionJourney.test.mjscover the request lifecycle, stable installation, selection, and closure.mention-picker.spec.ts,mentions.spec.ts,remote-owned-mentions.spec.ts,team-mentions.spec.ts, andpersistent-agent-audience.spec.tscover stable rows under background changes, Tab/Enter/click committing the displayed identity (including same-name rows), caret-departure dismissal, and no waiting on a missing destination.docs/mention-editor.mddocuments the stable-completion contract.Historical capture state (not these heads)
The following original captions/links are retained as historical capture evidence only; none is relabeled as this restack.
Historical visuals — not this rewrite
These immutable captures illustrate the superseded contract (Tab used to refuse ambiguous rows). They are retained for provenance, not evidence of current Tab behavior. Earlier integrated captures are linked below; they do not replace these historical captions.
Historical capture (superseded policy): Tab chooses Scout without an exact choice
At parent revision
6c373187, the example has two recipients named Scout. Tab closes the list and turns the text into a mention for one recipient.Historical capture (superseded policy): Tab keeps the draft and both choices
At revision
e27e770e, Tab leaves@Scoutas text and keeps both recipients available.Historical capture (superseded policy): choosing both recipients keeps them separate
Click the second Scout. Type
and @Scout, choose the first Scout, then typehello. The two labels stay separate. One label includes a recipient identifier. The browser test checks that the signed message contains only the two chosen recipient identifiers, in choice order. It does not prove server acceptance or permission to respond.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