fix(web): restore unified activity logs and composer banners #8734
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 8 commits into
main fromrefs/pull/8734/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/web/src/components/chat/ComposerBannerStack.tsx line 38Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -47,5 +19,20 @@47- readonly actionClassName?: string;4819 readonly dismissLabel?: string;4920 readonly onDismiss?: () => void;5021 }512223+export type ComposerBannerStackContent = Pick<24+ ComposerBannerStackItem,25+ "id" | "variant" | "priority" | "className"26+> & { readonly content: ReactNode };27+28+type ComposerBannerStackEntry = ComposerBannerStackItem | ComposerBannerStackContent;29+30+function bannerPriority(item: ComposerBannerStackEntry) {31+ if (item.priority === "activity") {32+ return 0;33+ }34+ if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {35+ return 1;36+ }37+ return 2;38+}
- @@ -206,16 +200,5 @@206- {/* The chevron points at the body: down while it is open below the207- header, up while it is collapsed into it. */}208- <ChevronDownIcon209- aria-hidden="true"210- className={cn(211- "ml-auto size-3.5 shrink-0 text-secondary-label transition-transform duration-150 group-hover:text-foreground",212- isCollapsed && "rotate-180",213- )}214- />215- </CollapsibleTrigger>216- </div>217- {/* The panel carries the horizontal padding itself: it clips its content218- while the height animates, so the option buttons have to sit inside219- that padding or their focus rings get shaved off at the edges. */}220- <CollapsiblePanel className="px-3 sm:px-4">221- <div className="pt-2 pb-0.5">200+ <ComposerBanner.ToggleIcon expanded={!isCollapsed} />201+ </ComposerBanner.Actions>202+ </CollapsibleTrigger>203+ <CollapsiblePanel>204+ <ComposerBanner.Body>apps/web/src/components/chat/ComposerBanner.tsx lines 314 to 314Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +277,21 @@277+ <div278+ className={cn(279+ "min-w-0 ps-[calc(var(--composer-banner-icon-column)+(--spacing(1)))]",280+ className,281+ )}282+ {...props}283+ />284+ );285+}286+287+function Dot({ className, ...props }: ComponentProps<"span">) {288+ return (289+ <span className={cn("size-1.5 flex-none rounded-full bg-current", className)} {...props} />290+ );291+}292+293+function ToggleIcon({ expanded, className }: { expanded: boolean; className?: string }) {294+ return (295+ <span296+ aria-hidden297+ className={cn(buttonVariants({ size: "icon-xs", variant: "ghost" }), className)}
- @@ -0,0 +74,21 @@74+ info: "border-info/24",75+ success: "border-success/24",76+ warning: "border-warning/24",77+};78+79+function Peek({80+ className,81+ variant = "default",82+ ...props83+}: ComponentProps<"button"> & { variant?: ComposerBannerVariant }) {84+ return (85+ <button86+ type="button"87+ data-slot="composer-banner-peek"88+ className={cn(89+ surfaceColors,90+ neutralOutline,91+ "absolute inset-x-0 bottom-0 z-0 mx-auto h-3 w-[96%] cursor-pointer rounded-t-2xl border border-b-0 shadow-[0_6px_18px_rgb(0_0_0/6%)]",92+ "bg-[color-mix(in_srgb,var(--chat-composer-attached-surface)_var(--glass-opacity),transparent)] backdrop-blur-(--glass-blur) backdrop-saturate-(--glass-saturation)",93+ "not-supports-[(backdrop-filter:blur(1px))_or_(-webkit-backdrop-filter:blur(1px))]:bg-(--chat-composer-attached-surface)",94+ "transition-opacity duration-150 ease-out focus-visible:outline-2 focus-visible:outline-ring",@@ -3550,7 +3585,18 @@3585+ activeTasksProgress &&3586+ activeTaskSteps ? (35503587 <ComposerTasksDrawer3551- onDismiss={dismissTasks}35523588 onCollapse={toggleTasksDrawer}3553- progress={visibleTasksProgress}3554- steps={visibleTaskSteps}3589+ progress={activeTasksProgress}3590+ steps={activeTaskSteps}3591+ activityStatus={activityStatus}35553592 />35563593 ) : null}3594+ {hasShoulderTab ? (3595+ <ComposerBanner.Dock>3596+ {standaloneActivityStatus ? (3597+ <ComposerBanner.Root width="content" data-composer-shoulder-tab>3598+ <ComposerActivityRow status={standaloneActivityStatus} />3599+ </ComposerBanner.Root>3600+ ) : null}3601+ {activeTasksProgress && activeTaskSteps ? (3602+ <ComposerTasksBadge
- @@ -213,18 +245,3 @@213- className={cn(214- item.actionClassName,215- dismissOnly216- ? "max-sm:col-start-3 max-sm:row-start-1 max-sm:mt-0 max-sm:self-start"217- : undefined,218- )}219- >220- {item.actions}221- {item.onDismiss ? (222- <Button223- size="icon-xs"224- variant="ghost"225- aria-label={item.dismissLabel ?? "Dismiss warning"}226- disabled={exiting}227- onClick={onDismissRequest}228- >229- <XIcon className="size-3.5" />230- </Button>245+ <ComposerBanner.Row layout="wrap-actions">246+ <ComposerBanner.Icon>{item.icon}</ComposerBanner.Icon>247+ <ComposerBanner.Content className="font-medium">{item.title}</ComposerBanner.Content>@@ -0,0 +88,21 @@88+ className={cn(89+ surfaceColors,90+ neutralOutline,91+ "absolute inset-x-0 bottom-0 z-0 mx-auto h-3 w-[96%] cursor-pointer rounded-t-2xl border border-b-0 shadow-[0_6px_18px_rgb(0_0_0/6%)]",92+ "bg-[color-mix(in_srgb,var(--chat-composer-attached-surface)_var(--glass-opacity),transparent)] backdrop-blur-(--glass-blur) backdrop-saturate-(--glass-saturation)",93+ "not-supports-[(backdrop-filter:blur(1px))_or_(-webkit-backdrop-filter:blur(1px))]:bg-(--chat-composer-attached-surface)",94+ "transition-opacity duration-150 ease-out focus-visible:outline-2 focus-visible:outline-ring",95+ peekBorder[variant],96+ className,97+ )}98+ {...props}99+ />100+ );101+}102+103+function Attachment({ className, ...props }: ComponentProps<"div">) {104+ return (105+ <div106+ data-slot="composer-banner-attachment"107+ className={cn(108+ "mx-auto -mb-[calc(1rem+1px)] w-[calc(100%-2.75rem)] max-w-[45.25rem]",
- @@ -257,0 +162,21 @@162+ <ComposerBanner.Icon163+ className={cn(164+ "font-mono text-[10px]",165+ step.status === "completed"166+ ? "text-success"167+ : step.status === "inProgress"168+ ? "text-primary"169+ : "text-muted-foreground/40",170+ )}171+ >172+ {step.status === "completed" ? "✓" : step.status === "inProgress" ? "●" : "○"}173+ </ComposerBanner.Icon>174+ <ComposerBanner.Content175+ className={cn(176+ step.status === "completed"177+ ? "text-muted-foreground/55"178+ : step.status === "inProgress"179+ ? "text-foreground/90"180+ : "text-muted-foreground/70",181+ )}182+ >
- apps/web/src/components/chat/ThreadSyncStatusPill.tsx line 17OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -5,13 +6,12 @@56 export function ThreadSyncStatusPill({ phase }: { readonly phase: ThreadSyncPhase }) {67 const label = threadSyncLabel(phase);7889 return (9- <div10- aria-label={label}11- className="chat-composer-drawer-surface chat-composer-drawer-attached chat-composer-drawer-slot pointer-events-none flex items-center gap-2 px-3 pt-2 pb-[calc(var(--chat-composer-attachment-overlap)_+_0.375rem)] text-foreground text-xs font-medium sm:px-4"12- data-thread-sync-drawer="true"13- role="status"14- >15- <LoaderCircleIcon aria-hidden className="size-3.5 shrink-0 text-muted-foreground" />16- <span className="truncate">{label}</span>17- </div>10+ <ComposerBanner.Attachment>11+ <ComposerBanner.Surface12+ aria-label={label}13+ className="pointer-events-none flex items-center gap-2 px-3 pt-2 pb-[calc(var(--chat-composer-attachment-overlap)+0.375rem)] text-xs font-medium text-foreground sm:px-4"14+ data-thread-sync-drawer="true"15+ role="status"16+ >17+ <LoaderCircleIcon aria-hidden className="size-3.5 shrink-0 text-muted-foreground" />
- apps/web/src/components/chat/ThreadSyncStatusPill.tsx lines 11 to 19OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -7,11 +8,12 @@7889 return (9- <div10- aria-label={label}11- className="chat-composer-drawer-surface chat-composer-drawer-attached chat-composer-drawer-slot pointer-events-none flex items-center gap-2 px-3 pt-2 pb-[calc(var(--chat-composer-attachment-overlap)_+_0.375rem)] text-foreground text-xs font-medium sm:px-4"12- data-thread-sync-drawer="true"13- role="status"14- >15- <LoaderCircleIcon aria-hidden className="size-3.5 shrink-0 text-muted-foreground" />16- <span className="truncate">{label}</span>17- </div>10+ <ComposerBanner.Attachment>11+ <ComposerBanner.Surface12+ aria-label={label}13+ className="pointer-events-none flex items-center gap-2 px-3 pt-2 pb-[calc(var(--chat-composer-attachment-overlap)+0.375rem)] text-xs font-medium text-foreground sm:px-4"14+ data-thread-sync-drawer="true"15+ role="status"16+ >17+ <LoaderCircleIcon aria-hidden className="size-3.5 shrink-0 text-muted-foreground" />18+ <span className="truncate">{label}</span>19+ </ComposerBanner.Surface>
- @@ -4553,7 +4553,4 @@45534553 // partition (same shell, same capability gate, same PR auto-settle input)45544554 // so the banner and the sidebar row never disagree.45554555 const activeThreadShell = useThreadShell(isServerThread ? activeThreadRef : null);4556- const activeComposerTasksProgress =4557- activeLatestTurn !== null && !latestTurnSettled4558- ? (activeThreadShell?.planProgress ?? null)4559- : null;4556+ const activeComposerTasksProgress = useMemo(() => {
- @@ -2260,18 +2269,9 @@22602269 ) {22612270 const updateInProgress = serverUpdateState.status === "running";22622271 const updateFailed = serverUpdateState.status === "failed";22632272 items.push({22642273 id: `server-version:${serverUpdateEnvironmentId}`,22652274 variant: updateFailed ? "error" : "default",2266- // A running update is live progress the user is waiting on; only the2267- // idle "update available" offer is calm enough to stack behind.2268- urgent: updateInProgress,2269- // In-flight and failed states carry their own status dot inside2270- // ServerUpdateProgress; only the idle offer needs an icon.2271- icon:2272- updateInProgress || updateFailed ? null : (2273- <span2274- className="size-1.5 rounded-full border border-muted-foreground/40"2275- aria-hidden="true"2276- />2277- ),2275+ // Prioritize update progress over passive notices, but keep activity attached.2276+ priority: updateInProgress ? "urgent" : "notice",2277+ icon: <InfoIcon aria-hidden />,
- @@ -0,0 +129,21 @@129+}130+131+/** Attachments share a column while neighboring tabs keep their own surface. */132+function Column({ className, ...props }: ComponentProps<"div">) {133+ return (134+ <div135+ className={cn(136+ "flex min-w-0 flex-1 flex-col empty:hidden",137+ "[&>[data-slot=composer-banner-attachment]]:w-full [&>[data-slot=composer-banner-attachment]:last-child]:mb-0",138+ className,139+ )}140+ {...props}141+ />142+ );143+}144+145+function Root({146+ className,147+ placement = "attached",148+ variant = "default",149+ width = "fill",
- @@ -0,0 +71,21 @@71+const peekBorder: Record<ComposerBannerVariant, string> = {72+ default: "border-(--chat-composer-attached-outline)",73+ error: "border-destructive/24",74+ info: "border-info/24",75+ success: "border-success/24",76+ warning: "border-warning/24",77+};78+79+function Peek({80+ className,81+ variant = "default",82+ ...props83+}: ComponentProps<"button"> & { variant?: ComposerBannerVariant }) {84+ return (85+ <button86+ type="button"87+ data-slot="composer-banner-peek"88+ className={cn(89+ surfaceColors,90+ neutralOutline,91+ "absolute inset-x-0 bottom-0 z-0 mx-auto h-3 w-[96%] cursor-pointer rounded-t-2xl border border-b-0 shadow-[0_6px_18px_rgb(0_0_0/6%)]",
juliusmarminge merged this30175a8
juliusmarminge closed this
Sign in to join this conversation.


























Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
f3a66e84-043e-4bc3-b47b-654eccf47321You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Warning
Your free Security trial is over. An organization admin can activate Security or dismiss this notice.
Comment `@coderabbitai help` to get the list of available commands.