The best way to control Claude Code, Codex and more from any computer or phone
fix(web): undo notice moves to the sidebar footer so it never covers a thread (#26874)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 29, 2026 at 02:17 UTC
35b298a159e14b3cdfd7384de3eb009bb73d3110
5 files changed
+31
-40
apps/web/src/components/Sidebar.tsx
+1
-8
@@ -3371,7 +3371,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3371
className="mt-auto"
3372
label="Working"
3373
count={workingThreads.length}
3374
- hostsUndoNotice
3374
toggle={{
3375
expanded: workingShelfExpanded,
3376
onToggle: toggleWorkingShelf,
@@ -3387,7 +3386,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3386
className={cn(workingThreads.length === 0 && "mt-auto")}
3387
label="Snoozed"
3388
count={snoozedThreads.length}
3390
- hostsUndoNotice={workingThreads.length === 0}
3389
toggle={{
3390
expanded: snoozedShelfExpanded,
3391
onToggle: toggleSnoozedShelf,
@@ -3405,9 +3403,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3403
)}
3404
label="Settled"
3405
count={settledCount}
3408
- hostsUndoNotice={
3409
- workingThreads.length + snoozedThreads.length === 0
3410
- }
3406
dragging={from !== null}
3407
isDropTarget={dragTargetSection === "settled"}
3408
toggle={{
@@ -3502,9 +3497,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
3497
) : null}
3498
</SidebarGroup>
3499
</SidebarContent>
3505
- <SidebarChromeFooter
3506
- showUndoNotice={isSearchingThreads || sidebarListItemsFresh.length === 0}
3507
- />
3500
+ <SidebarChromeFooter />
3501
</>
3502
);
3503
}
apps/web/src/components/sidebar/SidebarChrome.tsx
+2
-6
@@ -223,19 +223,15 @@ const SidebarUtilityMenu = memo(function SidebarUtilityMenu() {
223
/>
224
</>
225
)}
226
+ <SidebarThreadUndoNotice />
227
<SidebarUpdatePill />
228
</SidebarMenu>
229
);
230
});
231
231
-export const SidebarChromeFooter = memo(function SidebarChromeFooter({
232
- showUndoNotice = false,
233
-}: {
234
- showUndoNotice?: boolean;
235
-}) {
232
+export const SidebarChromeFooter = memo(function SidebarChromeFooter() {
233
return (
234
<SidebarFooter>
238
- {showUndoNotice ? <SidebarThreadUndoNotice /> : null}
235
<SidebarProviderUpdatePill />
236
<SidebarUpdateArchitectureWarning />
237
<SidebarUtilityMenu />
apps/web/src/components/sidebar/SidebarListMarkers.tsx
-6
@@ -9,7 +9,6 @@ import {
9
type SidebarListMarker,
10
} from "../Sidebar.logic";
11
import { SIDEBAR_SORTABLE_DRAG_DISABLED } from "./SidebarThreadRow";
12
-import { SidebarThreadUndoNotice } from "./SidebarThreadUndoNotice";
12
13
function SortableSidebarMarker(props: {
14
marker: SidebarListMarker;
@@ -117,8 +116,6 @@ export function SidebarSectionHeader(props: {
116
dragging?: boolean;
117
isDropTarget?: boolean;
118
toggle: { expanded: boolean; onToggle: () => void };
120
- /** The first shelf at the bottom of the list hosts the undo notice just above itself. */
121
- hostsUndoNotice?: boolean;
119
}) {
120
const shelf =
121
props.marker === "working-header"
@@ -132,9 +129,6 @@ export function SidebarSectionHeader(props: {
129
data-testid={`sidebar-${props.marker}`}
130
className={cn("relative mx-0.5 h-8", props.className)}
131
>
135
- {props.hostsUndoNotice ? (
136
- <SidebarThreadUndoNotice className="absolute inset-x-0 bottom-full bg-sidebar surface-grain" />
137
- ) : null}
132
<CollapsibleSectionHeader
133
role="treeitem"
134
tabIndex={-1}
apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx
+27
-19
@@ -3,18 +3,24 @@ import { useState } from "react";
3
4
import {
5
threadUndoLabel,
6
- threadUndoNoticeSummary,
6
undoLatestThreadAction,
7
useThreadUndoNotice,
8
} from "../../hooks/showThreadUndoNotice";
9
import { cn } from "../../lib/utils";
10
import { primaryServerKeybindingsAtom } from "../../state/server";
11
import { InlineButton } from "../ui/button";
12
+import { SidebarMenuItem } from "../ui/sidebar";
13
14
-export function SidebarThreadUndoNotice({ className }: { className?: string }) {
14
+/** Fills the free space in the sidebar footer's utility row, so it never moves or covers the list. */
15
+export function SidebarThreadUndoNotice() {
16
const notice = useThreadUndoNotice((state) => state.notice);
17
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
17
- const summary = notice ? threadUndoNoticeSummary(notice) : null;
18
+ // Short enough to fit beside the utility icons; screen readers hear the full summary.
19
+ const summary = notice
20
+ ? notice.count === 1
21
+ ? notice.action
22
+ : `${notice.action} ${notice.count}`
23
+ : null;
24
25
// Keeps the last text on screen while it fades out, then unmounts on transitionend.
26
const [shownSummary, setShownSummary] = useState(summary);
@@ -23,21 +29,23 @@ export function SidebarThreadUndoNotice({ className }: { className?: string }) {
29
if (!text) return null;
30
31
return (
26
- <div
27
- role="group"
28
- aria-hidden={!summary}
29
- inert={!summary}
30
- onTransitionEnd={(event) => {
31
- if (!summary && event.target === event.currentTarget) setShownSummary(null);
32
- }}
33
- className={cn(
34
- "flex gap-1 px-2 text-2xs leading-6 text-sidebar-muted-foreground transition-opacity duration-200 ease-out starting:opacity-0",
35
- !summary && "opacity-0",
36
- className,
37
- )}
38
- >
39
- <span className="min-w-0 truncate">{text},</span>
40
- <InlineButton onClick={undoLatestThreadAction}>{threadUndoLabel(keybindings)}</InlineButton>
41
- </div>
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}>
34
+ <div
35
+ onTransitionEnd={(event) => {
36
+ if (!summary && event.target === event.currentTarget) setShownSummary(null);
37
+ }}
38
+ // Reversed wrap: a summary that does not fit beside the undo button drops to a
39
+ // second line that overflow hides, instead of truncating mid-word. Browse mode
40
+ // reads the button first; the live announcement carries the full sentence.
41
+ className={cn(
42
+ "flex h-6 min-w-0 flex-1 flex-row-reverse flex-wrap gap-x-1 overflow-hidden text-2xs leading-6 whitespace-nowrap text-sidebar-muted-foreground transition-opacity duration-200 ease-out starting:opacity-0",
43
+ !summary && "opacity-0",
44
+ )}
45
+ >
46
+ <InlineButton onClick={undoLatestThreadAction}>{threadUndoLabel(keybindings)}</InlineButton>
47
+ <span>{text},</span>
48
+ </div>
49
+ </SidebarMenuItem>
50
);
51
}
apps/web/src/hooks/showThreadUndoNotice.ts
+1
-1
@@ -28,7 +28,7 @@ type UndoNotice = {
28
29
export const useThreadUndoNotice = create<{ notice: UndoNotice | null }>(() => ({ notice: null }));
30
31
-export function threadUndoNoticeSummary(notice: Pick<UndoNotice, "action" | "count">): string {
31
+function threadUndoNoticeSummary(notice: Pick<UndoNotice, "action" | "count">): string {
32
const noun = notice.action === "Discarded" ? "draft" : "thread";
33
return `${notice.action} ${notice.count} ${noun}${notice.count === 1 ? "" : "s"}`;
34
}