Skip to content

Commit 165b7a1

Browse files
tulsi-builderBasilBotclaude
committed
fix(drafts): word the draft cue by a thread's replies, and title it Draft
Design review: a thread with replies said "Draft reply" while an agent's activity line hid its reply count, but "Draft" otherwise. The cue now follows whether the thread has replies, not whether the count is shown. The sidebar pencil's tooltip says "Draft", matching its accessible name. Co-authored-by: BasilBot <399581b6165ab01343e3a1324774b1024d76942aea563468f93c975e5ee5193c@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: tulsi <[email protected]>
1 parent c16e79a commit 165b7a1

5 files changed

Lines changed: 34 additions & 4 deletions

File tree

‎src/bundled/channels/ChannelSidebarItem.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ it("marks a channel with a draft in it or one of its threads, except while it is
768768
writeView(scope, thread, { text: "Half a reply", recipients: [] });
769769
});
770770
const pencil = screen.getByRole("img", { name: "Draft" });
771-
expect(pencil).toHaveAttribute("title", "Unsent draft");
771+
expect(pencil).toHaveAttribute("title", "Draft");
772772
// Part of the row's name, not a separate stop.
773773
expect(pencil.closest("button")).toHaveAttribute(
774774
"data-channel-id",

‎src/bundled/channels/ChannelSidebarItem.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function ChannelSidebarItemCore({
248248
data-channel-draft=""
249249
role="img"
250250
aria-label="Draft"
251-
title="Unsent draft"
251+
title="Draft"
252252
>
253253
<PencilSimpleIcon size={14} />
254254
</span>

‎src/features/messages/MessageRow.test.tsx‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import {
4444
import { ToastProvider } from "../../shared/design-system/ui/Toast";
4545
import { ConversationPresentation } from "../conversation/ConversationPresentation";
4646
import { MessageRow } from "./MessageRow";
47+
import { ReplySummary } from "./ReplySummary";
4748
import { setClockPreference } from "../../shared/clock-preference";
4849
import { MessageManagement } from "./MessageManagement";
4950
import type { ChannelMessage, Profile } from "../relay/contracts";
@@ -5022,3 +5023,28 @@ it("notes a thread's unsent reply on its summary until the thread's composer sho
50225023
localStorage.clear();
50235024
}
50245025
});
5026+
5027+
it("words a thread's draft by its replies even while an activity line hides their count", () => {
5028+
const summary = (replied: boolean) =>
5029+
renderDom(
5030+
<ReplySummary
5031+
count={0}
5032+
hideEmptyLabel
5033+
draft
5034+
replied={replied}
5035+
participants={[]}
5036+
resolveName={(id) => id}
5037+
media={() => undefined}
5038+
/>,
5039+
);
5040+
const busy = summary(true);
5041+
expect(busy.container.querySelector("[data-thread-draft]")).toHaveTextContent(
5042+
/^·Draft$/,
5043+
);
5044+
busy.unmount();
5045+
const fresh = summary(false);
5046+
expect(
5047+
fresh.container.querySelector("[data-thread-draft]"),
5048+
).toHaveTextContent(/^Draft reply$/);
5049+
fresh.unmount();
5050+
});

‎src/features/messages/MessageRow.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ function MessageRowContent({
968968
<ReplySummary
969969
hideEmptyLabel={!!activity}
970970
draft={threadDraft}
971+
replied={row.replyCount > 0}
971972
count={activity ? 0 : row.replyCount}
972973
participants={row.participants}
973974
profiles={participantProfiles}

‎src/features/messages/ReplySummary.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ export function ReplySummary({
1919
activity,
2020
hideEmptyLabel = false,
2121
draft = false,
22+
replied = count > 0,
2223
}: {
2324
workingParticipants?: readonly string[];
2425
activity?: ReactNode;
2526
/** Activity-only triggers already have an accessible thread action label. */
2627
hideEmptyLabel?: boolean;
2728
/** An unsent reply waits in this thread; it names an empty thread itself. */
2829
draft?: boolean;
30+
/** The thread has replies, even when an activity line hides their count. */
31+
replied?: boolean;
2932
count: number;
3033
participants: readonly string[];
3134
profiles?: ReadonlyMap<string, Profile> | undefined;
@@ -70,9 +73,9 @@ export function ReplySummary({
7073
) : null}
7174
{draft && (
7275
<span className={styles.threadDraft} data-thread-draft="">
73-
{count > 0 && <span aria-hidden="true">·</span>}
76+
{replied && <span aria-hidden="true">·</span>}
7477
<PencilSimpleIcon size={14} aria-hidden="true" />
75-
{count > 0 ? "Draft" : "Draft reply"}
78+
{replied ? "Draft" : "Draft reply"}
7679
</span>
7780
)}
7881
</>

0 commit comments

Comments
 (0)