Skip to content

Commit fcc1f65

Browse files
Nicholas Wasmillerclaude
andcommitted
fix(web): the update capsule's action stays inside the sidebar beside the undo notice
At the minimum sidebar width the undo notice and the update capsule split the row evenly, which left the capsule narrower than its Later/Retry/Dismiss button. The capsule's minimum is now its action, so the notice gives way, and the notice's icon hides when it has no room for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 38fbaf0 commit fcc1f65

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ export function SidebarThreadUndoNotice() {
3030
if (!text) return null;
3131

3232
return (
33-
<SidebarMenuItem className="flex min-w-0 flex-1" aria-hidden={!summary} inert={!summary}>
33+
<SidebarMenuItem
34+
className="@container flex min-w-0 flex-1"
35+
aria-hidden={!summary}
36+
inert={!summary}
37+
>
3438
<div
3539
onTransitionEnd={(event) => {
3640
if (!summary && event.target === event.currentTarget) setShownSummary(null);
@@ -47,7 +51,7 @@ export function SidebarThreadUndoNotice() {
4751
{/* The icon's negative margin cancels its width, so beside the label it sits in
4852
clipped space; once the label is too wide it wraps away and the icon shows. */}
4953
<span className="flex h-6 min-w-0 flex-wrap justify-end overflow-hidden">
50-
<Undo2Icon className="-ml-4 h-6 w-4" />
54+
<Undo2Icon className="-ml-4 h-6 w-4 @max-[1rem]:invisible" />
5155
<span>{threadUndoLabel(keybindings)}</span>
5256
</span>
5357
</InlineButton>

‎apps/web/src/components/sidebar/SidebarUpdateCapsule.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function SidebarUpdateCapsule({
8888
<Popover>
8989
<div
9090
className={cn(
91-
"relative flex h-8 min-w-0 flex-1 items-center rounded-full bg-sidebar-control-surface text-sidebar-foreground",
91+
"relative flex h-8 flex-1 items-center rounded-full bg-sidebar-control-surface text-sidebar-foreground",
9292
view.tone === "slow" && "ring-1 ring-warning/40 ring-inset",
9393
view.tone === "failed" && "ring-1 ring-destructive/40 ring-inset",
9494
)}
@@ -104,7 +104,9 @@ export function SidebarUpdateCapsule({
104104
/>
105105
}
106106
/>
107-
<span className="pointer-events-none relative min-w-0 flex-1 truncate pl-3 text-xs">
107+
{/* w-0 keeps the label out of the capsule's minimum width, so a shared footer row
108+
can squeeze the label but never push the action past the sidebar edge. */}
109+
<span className="pointer-events-none relative w-0 min-w-0 flex-1 truncate pl-3 text-xs">
108110
<span className={cn(view.tone === "failed" && "text-destructive")}>{view.label}</span>
109111
{view.slow ? (
110112
<span className="text-warning tabular-nums"> {view.slow.elapsed}</span>

‎apps/web/src/components/sidebar/SidebarUpdatePill.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ function SidebarUpdateControl() {
413413
? { status: "downloading", percent: state.downloadPercent }
414414
: { status: "waiting" };
415415
return (
416-
<SidebarMenuItem className="ml-auto flex min-w-0 flex-1">
416+
<SidebarMenuItem className="ml-auto flex flex-1">
417417
<SidebarUpdateCapsule
418418
run={run}
419419
local={local}

0 commit comments

Comments
 (0)