Skip to content

Commit a32f14e

Browse files
[Error Overlay] Fix bottom stack animation (#75867)
### Why? The bottom stack style was regressed. ![image](https://github.com/user-attachments/assets/5f7243e8-12e7-486d-a9ed-d88a8740bc46) This PR closes [NDX-808](https://linear.app/vercel/issue/NDX-808/fix-regression-in-bottom-stacks-style) --------- Co-authored-by: Jiwon Choi <[email protected]>
1 parent 4b443ec commit a32f14e

File tree

3 files changed

+27
-22
lines changed

3 files changed

+27
-22
lines changed

Diff for: packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const styles = css`
5656
}
5757
5858
/* Account for the footer height, when present */
59-
[data-nextjs-dialog-body]:has(~ [data-nextjs-dialog-footer]) {
60-
margin-bottom: calc(var(--next-dialog-footer-height) + 2px);
59+
[data-nextjs-dialog][data-has-footer='true'] [data-nextjs-dialog-body] {
60+
margin-bottom: var(--next-dialog-footer-height);
6161
}
6262
6363
[data-nextjs-dialog-content] > [data-nextjs-dialog-header] {
@@ -71,16 +71,21 @@ const styles = css`
7171
}
7272
7373
[data-nextjs-dialog-footer] {
74-
width: 100%;
75-
/* We make this element absolute to fix it to the bottom during the height transition */
76-
position: absolute;
77-
bottom: 0;
74+
/* Subtract border width */
75+
width: calc(100% - 2px);
76+
/*
77+
We make this element fixed to anchor it to the bottom during the height transition.
78+
If you make this relative it will jump during the transition and not collapse or expand smoothly.
79+
If you make this absolute it will remain stuck at its initial position when scrolling the dialog.
80+
*/
81+
position: fixed;
82+
bottom: 1px;
7883
min-height: var(--next-dialog-footer-height);
7984
border-radius: 0 0 var(--next-dialog-radius) var(--next-dialog-radius);
8085
overflow: hidden;
8186
8287
> * {
83-
height: 100%;
88+
min-height: var(--next-dialog-footer-height);
8489
}
8590
}
8691

Diff for: packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/call-stack/call-stack.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ function ChevronUpDown() {
127127

128128
export const CALL_STACK_STYLES = css`
129129
.error-overlay-call-stack-container {
130-
border-top: 1px solid var(--color-gray-400);
131130
position: relative;
132131
}
133132

Diff for: packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.tsx

+15-14
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,16 @@ export function ErrorOverlayLayout({
8080
} as React.CSSProperties,
8181
}
8282

83+
const hasFooter = Boolean(footerMessage || errorCode)
84+
8385
return (
8486
<ErrorOverlayOverlay fixed={isBuildError} {...animationProps}>
8587
<div data-nextjs-dialog-root {...animationProps}>
8688
<ErrorOverlayDialog
8789
onClose={onClose}
8890
isTurbopack={isTurbopack}
8991
dialogResizerRef={dialogResizerRef}
92+
data-has-footer={hasFooter}
9093
>
9194
<DialogContent>
9295
<ErrorOverlayFloatingHeader
@@ -110,21 +113,19 @@ export function ErrorOverlayLayout({
110113
</ErrorOverlayDialogHeader>
111114

112115
<ErrorOverlayDialogBody>{children}</ErrorOverlayDialogBody>
113-
114-
{(footerMessage || errorCode) && (
115-
<DialogFooter>
116-
<ErrorOverlayFooter
117-
footerMessage={footerMessage}
118-
errorCode={errorCode}
119-
/>
120-
</DialogFooter>
121-
)}
122-
123-
<ErrorOverlayBottomStack
124-
count={readyErrors?.length ?? 0}
125-
activeIdx={activeIdx ?? 0}
126-
/>
127116
</DialogContent>
117+
{hasFooter && (
118+
<DialogFooter>
119+
<ErrorOverlayFooter
120+
footerMessage={footerMessage}
121+
errorCode={errorCode}
122+
/>
123+
</DialogFooter>
124+
)}
125+
<ErrorOverlayBottomStack
126+
count={readyErrors?.length ?? 0}
127+
activeIdx={activeIdx ?? 0}
128+
/>
128129
</ErrorOverlayDialog>
129130
</div>
130131
</ErrorOverlayOverlay>

0 commit comments

Comments
 (0)