diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsx index d7596305cff2c..90c827fe8a5b1 100644 --- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx @@ -968,6 +968,26 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { ? `Opens the thread. Swipe left to ${primaryAction.label.toLowerCase()}.` : `Opens the thread. Swipe left for ${primaryAction.label.toLowerCase()} and snooze actions.`; + // Static rather than spinning: the regeneration can take a while and a + // looping animation would repaint every row that shows it. + const titleRegenerationIcon = + thread.titleRegeneration != null ? ( + + ) : null; + // The row is one accessible element, so nested labels are never read. + const rowAccessibilityLabel = [ + thread.title, + props.hasQueuedMessages ? "messages queued to send" : null, + thread.titleRegeneration != null ? "regenerating title" : null, + ] + .filter((part) => part !== null) + .join(", "); + // Sidebar rows use navigation foregrounds on their active and idle surfaces. const cardContent = ( <> @@ -993,6 +1013,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { > {props.projectTitle ?? props.project?.title ?? ""} + {titleRegenerationIcon} {props.hasQueuedMessages ? : null} {pinnedRow ? ( { @@ -1229,9 +1248,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { interactionClassName={rowAppearance.interactionClassName} interactionOpacity={rowAppearance.interactionOpacity} accessibilityHint={swipeAccessibilityHint} - accessibilityLabel={ - props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title - } + accessibilityLabel={rowAccessibilityLabel} accessibilityRole="button" accessibilityState={{ selected }} className={rowAppearance.className} @@ -1281,6 +1298,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { /> ) : null} + {titleRegenerationIcon} {props.hasQueuedMessages ? : null} ); const accessibleTitle = isRenaming ? null : {thread.title}; + // Static on purpose: a spinning icon repaints every frame for the whole + // regeneration, and the dimmed title already reads as "in flight". + const titleRegenerationIndicator = isRegeneratingTitle ? ( + + + + Regenerating title + + + ) : null; // Stacks show their layer count; multiple unrelated links show their total count. // Either opens the thread's pull requests tab; a single PR link opens that PR and still @@ -1816,7 +1827,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { aria-label={accessibility.label} aria-current={accessibility.current} data-testid="sidebar-row-slim" - aria-busy={isRegeneratingTitle || undefined} className={cn(rowSurfaceClassName, "flex h-9 items-center gap-2.5 px-2.5")} onClick={handleClick} onDoubleClick={handleDoubleClick} @@ -1840,12 +1850,8 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { {draftIndicator} {title} {pinIndicator} + {titleRegenerationIndicator} {terminalStatusIcon} - {isRegeneratingTitle ? ( - - Regenerating title - - ) : null} {/* The PR badge stays outside the hover-fading slot: it must remain visible AND clickable while the row is hovered. Only the time/jump label yields to the settle affordance. */} @@ -1981,7 +1987,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { aria-label={accessibility.label} aria-current={accessibility.current} data-testid="sidebar-row-card" - aria-busy={isRegeneratingTitle || undefined} className={rowSurfaceClassName} onClick={handleClick} onDoubleClick={handleDoubleClick} @@ -2154,13 +2159,9 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { release click still fires and is consumed. */} {props.sweepAction !== null ? dragDestination : null} -
+
{title} - {isRegeneratingTitle ? ( - - Regenerating title - - ) : null} + {titleRegenerationIndicator}
{/* Always the branch. The plan step used to take this slot while diff --git a/apps/web/src/components/chat/ChatHeader.tsx b/apps/web/src/components/chat/ChatHeader.tsx index c2b1a805011ba..39385c6eb105a 100644 --- a/apps/web/src/components/chat/ChatHeader.tsx +++ b/apps/web/src/components/chat/ChatHeader.tsx @@ -9,7 +9,7 @@ import { isAtomCommandInterrupted, squashAtomCommandFailure, } from "@t3tools/client-runtime/state/runtime"; -import { ChevronDownIcon } from "lucide-react"; +import { ChevronDownIcon, RefreshCwIcon } from "lucide-react"; import { memo, useCallback, @@ -46,6 +46,7 @@ interface ChatHeaderProps { activeThreadTitle: string; /** Drafts have no server thread yet, so the title carries no action menu. */ isServerThread: boolean; + isRegeneratingTitle: boolean; activeProject: EnvironmentProject | null; parentThreadLink: { threadId: ThreadId; title: string } | null; onOpenThread: (threadId: ThreadId) => void; @@ -80,6 +81,7 @@ export const ChatHeader = memo(function ChatHeader({ activeThreadId, activeThreadTitle, isServerThread, + isRegeneratingTitle, activeProject, parentThreadLink, onOpenThread, @@ -413,9 +415,20 @@ export const ChatHeader = memo(function ChatHeader({ /> } > -

+

{activeThreadTitle}

+ {isRegeneratingTitle ? ( + <> + + + Regenerating title + + + ) : null}