File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { useAtomValue } from "@effect/atom-react" ;
2+ import { Undo2Icon } from "lucide-react" ;
23import { useState } from "react" ;
34
45import {
@@ -29,8 +30,11 @@ export function SidebarThreadUndoNotice() {
2930 if ( ! text ) return null ;
3031
3132 return (
32- // No min-w-0: the undo button sets this item's minimum, so a shared row squeezes its neighbour.
33- < SidebarMenuItem className = "flex 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 ) ;
@@ -43,7 +47,14 @@ export function SidebarThreadUndoNotice() {
4347 ! summary && "opacity-0" ,
4448 ) }
4549 >
46- < InlineButton onClick = { undoLatestThreadAction } > { threadUndoLabel ( keybindings ) } </ InlineButton >
50+ < InlineButton className = "min-w-0 shrink" onClick = { undoLatestThreadAction } >
51+ { /* The icon's negative margin cancels its width, so beside the label it sits in
52+ clipped space; once the label is too wide it wraps away and the icon shows. */ }
53+ < span className = "flex h-6 min-w-0 flex-wrap justify-end overflow-hidden" >
54+ < Undo2Icon className = "-ml-4 h-6 w-4 @max-[1rem]:invisible" />
55+ < span > { threadUndoLabel ( keybindings ) } </ span >
56+ </ span >
57+ </ InlineButton >
4758 < span > { text } ,</ span >
4859 </ div >
4960 </ SidebarMenuItem >
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ function SidebarUpdateControl() {
422422 ? { status : "downloading" , percent : state . downloadPercent }
423423 : { status : "waiting" } ;
424424 return (
425- < SidebarMenuItem className = "ml-auto flex min-w-0 flex-1" >
425+ < SidebarMenuItem className = "ml-auto flex flex-1" >
426426 < SidebarUpdateCapsule
427427 run = { run }
428428 local = { local }
You can’t perform that action at this time.
0 commit comments