The best way to control Claude Code, Codex and more from any computer or phone
fix(web): expanding stacked notices no longer scrolls a working thread (#20086)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Derek Trimm committed
Oct 19, 2026 at 23:17 UTC
48fcf90f1ede5ab306e781f0e3e3c594a6ab3d31
4 files changed
+48
-3
apps/web/src/components/ChatView.tsx
+12
-1
@@ -4668,11 +4668,22 @@ export default function ChatView(props: ChatViewProps) {
4668
modelStrip.offsetHeight + Number.parseFloat(getComputedStyle(modelStrip).marginTop),
4669
)
4670
: 0;
4671
+ const noticeStack = composerOverlayElement?.querySelector<HTMLElement>(
4672
+ '[data-composer-banner-stack="true"]',
4673
+ );
4674
+ const expandedNoticesHeight = noticeStack
4675
+ ? Math.max(
4676
+ 0,
4677
+ noticeStack.getBoundingClientRect().height -
4678
+ Number.parseFloat(getComputedStyle(noticeStack).minHeight),
4679
+ )
4680
+ : 0;
4681
const nextInset = resolveComposerTimelineInset({
4682
currentInset: composerTimelineInsetRef.current,
4673
- overlayHeight: nextHeight,
4683
+ overlayHeight: height,
4684
isResting,
4685
restingOnlyHeight,
4686
+ expandedNoticesHeight,
4687
});
4688
if (composerTimelineInsetRef.current !== nextInset) {
4689
composerTimelineInsetRef.current = nextInset;
apps/web/src/components/chat/ComposerBannerStack.tsx
+1
@@ -121,6 +121,7 @@ export function ComposerBannerStack({ className, items, attachedAbove }: Compose
121
{hasStack ? (
122
<div
123
ref={noticesRef}
124
+ data-composer-banner-stack="true"
125
data-chat-composer-collapsed-controls="true"
126
className={cn("relative z-20 min-h-3", stackExpanded && "z-50")}
127
onPointerEnter={(event) => {
apps/web/src/components/composerFooterLayout.test.ts
+29
@@ -140,6 +140,35 @@ describe("resolveComposerTimelineInset", () => {
140
resolveComposerTimelineInset({ currentInset: 0, overlayHeight: 60, isResting: true }),
141
).toBe(60 + COMPOSER_RESTING_EXPANSION_MIN_PX);
142
});
143
+
144
+ it("keeps the timeline reservation stable through notice expansion and collapse", () => {
145
+ const collapsed = resolveComposerTimelineInset({
146
+ currentInset: 0,
147
+ overlayHeight: 172,
148
+ isResting: false,
149
+ });
150
+ const expanded = resolveComposerTimelineInset({
151
+ currentInset: collapsed,
152
+ overlayHeight: 532,
153
+ isResting: false,
154
+ expandedNoticesHeight: 360,
155
+ });
156
+ expect(expanded).toBe(collapsed);
157
+ const resting = resolveComposerTimelineInset({
158
+ currentInset: expanded,
159
+ overlayHeight: 470,
160
+ isResting: true,
161
+ expandedNoticesHeight: 360,
162
+ });
163
+ expect(resting).toBe(collapsed);
164
+ expect(
165
+ resolveComposerTimelineInset({
166
+ currentInset: resting,
167
+ overlayHeight: 110,
168
+ isResting: true,
169
+ }),
170
+ ).toBe(collapsed);
171
+ });
172
});
173
174
describe("shouldUseRestingComposerLayout", () => {
apps/web/src/components/composerFooterLayout.ts
+6
-2
@@ -59,16 +59,20 @@ export function resolveComposerTimelineInset(input: {
59
overlayHeight: number;
60
isResting: boolean;
61
restingOnlyHeight?: number;
62
+ expandedNoticesHeight?: number;
63
}): number {
64
+ // Expanded notices temporarily cover the timeline. Remove their growth before
65
+ // rounding so fractional measurements reserve exactly the collapsed height.
66
+ const overlayHeight = Math.ceil(input.overlayHeight - (input.expandedNoticesHeight ?? 0));
67
return input.isResting
68
? Math.max(
69
input.currentInset,
66
- input.overlayHeight +
70
+ overlayHeight +
71
(input.currentInset === 0
72
? COMPOSER_RESTING_EXPANSION_MIN_PX - (input.restingOnlyHeight ?? 0)
73
: 0),
74
)
71
- : input.overlayHeight;
75
+ : overlayHeight;
76
}
77
78
export function overlayComposerIsResting(input: {