Repository navigation
feat(composer): one chip for several recipients, sent as @label - #3837
LordMelkor wants to merge 45 commits into
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>
A `mentions` completion edit may carry a `label`. The composer inserts one `@label` chip over the query. It notifies each person in `mentions` once and is sent as the plain text `@label`, with one `p` tag per person. A blank or non-string label drops the row before it is shown. - In code, and in a message edit, only the text `@label` goes in, since edits add no recipients. - Removing or replacing recipients keeps the members still wanted; with none left the chip is plain text. A letter typed onto the label turns it into text, as for a person's chip, and marks such as a link keep it. - Saved drafts keep each member on the label's span, checked against the exact text `@label` and a mention boundary when restored. - The chip shows the recipient count beside the label and their names in its accessible name. - The 32-recipient cap counts distinct people, and a send names each person once. A chip's members count as namesakes, so a mention that shares a name with one of them is sent qualified. - A Solo chat's title drops a leading chip whole, as it drops a leading person tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
In a paragraph with formatting, a group chip's @Label was not masked as a recipient span: italic wrapped it in _..._ and a * in the label was backslash-escaped on send. Treat a group chip like a recipient chip when serializing, and exclude it from semantic tokens when reading a snapshot. 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 design or core-team maintainer needs to review this PR: it's a composer UI change from a contributor outside the core maintainer group, and it touches the plugin completion contract (contracts.ts, a FOUNDATION file).
I reviewed the two composer commits (4e108350d, fe32d1096). The current head only adds a clean merge of main through the base branch.
No blocking issues. I checked that the p tags match the chips left in the final document after all of these:
- undo/redo
removeRecipientandreplaceRecipients- draft save and restore
- code spans and typed backticks around the chip
- typing next to the chip
People who appear in more than one chip are sent once. Editing a sent message only inserts plain text, and the label renders as React text.
Inline:
- P2: a plugin-supplied
labelis sent without escaping. A label with](url), a blank line plus a heading, or a backtick changes how the message renders. I'd limit labels to one line, cap their length, and reject Markdown and control characters. - P3: Solo auto-naming skips a chat that starts with a group chip.
- P3: the chip is announced as "Person …", and its label can list up to 32 names.
Missing tests: the DM-send dedupe, the group chip's rendering and accessible name, undo/redo on a group chip, restoring a draft whose label has changed, and labels with newlines or Markdown in them.
A group chip's label came from a plugin and was sent unescaped, so a label such as `x](https://example.com)[y`, `*ops*`, a backtick or a blank line plus a heading changed how the sent message rendered. The sent label now escapes the characters that can open inline Markdown, so it renders as the label the chip shows; inside code it stays as is. Group labels also follow the rule token chips already had: at most 256 characters, with no control or bidirectional override characters. A completion row with another label is dropped, and a restored chip with one is prose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
…lo titles A group chip was announced as "Person crew, 2 recipients: ...". It now says "Group crew, ...", through an optional kind name on InlineChip. A Solo chat that started with a group chip was never named automatically: its starting title dropped `@crew`, but Solo naming rereads the sent text, where `@crew` names no tagged person, and so kept it. The starting title now keeps a leading group label too, and a label that starts with a member's name is no longer cut at that name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
Picking a group while editing a sent message inserted `@label` as typed Markdown, so a label such as `*ops*` changed how the edited message rendered. An edit now inserts the label escaped, the same way a chip sends it. Inside code it still goes in as is. A chip inside a link was escaped twice, once by the chip and again by the link's own text escaping; the link now escapes it once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
|
🤖 Update, Nov 21: the label section below (P2, its tests and its known limits) is replaced at 🤖 Thanks for the review. Here is what changed, in three commits up to P2: a plugin-supplied label changed the sent Markdown. Fixed, by both of your options together.
P3: Solo auto-naming. Fixed. The starting title now keeps a leading group label, so it matches how Solo naming rereads the sent text. Your repro now holds: the draft P3: the accessible name. Fixed. The chip is announced as "Group crew, 2 recipients: …", through an optional kind name on Known limits:
Missing tests you listed:
Checks at |
joahg
left a comment
There was a problem hiding this comment.
🤖 This is a comment, not an approval. This composer UI change comes from a contributor outside the core maintainer group, so a design or core-team maintainer still needs to review it.
Follow-up on 60e2cb46a..4c1a5a13c. All three points from my last review are fixed:
- Label Markdown (P2):
groupLabelMarkdownescapes\ ` * _ [ ] < ~before sending. Inside code and links it leaves the label alone, since the mark handles escaping there. An escaped label is then protected from being escaped twice. The edit path inserts the same escaped text.chipLabelapplies the token-chip rule (at most 256 characters, no control or bidi-override characters) in bothcompletionResultand on restore. The round-trip tests parse the sent Markdown back to plain label text. - Solo auto-naming (P3): a leading group label is kept in the starting title.
- Accessible name (P3): the chip is announced as "Group …".
Keeping Markdown characters allowed (for example SRE (on-call)) and relying on escaping is a reasonable call. The remaining limits are written up: ||, entities, bare URLs and :name: can still render, and there are no undo/redo or stale-label restore tests. A maintainer should decide whether any of those need to block.
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>
Fold insertGroup into insertMentions with an optional label, keeping the group's error wording. Render the group chip with InlineChip directly. Use one CompletionEdit mentions variant with an optional label. Use the literal 32 recipient limit, as the rest of the composer does. Let distinctRecipients return the distinct people, and tighten composerGroup, tokenRecipients, replaceRecipients and the Markdown group projection. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: LordMelkor <kray@squareup.com>
* commit '36a7ec245dac7be88eda18aa538cab6c4f2998ce': refactor(completions): shrink the supplement change
Restoring a saved chip rebuilt its members with groupMembers, a second copy of what tokenRecipients already derives from the draft's labelled recipients on the token's range. Use tokenRecipients behind the same snapshot gate and drop groupMembers. The editor writes one labelled recipient per chip member, in member order, beside the snapshot, and mentionDraft only removes entries, so the restored chip is unchanged. 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>
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 draft with no labelled recipient has no group chip on either path, so loading it returns mentionDraft's result without building a document. 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 saved draft now loads as typed, so the box shows the group chip the person picked. The send checks each group label against the people it tags: the send's recipients in a Solo chat with agents only, the draft's tagged people elsewhere. A group whose label no longer holds is sent as one chip per member, each keeping its explicit pick. If the message sent that way would be longer than 16000 characters, the send is refused before anything is submitted, the draft stays as typed, and the error names the group: "@Label could not be tagged: the message would be too long." 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>
In a one-to-one DM whose other member is an agent, every send tags that agent. The group label check at the pick and at send now counts that agent, under the name its profile gives, so in a DM with "Ops" the group "Ops crew" goes in, and is sent, as its members. The new-message test of a saved group no longer retries the send; the delivery test already covers Retry. 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>
|
🤖 Reply to the review of 1. First names on mobile. 2. Restored chips. The label is checked again at send, not at restore, because the people a message tags are only known then: someone can be added after the group. Where the send takes its draft, a group whose label no longer holds goes out as one mention per member, with one The people checked are the ones the composer knows the message tags: the mentions in the draft, the toolbar's agents in a Solo chat, and the agent on the other side of a 1:1 DM. Tests. Selection to wire and restore to send, each with exact content and exact What this leaves
Still with the reviewer's side, as the review says: the native desktop and phone send/receive try, and the yes on the one FOUNDATION edit ( Checks on Mobile bubble run: scratch widget test and its output (12 rows)import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:buzz/features/channels/message_content.dart';
import 'package:buzz/features/channels/message_mention_pill.dart';
import 'package:buzz/shared/mentions/mention_bindings.dart';
import 'helpers/widget_helpers.dart';
void main() {
final a = 'a' * 64, b = 'b' * 64, c = 'c' * 64, d = 'd' * 64;
final mw = {a: 'Mary Jane', b: 'Wes'};
final rows = <(String, Map<String, String>, String)>[
for (final l in [
'Mary crew', 'mary crew', 'MARY CREW', 'Mary-crew', 'Mary Jane crew',
'Wes', 'Marys crew', 'Crew Mary', 'Wesley team', 'Launch crew',
])
(l, mw, 'BINDS'),
('ÉMILE crew', {c: 'Émile Durand'}, 'BINDS'),
('ſam crew', {d: 'Sam Lee'}, 'BINDS'),
];
String vis(String s) => s.replaceAll('\uFFFC', '<PILL>');
for (final (label, names, _) in rows) {
testWidgets('row $label', (tester) async {
final content = '@$label ';
final taps = <String>[];
await tester.pumpWidget(
WidgetHelpers.testable(
child: MessageContent(
key: UniqueKey(),
content: content,
bubble: true,
mentionNames: names,
tags: [for (final k in names.keys) ['p', k]],
onMentionTap: taps.add,
),
),
);
await tester.pumpAndSettle();
final pills = find.byType(MessageMentionPill);
final n = pills.evaluate().length;
final rich = tester
.widgetList<RichText>(find.byType(RichText))
.map((r) => r.text.toPlainText())
.where((t) => t.contains('\uFFFC') || t.contains('@') || t.contains(label.split(' ').first))
.toList();
final out = StringBuffer('ROW [$label] people=${names.values.toList()}');
out.write(' pills=$n');
for (var i = 0; i < n; i++) {
final w = tester.widget<MessageMentionPill>(pills.at(i));
taps.clear();
await tester.tap(pills.at(i), warnIfMissed: false);
await tester.pump();
final who = taps.isEmpty
? 'NOT-TAPPABLE'
: 'tappable->${names[taps.last] ?? taps.last}';
out.write(' | pill#$i label="${w.label}" pubkeyProp=${w.pubkey == null ? 'null' : names[w.pubkey]} $who');
}
out.write(' | rendered=${rich.map(vis).toList()}');
// Binder (preview) result
final signed = names.keys;
final bind = renderedMentionBindings(content, names, signed);
final occ = mentionOccurrences(content, bind.keys);
out.write(' | binder=${occ.map((o) => '[${o.start},${o.end}) ${bind[foldMentionLabel(o.label)]?.map((k) => names[k]).toList()}').toList()}');
// ignore: avoid_print
print(out);
});
}
} |
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent
Client wire interpretation remains one plain @label with multiple p tags; verify rendering and notification behavior on both clients.
Verdict: COMMENT — recommend request changes for the concrete P2 below. This is not an approval.
Reviewed: 1e64fd543e92c34499dd1b94a4e5426f33bd822e..b13c7598e6eebb842dfc2aaa7d92a20b78d206d2 (clean checkout).
Risk: high — message recipients are preserved, but the same wire text can display as the wrong person mention.
P2 — group-label guard does not account for verified names the desktop reader binds. src/features/messages/composer-document.ts:313–330 checks only each selected person.name (and its first word), and passes an explicit one-name mentionLabels list to the desktop binder. The received-message path instead uses profile display/full verified aliases when no wire label list exists (src/features/messages/profile-mentions.ts:12–17,47–52; test at profile-mentions.test.ts:129–146). If a recipient shown as MJ has verified full name Mary Jane Jones, the label Mary Jane Jones crew survives both pick and send checks. The sent @Mary Jane Jones crew still tags that recipient, and an unedited desktop receiver can link @Mary Jane Jones as a person rather than showing one literal group label. That contradicts this PR’s stated one-chip/one-label safety contract, even though the limitation is disclosed.
Author action: include the verified display/full names and applicable mobile first-word aliases in both pick-time and send-time checks; if those aliases are unavailable, safely fall back to individual mentions. Add a selection→wire→received-render regression asserting body and exact p recipients. Verification owner: author for that fix and regression; reviewer/tooling for an independent desktop/mobile send/receive and notification journey. The separate FOUNDATION-file guidance remains a human-maintainer gate, not the reason for this recommendation.
Resolved since the prior review: case-folded/first-name mobile collisions and stale/restored unsafe group labels now fall back to per-person names at send while retaining recipient tags. The chip has a kind-neutral accessible name. The editor can still display a group chip while send-time fallback expands the sent text; check that sender experience in the native journey, not as a separate code blocker here.
Validation at the reviewed SHA: local pnpm check passed in an independent clean checkout; mention-draft.test.ts + NewMessage.test.tsx passed 95/95, focused MessageComposer passed 17/17, and targeted bypass mutations failed as expected (4/4 send-normalization, 2/2 DM-agent inputs, 6/9 alias-guard tests). A separate clean checkout passed the focused over-length regression (2 tests); git diff --check passed. Hosted checks: 73 success, one Windows-native skip. Manual/native evidence: none independently gathered at this head. Residual risk: no independent full-package or native desktop/mobile notification proof; those are verification gaps, not additional author rework. A new head requires a new review.
A reader links a mention by the person's shown name and both verified names. The mobile app also links a verified person by the name their own profile gives. The group label check at the pick and at send now counts all of these, so for a member shown as "MJ" whose verified full name is "Mary Jane Jones", the group "Mary Jane Jones crew" goes in, and is sent, as its members. 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>
|
🤖 Reply to the second review (jedwards27, at P2, verified names: fixed. The label check read only the name the sender sees. It now reads every name the sender's app holds for each person the message tags, at the pick and at send, through one helper in This is the second finding of one kind (a name a reader links that the sender did not check), so here is each name source the two readers use and what the check does with it:
The first-word rule now runs on the verified names too. No reader links a verified name by its first word, so this is stricter than it must be: a few more labels go out as names. It keeps "If those aliases are unavailable, fall back": not made strict, and why. The queries the composer has cannot tell a person with no verified name from one whose record is not loaded: The test you asked for is one Checks at Not checked: a real phone. The self-set row holds the sent body and tags, not mobile's own rendering. Size over |
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>
Three rules the group chip uses now live in functions of plain values. The components gather the inputs and act on the result. - `readerNames` returns every name a reader may link for each person: the shown name, both verified names and the name the person's own profile gives, plus a one-to-one DM's agent partner. The composer passes in the session's profiles, profile events and DM members. - `groupKeeping` returns a group without the members a change removes, or null when none are left. Removing a recipient and replacing the recipients both call it. - The group chip in the box reads its group through `tokenRecipients`, as the editor does. - A send takes its draft before it holds the send lock, so an error while taking the draft can no longer leave the lock held. The label, reader-name and keeping cases are now tables over these functions. The composer tests keep one case for each way the inputs reach them. 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>
- The group label check also reads the name mobile shows for a person: the raw `display_name` of their own profile, else its raw `name`. Mobile links that name and its first word as they are, so a display name this app drops (a control or bidi character) no longer lets a label through that mobile shows as one person. - A saved draft keeps a group's members only when a chip can hold its label. Any other label comes back as plain text with no recipients, so it is no longer sent with every member tagged and no label check. - The send lock is set right before the send's `try`, so nothing that runs before it can leave the lock held. - A new message counts its recipients with `distinctRecipients`. Tests: a `tokenRecipients` table; label rows for a name with a tab in it and for a combining mark after a name; the raw-name row; the saved draft that is sent as text; and the saved group in a one-to-one DM with an agent, the case that reaches the send's label check. 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>
readerNames also gives the raw kind 0 name that mobile binds: the display_name when it is a string, else the name. Only the first half had a row. This row gives an own profile whose only name has a bidi control, which this app's profile reader refuses, and expects the raw name back. 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>
- The group label check also tests each name after the widest trim a reader applies, whole and by its first word. That trim is Dart's `String.trim`: JavaScript's whitespace plus U+0085. A phone surface trims the raw name before it links it, so a name such as " Ann\tLee" or "Ann\u0085" no longer lets the label "Ann team" through. - `readerNames` keeps the key prefix shown for someone whose own profile sets no usable name. A reader that has that profile and no verified name shows the prefix and links it, so a label that starts with it no longer holds. Tests: label rows for a name with a leading space and for one that ends in U+0085; the reader-name rows for a profile with no name and for one whose only name is refused now expect the key prefix; one check that a label starting with the key prefix doesn't hold. 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>
- The two label rows added for the trim get labels of their own, so a failing row names itself. - " Ann\tLee" becomes " Ann Lee". The row now needs only the trimmed name's first word; the "Ann\tLee" row keeps the split on any space. - A row for the name as written: " ann pals" with the name " Ann". The phone matches the name as written, in any case; this app's reader matches case, so the row turns on that clause alone. - The test that chained `readerNames` into `groupLabelHolds` goes. The "the fallback name" row guards the same thing. Tests: each label row fails on its own control (the name as written left out, the trimmed name left out, JavaScript's trim, the trimmed name's first word left out, a split on spaces only). 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>
"C++" is an ordinary name. The row checks that `groupLabelHolds` escapes a name before it builds a pattern from it: without the escape, building the pattern throws. Tests: the row passes with the escape and is the only failure without it (1 of 107). 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
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent
Client contract: one literal @label in the message body with one p tag per recipient; check desktop send/receive and mobile rendering/notification, including verified-name collisions, against the same isolated relay.
Verdict: COMMENT — recommend request changes. Reviewed 38c627a7b2e41cebd41309fc1ee4809bb9af7ab1..3539c27397b2d7fa75ddd563516e6338ec8f9f78 (clean exact head). High risk: notification intent and cross-client presentation. The original verified-alias omission is addressed for names loaded at pick/send, and the group chip retains a member-aware accessible name and per-recipient removal. One reproducible presentation defect remains:
- P2 — alias can change during asynchronous send admission.
MessageComposer.tsx:3191–94validates a group against the current profile snapshot, then awaits membership/agent preparation. At lines 3403–22, the revision check covers draft state, not profiles, and serializes the already-captured group. In a mounted-composer regression probe at this head, membership refresh was held, a tagged member acquired verified display nameMary, then admission resumed: the actual send still published@Mary crew hi. Desktop's signed-name parser then binds@Maryto that person; mobile can bind first-name aliases too. The group is no longer seen as its whole label, contrary todocs/plugin-architecture.md:3491–98. This is a misleading person link, not evidence of lostptags. Author action: revalidate the label after awaits, immediately before publication; split to individual mentions or refuse with the authored draft intact when it no longer holds, with a deterministic deferred-admission/verified-alias regression. - Regression coverage for the original verified-alias fix: the final head retains
readerNameshelper coverage but removed the previous mounted-composer picked/saved-draft tests frome092a1062that checked wire text, exact recipients, and receiverprofileMentionParts. The current composer case atMessageComposer.test.tsx:18808–32covers a self-set name instead. Author action: restore one production-path verified-alias pick and restored-draft send regression asserting fallback body, exactpset, and received rendering; this can be part of the race fix's tests.
Validation: exact-head git diff --check passed; isolated Blox affected full Vitest files (MessageComposer, composer-document, mention-draft, relay mentions) passed 877/877 tests in 109.93s on a restored clean tree. The temporary causal regression deliberately failed its behavioral assertion (1 failure, 724 filtered) when the profile changed during deferred membership. An attempted 1,133-file full Vitest run was stopped after ~4 minutes (exit 130), not a local package pass. Hosted exact-head checks: 73 success, Windows native validation skipped. No native desktop/mobile journey or real relay notification delivery was exercised. Local worktree bootstrap could not complete because lefthook 2.1.14 was below the required 2.2.2. Send-gate and relay-window implementations are identical to the merged base; their presence in the old-head delta is not charged to this PR.
Verification owner: author for the code and production-path regressions above; reviewer/tooling for desktop/iOS send/receive, verified-alias display, unique notification eligibility and recipient tags on the same isolated relay. FOUNDATION-file authorization is a separate maintainer gate. Residual risk: receiver-only names that the sender has not loaded and native/mobile behavior remain unverified. No approval is carried from the earlier reviewed heads.
Recommendation: request changes.
The composer's send tests for a group whose label starts with a member's verified name went away when that table moved to readerNames. Two rows come back, picked and saved in a draft. Each checks the sent text, the exact p set and how a receiver who knows the member by the verified name draws the mentions. With verified names left out of the names the composer binds labels against, when a group is picked and when it is sent, no other test in the 69 test files related to the composer fails (2273 tests), so these rows own that wiring. 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>
The send binds each group label to the members' names when it takes the draft, then waits: a Solo chat's members, the old-agent prompt, bringing agents in, adding people, link sharing, and in a detached window the upload. A member who took a name during a wait that the label starts with, such as the verified name "Mary" under the label "Mary crew", still had "@Mary crew hi" published, and readers linked "@Mary" to that member. Now the labels are bound again after the last wait before the text is handed to the sender: after link sharing, and in a detached window after the upload. If the answer differs, the send stops with "A member's name changed while sending. Send again." The draft and its attachments stay, Send is free, and the next Send binds the labels afresh: a label a new name broke goes out as its members. A label that was broken when Send was pressed and holds again after a wait also stops the send once. What the waits already did, such as agents brought in, people added and links shared, stays done. Once the text is handed to the sender the message is committed. A main-window upload or a send gate's hold, for example, carries it, and a name that changes then reads as any rename after sending does. Not caught: a verified name the profile store holds but has not yet published to the composer, the sender's own name change still waiting to be sent, a DM's member list that loads during the wait, and a name this device has not loaded. The first send of a new conversation from New message or a new Solo chat is not checked again either: those screens take the text before their own waits. And a new DM to one agent named "Mary" with the group "Mary crew" publishes "@Mary crew" with no wait and no rename, because that composer does not know who the DM is with. 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>
|
🤖 Reply to jedwards27's review of Finding 1: a name that changes during the send's waits. Fixed for every wait in the composer's own send before the text is handed over, not only
Finding 2: the verified-name composer rows. Both are back (picked; saved in a draft). Each checks the sent text, the exact What this does not cover:
Checks on this head's tree: |
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent
Client↔relay contract: one literal @label with multiple existing p recipient tags; verify received rendering, thread/notification and alias collision on Desktop and Mobile against the same relay.
Verdict: COMMENT — recommend request changes to Jude. Not approval.
Reviewed: base 38c627a7b2e41cebd41309fc1ee4809bb9af7ab1, exact head 39b2ddefa2ccde6aa3e96cd014592445c35156f8 (clean worktrees; three-dot diff).
Risk: high — deferred publication of user-visible mention text can outlive its verified-name binding.
Blocking P2 — ordinary full-session attachment upload publishes a stale group label. src/features/messages/MessageComposer.tsx:3464,3682–3704 checks the label before the upload; the sendInBackground publication callback does not recheck after upload completes. A controlled mounted-composer probe held upload, changed a recipient’s verified name to the label’s first word, then released it: @Mary crew hi was sent, the draft/file cleared, and no name-change error appeared. The current reader binds @Mary to that person and leaves crew hi as text. This is misleading rendered identity; the signed p recipients remained the two originally selected members, not an observed extra notification.
Blocking P2 — queued Solo follow-up has the same error, including restart risk. MessageComposer.tsx:3464,3641–3665 validates before enqueue; src/features/solo/follow-up-queue.ts:512–561 releases after agent work; follow-up-message.ts:26–110 refreshes membership but publishes stored text without alias rebinding. A separate controlled mounted-composer probe held the send, changed MJ’s verified name to Mary, then resumed: messages.send received @Mary crew hi for MJ and Wes, not safe per-member names. follow-up-storage.ts:11–23 stores text and keys without group-label binding metadata, so a guard captured only in the original composer would not protect a restored queue. Held plugin outgoing messages and first-send flows also capture content across awaits; audit their publication boundaries, without treating untested paths as reproduced.
Author action: Protect every actual publication boundary: either retain enough binding metadata through queued/restarted sends to revalidate against current verified names, failing closed with a recoverable message, or canonicalize a deferred group into safe per-member mentions before handoff. Recheck after the full-session upload, with visible retry guidance and draft/attachment recovery. Add held-upload, held-queue and restart regressions asserting both sent text and p keys; inspect New Message/new Solo first-send awaits. Keep the existing detached-upload and link-sharing guards.
Validation: At the clean head, the targeted Desktop group-label test selection passed 21 tests and three focused Mobile mention-render/recipient widget tests passed 10 tests (separate client checkout). Both temporary production-seam probes above failed on the unsafe sent content and were removed; worktrees restored clean. Hosted CI has successful JavaScript, browser and flake lanes but CI required is red because Rust dependency policy rejects url 2.5.8 under RUSTSEC-2026-0592. Neither Cargo.lock nor deny.toml is in this PR’s three-dot diff; classify this as a base/dependency gate requiring repository-owner remediation, not evidence that the mention change caused it. An isolated Blox package run could not install because npm DNS returned EAI_AGAIN; no clean-head full package pass is claimed.
Manual/native evidence: none for an exact-artifact same-relay Desktop/Mobile run; native doctor lacked macOS Accessibility/Screen Recording permission and the isolated relay was unavailable. Verification owner: author for the two code fixes and regressions; repository/CI owner for the dependency-policy gate; reviewer/tooling for the same-relay Desktop/Mobile rendering, notification and thread check before merge. Package/widget tests do not satisfy that live-client gate.
The main-window upload now binds the labels again when the upload ends, before its publish call. Where that call sends at once, nothing is awaited after the check. A failure goes through the upload's own recovery, which shows the line and returns the draft and the files, or keeps them behind "Retry failed send recovery" when the person has typed a new draft meanwhile. The previous commit's message says a main-window upload carries the text past the check. That is no longer so where the send goes out at once. A send gate's hold and a Solo follow-up that takes the queue still do: a top-level send in the person's own Solo chat with the "queue" setting and at least one notified recipient, none of them a confirmed person in the chat. With an attachment such a send always enters the queue and waits there for a member refresh. Tests: one row sends to a channel with a file, so the send goes out when the upload ends. It holds the upload while a tagged member gains the verified name "Mary", then lets it finish. Nothing is sent, the composer shows "A member's name changed while sending. Send again.", the draft and the file are back in it, and the next Send sends "@mj @wes hi" to the two members. The row fails on the previous commit's production, which is this commit with the new line removed, and is then the only failure in the 69 test files related to the composer (2278 tests). 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>
Main at e5a9b4f deletes docs/plugin-architecture.md (#4213), where this branch added a paragraph on a mentions edit's `label`. The merge takes the deletion. The rule stays in the comment on `label` in src/features/conversation/contracts.ts. 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>
|
🤖 Reply to jedwards27's review of Finding 1: the main-window upload. Fixed for every upload whose send goes out when the upload ends. One kind of Solo send still waits after it; that is under Finding 2. My last reply called this path "after the handover". That was wrong: the step that publishes after the upload is still the composer's own code.
Finding 2: a Solo follow-up that takes the queue. Not changed in this PR.
Held plugin sends, New Message and a new Solo chat. Not changed. A send gate takes a frozen copy of the message before the composer sends it ( For a person to decide: whether this is acceptable for the PR. Readers bind a label by current names, so a rename after sending, or while a message waits in a queue or a gate, can make a reader show one member's name as a mention inside the label. The Checks on this head's tree: |
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent
Client↔relay contract: a group chip sends literal @label with the selected recipients’ existing p tags; verify Desktop/Mobile received rendering, thread and notification behavior on the same isolated relay.
Verdict: COMMENT — recommend request changes to Jude. This is not an approval.
Reviewed: base e5a9b4f1fbd1e0f6d9cddfa2bc52c8697d4e44a3, exact head e115bba538ddca433a41bd0aa079a1f05cfc386d (clean worktree; three-dot PR diff, 22 files). Risk: high — an unpublished group message can render as an individual person mention even though the signed p keys remain the selected group.
P2 remains — queued Solo follow-up publishes a label that no longer reads as itself. The composer checks the label before handing off frozen text and recipient keys (MessageComposer.tsx:3190–97,3464,3641–65). The queue releases it later, and follow-up-message.ts:26–119 refreshes membership but publishes stored text without checking current names. follow-up-storage.ts:16–27 persists no group binding for restart. At the preceding reviewed head, a mounted-composer held-queue probe selected @Mary crew for MJ and Wes, changed MJ’s verified name to Mary before release, and observed messages.send publish @Mary crew hi with both original keys; the receiving reader binds @Mary as a person and leaves crew hi as prose. Those queue/publication paths are unchanged at this head. This is misleading presentation, not evidence of an extra recipient or notification. A rename after publication is unavoidable; a rename while an unpublished message waits in a queue is not the same boundary. The issue’s plain-label reader contract is not met merely by listing this as a known limit.
Author action: preserve binding provenance through durable deferred sends and revalidate/rewrite at actual publication, with recoverable failure if it cannot be made safe; alternatively reject labeled-group sends on deferred routes before clearing the composer draft. Add a deterministic held-queue and restart regression asserting sent/rendered text and exact p keys. A composer-only closure guard cannot protect restored messages. Held plugin sends also retain frozen text through later publication (outgoing-message.ts:64–97); this is source-traced, not separately reproduced at this head. Audit that boundary without claiming it was exercised.
Fixed since 39b2ddef: the ordinary full-session attachment upload now checks labels after upload and before publish (MessageComposer.tsx:3700–04). Two independent reviewers mutation-checked the mounted-composer regression: it passes with the guard and fails on stale @Mary crew hi when only that line is removed. The checked-in case asserts no send, visible retry guidance, restored draft/file, then safe @MJ @Wes hi with MJ+Wes keys. It does not assert the recovered attachment in the retry’s actual send argument; that coverage improvement is recommended, not a separately established runtime defect.
Validation: exact-head git diff --check passed. Focused mounted-composer runs passed 1/1 and 2/2 selected tests respectively, with 728/727 filtered; the mutation fails behaviorally and the clean head is restored. The author reports pnpm check, 69 related test files (2,278 tests), and Chromium/WebKit completion journey passing; those author runs are not independent full-package evidence. At review preparation, hosted CI was still in progress (51 successful, 21 pending, Windows native skipped); the url 2.5.9 security-advisory fix is in merged base, not this PR’s Rust diff. No independent full package pass or native same-relay Desktop/Mobile delivery journey is claimed.
Verification owner: author for the deferred-send code/regression or explicit product-owner exception; CI/repository owner for hosted required checks; reviewer/tooling for same-relay Desktop/Mobile received rendering, thread and notification behavior before merge. The FOUNDATION contracts.ts edit still requires human maintainer guidance. These evidence/authorization gates are separate from the P2 code finding. A new head needs a fresh review.
With the follow-up setting on "queue", a top-level send in the person's own Solo chat now sends every group as one name per member, so no group chip enters the follow-up queue or its storage. An edit of a queued message can add `@label` as plain text, as typing it does; it adds no recipient. It also applies to a send in that context that goes out at once: the route is known only after the member refresh, and the text is bound before it. Commit `51f6cbda79`'s message says a Solo follow-up that takes the queue carries the text past the check. That is no longer so. A send gate's hold still does. Tests: a `sentDraft` row keeps a group whose label holds as one chip, and a second row splits it when every group is to be split. In the person's own Solo chat with the "queue" setting, a send to two agents tagged as the group "Mary crew" waits in the queue while one of them is working; one of them then gains the verified name "Mary", and when the work ends the queue sends "@mj @wes hi" to exactly those two keys. Storage holds that text and those two keys, and after a reload the saved row sends the same text to the same keys. A send there that goes out at once, because a person in the chat is tagged, also sends the members' names. A new Solo chat's first send keeps the group as one chip. The upload row from commit `51f6cbda79` now also checks that the next Send carries the uploaded file. Controls, on the files related to the two changed sources (5,864 tests in 132 files, one skipped), with the tests as committed except two comment lines in a helper, since removed: with both production changes taken out, 4 fail: the held queue, the restart, the send that goes out at once and the row that splits every group; with every group split at every send, 11 fail, the new Solo chat's first send and ten existing one-chip tests; without the `!submission` check, only the new Solo chat's first send fails. With the main window's upload callback publishing no files, the upload row fails at its new file check (12 of 733 in `MessageComposer.test.tsx` fail; the other 11 are existing upload tests). 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>
|
🤖 Reply to the review at The queued Solo follow-up is fixed in code, not listed as a limit. With the follow-up setting on "queue" (the default is "immediate"), a top-level send in the person's own Solo chat now sends every group as one name per member. No group chip enters the follow-up queue or its storage, so a release or a restart has no label to check again. The stored format is unchanged.
Tests (
Held plugin sends: audited by reading the code, not run.
Checks on Still for a person: the desktop and phone try against one relay; the yes on the one |
Main at 4820bfd includes #3854, which changes who a Solo message alone with agents is for: a draft that opens with a tag is for the agents it tags, and a tag further in joins the toolbar's agents (`soloAudience` in src/features/solo/recipients.ts). MessageComposer.tsx conflicted in two places. Beside `sendRecipients`, the merge keeps this branch's `boundNames` and main's comment. At the send, it keeps main's `fromPill` test and this branch's `attempt` controller; `queueable` stays where this branch moved it, before the draft is bound, since main did not change it. A send's group names are bound against `recipientsNow`, which is now main's audience, so a group chip is checked against the toolbar's agents too when they go along. Every file this branch changes carries the same added and removed lines against main as it did against e5a9b4f. 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>
…gent Since #3854, a Solo draft alone with agents goes to the toolbar's agents and its tags, unless a tag opens the text. A group chip gives each member the chip's place in the text, so a chip further in joins the toolbar's agents, as a single tag does. The row: in a Solo chat of three agents with Ada in the toolbar, a saved draft "Plan this, then ask @crew" (Crew: Bea and Cam) shows "Sending to Ada, Bea, Cam", keeps the chip, and sends that text to Ada, Bea and Cam. Control: with group members put at the text's start where `sendRecipients` asks who the draft is for, this row fails, and no other of the 2,377 tests in the files related to MessageComposer.tsx and recipients.ts. 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 group chip tags each member at the chip's place in the text. When its first member is someone outside the chat, which only references them, and another member is one of the chat's agents, `soloAudience` took the first member as the opening tag, saw a reference, and the send added the toolbar's agents. The composer leaves references out before it asks, so it showed the group's agent alone. `soloAudience` now opens the draft when any recipient at the earliest place is named. Single tags never share a place, so their result is unchanged. Tests: a row in the `soloAudience` table (a reference and Bea, both at the start, open the draft) and a composer row (a Solo chat with Ada in the toolbar; "@crew hi", where Crew is Cy, outside the chat, then Bea: it shows "Sending to Bea" and sends to Bea alone). Without the fix both fail: the table gives `opensWithTag: false`, and the send goes to Ada and Bea. 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>
Main at 47fa0d6 includes #4156, which ranks typed emoji suggestions by picker usage. A completion item from a bundled provider can carry `onSelect`, which runs only when its edit is accepted, and `insertText` returns "typed" when only the typed key landed. The merge has no textual conflicts. A group chip goes in as a recipient, and `insertText` drops the typed key for a recipient, so the group path still returns only true or false. `completionResult` keeps this branch's group `label` on the edit and main's `onSelect` on the item. The group chip tests in EditableInput.test.tsx kept `insertText`'s result in a variable typed `boolean`, which no longer type-checks. The merge types it as `boolean | "typed"`, so a group chip that returned "typed" would fail their `toBe(true)` and `toBe(false)`. Apart from that line, every file this branch changes carries the same added and removed lines against main as it did against 4820bfd. 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>
Moved from #2878. Builds on #3836 (merged);
mainis merged in.Summary
Lets a completion provider put in one
@labelchip (shown as@crew · 2) that notifies several people at once, instead of one chip per person.Screenshots are from a run on an earlier head; the chip and the sent text are the same on this one.
@labelas plain text with oneptag per recipient. No custom links, tags or event fields, so readers need no change.Design Team,eng-oncall), and no name of someone the message tags that a reader would show as a mention in it: a whole name (Honey teamwith Honey), or on mobile a first name at its start in any case (Mary crewwith Mary Jane). Any other label, such asR&D, goes in as one chip per person, so everyone is still notified. Nothing is escaped.@label. A message edit adds no recipients.@labelwhole in Solo chat titles. A trusted pick marks each memberexplicit, as a person pick does. In an agent-only Solo chat, a group chip follows the single-tag rule: opening the draft with a notifying member targets the draft's tags alone, while a chip further in joins the toolbar's agents.Why this is in core
Core provides only the minimal general hook; plugins own the group feature (
AGENTS.mdopen-source boundary).labelonmentionsedit (contracts.ts,completion.ts)composer-document.ts,mention-draft.ts)groupattribute + optional draftlabelEditableInput.tsx,composer-dom.ts,MessageComposer.tsx){ label, members }, reuses existing rulescomposer-document.ts,mention-draft.ts)RichComposerInput.tsx)InlineChipwith· Nand grouparia-labelNewMessage.tsx,composer-markdown.ts,chat-title.ts)@labelsolo/recipients.ts)soloAudiencechecks whether any recipient at the earliest position is a notifying one (+6/−7; names no feature, single tags unchanged)Size & Validation
bad6c79339overmain47fa0d6782, 24 files): production +545/−114 (14 files), tests +1719/−19 (10 files).bad6c79339, separate Linux machine):pnpm check, the design lane, the whole unit suite (1,209 files: 25,830 passed, 39 skipped, 0 failed of 25,869), andcompletion-work.spec.mjs+solo-chats.spec.mjs(22/22 in Chromium, 22/22 in WebKit) pass.@Crewwith aptag for each member, and records the owner's mention for both.@Launch crew.com). On mobile a label of several words is styled on its first word only, with no link. No mobile test is in this PR.Try it yourself (manual test plugin)
Run
just desktopand load an unsigned folder plugin with:manifest.json{ "id": "example.group-chip", "name": "Group chip example", "apiVersion": 1 }plugin.jsOpen Settings → Manage plugins → Add → Browse, enable Group chip example, then type
@cr, press Enter, typehello, and send.🤖 Generated with Claude Code