Skip to content

Commit db514b1

Browse files
authored
fix(desktop): stop pulsing addressed agents on send (block#6873)
## Summary - Stop replaying the selected-agent pulse when a remembered agent remains addressed across a send. - Preserve the existing pulse for genuine selections and shake feedback for failed sends. ### Related issue Reported in Buzz: buzz://message?channel=2745947d-f905-4f31-8a3f-fc4485d3c36c&id=0cffab376186be9cc4e7f29027352cc1c7941aead48b3fed948f36181f4a59af ### Testing - `cd desktop && pnpm test` (5,556 passed) - `cd desktop && pnpm typecheck` - `cd desktop && pnpm check` - `cd desktop && pnpm build:e2e` - `cd desktop && pnpm exec playwright test tests/e2e/persistent-agent-audience.spec.ts --grep 'always-mentioned agents remain selected|failed always-mentioned send'` (2 passed) This changes animation timing only; the regression is covered by Playwright assertions on the pulse and shake versions, while a static screenshot is unchanged. Signed-off-by: Matt Toohey <[email protected]>
1 parent 4f529a4 commit db514b1

4 files changed

Lines changed: 4 additions & 11 deletions

File tree

‎desktop/src/features/messages/ui/MessageComposer.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ function MessageComposerImpl({
341341
drafts,
342342
emojiAutocomplete,
343343
mentions,
344-
onAddressedAgentsSendStarted: addressPulse.pulseMany,
345344
onAddressedAgentsComposerCleared: (pubkeys) =>
346345
restoreAddressedAgentMentionsRef.current(pubkeys),
347346
onAddressedAgentsSendFailed: addressPulse.shakeMany,

‎desktop/src/features/messages/ui/useMentionSendFlow.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export function useMentionSendFlow({
5252
emojiAutocomplete,
5353
mentions,
5454
onPrepareSendChannel,
55-
onAddressedAgentsSendStarted,
5655
onAddressedAgentsComposerCleared,
5756
onAddressedAgentsSendFailed,
5857
onAddressedAgentsSendSucceeded,
@@ -404,9 +403,6 @@ export function useMentionSendFlow({
404403
draft.capturedChannelId === channelIdRef.current ||
405404
channelIdRef.current === null
406405
) {
407-
if (draft.addressedAgentPubkeys.length > 0) {
408-
onAddressedAgentsSendStarted?.(draft.addressedAgentPubkeys);
409-
}
410406
clearComposer();
411407
if (draft.addressedAgentPubkeys.length > 0) {
412408
optimisticComposerContent =
@@ -640,7 +636,6 @@ export function useMentionSendFlow({
640636
getManagedAgentsByPubkey,
641637
mentions.isAgentPubkey,
642638
mentions.revalidateMentionPubkeys,
643-
onAddressedAgentsSendStarted,
644639
onAddressedAgentsComposerCleared,
645640
onAddressedAgentsSendFailed,
646641
onAddressedAgentsSendSucceeded,

‎desktop/src/features/messages/ui/useMentionSendFlow.types.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type UseMentionSendFlowOptions = {
1919
emojiAutocomplete: Pick<UseEmojiAutocompleteResult, "clearEmojis">;
2020
mentions: UseMentionsResult;
2121
onPrepareSendChannel?: (pubkeys?: string[]) => Promise<string | null>;
22-
onAddressedAgentsSendStarted?: (pubkeys: readonly string[]) => void;
2322
onAddressedAgentsComposerCleared?: (pubkeys: readonly string[]) => string;
2423
onAddressedAgentsSendFailed?: (pubkeys: readonly string[]) => void;
2524
onAddressedAgentsSendSucceeded?: (

‎desktop/tests/e2e/persistent-agent-audience.spec.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ test("the mention button opens settings and can undo an address", async ({
500500
).toHaveCount(0);
501501
});
502502

503-
test("always-mentioned agents remain in the mention button while Enter-send resolves", async ({
503+
test("always-mentioned agents remain selected without replaying their animation while Enter-send resolves", async ({
504504
page,
505505
}) => {
506506
await installAudienceFixtures(page, {
@@ -549,7 +549,7 @@ test("always-mentioned agents remain in the mention button while Enter-send reso
549549
.not.toContain("");
550550
await expect(avatar).toHaveAttribute(
551551
"data-pulse-version",
552-
String(initialPulseVersion + 1),
552+
String(initialPulseVersion),
553553
{ timeout: 500 },
554554
);
555555
await expect(
@@ -587,7 +587,7 @@ test("always-mentioned agents remain in the mention button while Enter-send reso
587587
).toHaveCount(1);
588588
});
589589

590-
test("a failed always-mentioned send shakes the composer avatar", async ({
590+
test("a failed always-mentioned send shakes the composer avatar without replaying its selection animation", async ({
591591
page,
592592
}) => {
593593
await installAudienceFixtures(page, {
@@ -610,7 +610,7 @@ test("a failed always-mentioned send shakes the composer avatar", async ({
610610

611611
await expect(avatar).toHaveAttribute(
612612
"data-pulse-version",
613-
String(initialPulseVersion + 1),
613+
String(initialPulseVersion),
614614
{ timeout: 500 },
615615
);
616616
await expect(input).toHaveText("@Morgarita please retry");

0 commit comments

Comments
 (0)