fix(web): unify activity logs and composer banners #8693
Mergedjuliusmarmingemerged 8 commits into
main fromrefs/pull/8693/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
- @@ -163,0 +129,21 @@129+ const row = (130+ <ComposerBanner.Row131+ render={<button type="button" />}132+ aria-expanded={expanded}133+ aria-label={`${expanded ? "Collapse tasks" : "Tasks"}: ${progress.completedSteps} of ${progress.totalSteps} complete. Current task: ${progress.step}`}134+ data-composer-tasks-badge="true"135+ onClick={onToggle}136+ onPointerDown={(event) => event.preventDefault()}137+ >138+ <TaskSummary139+ expanded={expanded}140+ progress={progress}141+ steps={steps}142+ activityStatus={activityStatus}143+ />144+ </ComposerBanner.Row>145+ );146+ return placement === "inline" ? (147+ row148+ ) : (149+ <ComposerBanner.Root className="chat-composer-shoulder-tab chat-composer-tasks-tab">@@ -3374,4 +3414,4 @@33743414 onDragOverCapture={composerMentionDragHandlers.onDragOver}33753415 onDragLeaveCapture={onComposerMentionDragLeaveCapture}33763416 onDropCapture={composerMentionDragHandlers.onDrop}3377- className={cn("mx-auto w-full min-w-0 max-w-3xl", hasShoulderTab && "pt-7")}3417+ className="mx-auto w-full min-w-0 max-w-3xl"@@ -63,18 +63,3 @@63- <button64- type="button"65- data-prompt-stash-badge="true"66- aria-label={`Stashed prompts: ${props.count}. Open stash.`}67- aria-expanded={props.menuOpen}68- className={cn(69- "chat-composer-shoulder-tab chat-composer-stash-tab absolute -top-7 right-5.5 z-0 inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-t-xl border border-b-0 px-3 pb-1 text-xs leading-none",70- "transition-[color,border-color] duration-200",71- props.menuOpen && "pointer-events-none",72- props.menuOpen || props.pulsing73- ? "text-foreground"74- : "text-muted-foreground hover:text-foreground",75- )}76- onPointerDown={(event) => {77- // Keep composer focus so Escape/typing flows stay intact.78- event.preventDefault();79- }}80- onClick={props.onToggleMenu}63+ <ComposerBanner.Root64+ width="content"65+ className="chat-composer-shoulder-tab chat-composer-stash-tab ml-auto"@@ -52,6 +49,20 @@49+ ComposerBannerStackItem,50+ "id" | "variant" | "priority" | "className"51+> & { readonly content: ReactNode };52+53+type ComposerBannerStackEntry = ComposerBannerStackItem | ComposerBannerStackContent;54+55+function bannerPriority(item: ComposerBannerStackEntry) {56+ if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {57+ return 0;58+ }59+ return item.priority === "activity" ? 1 : 2;60+}61+5262 interface ComposerBannerStackProps {5363 readonly className?: string;54- readonly items: ReadonlyArray<ComposerBannerStackItem>;64+ readonly items: ReadonlyArray<ComposerBannerStackEntry>;5565 }56665767 export function ComposerBannerStack({ className, items }: ComposerBannerStackProps) {68+ const [stackExpanded, setStackExpanded] = useState(false);
- @@ -249,9 +173,12 @@249- {step.durationMs !== undefined250- ? formatDuration(step.durationMs)251- : step.status === "inProgress"252- ? "now"253- : null}254- </span>255- </div>256- ))}257- </div>173+ <ComposerTasksBadge174+ expanded={expanded}175+ onToggle={onToggle}176+ placement="inline"177+ progress={progress}178+ steps={steps}179+ activityStatus={activityStatus}180+ />181+ {expanded ? (182+ <ComposerBanner.Scroll data-composer-tasks-scroll="true">183+ <ComposerBanner.Children184+ render={<ul />}@@ -205,17 +200,4 @@205- ) : null}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>
- apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx line 262Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -276,4 +259,4 @@276259 );277260 })}278261 </div>279- </div>262+ </ComposerBanner.Body>
- @@ -205,17 +200,4 @@205- ) : null}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>@@ -0,0 +1,17 @@1+import { mergeProps } from "@base-ui/react/merge-props";2+import { useRender } from "@base-ui/react/use-render";3+import { ChevronDownIcon, XIcon } from "lucide-react";4+import type { ComponentProps } from "react";5+6+import { cn } from "~/lib/utils";7+import { Button, buttonVariants } from "../ui/button";8+import { ScrollArea } from "../ui/scroll-area";9+10+export type ComposerBannerVariant = "default" | "error" | "info" | "success" | "warning";11+12+function Attachment({ className, ...props }: ComponentProps<"div">) {13+ return (14+ <div15+ data-slot="composer-banner-attachment"16+ className={cn(17+ "mx-auto -mb-[calc(1rem+1px)] w-[calc(100%-2.75rem)] max-w-[45.25rem]",
juliusmarminge merged this3d32797
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:
b44ec0da-f7ba-4164-b9db-44ffa1f3c6e9You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.