Skip to content

Commit 986ceec

Browse files
authored
fix(stories): improve loading/error layout (#95171)
Adjust stories layout when in a loading/error state. **Before** No screenshots, but the spinner and error were crammed in the lower right corner of the page **After** <img width="1944" alt="layout-loading" src="https://github.com/user-attachments/assets/db902b59-ce85-48b1-ada5-f435b49c0c3f" /> <img width="1943" alt="layout-error" src="https://github.com/user-attachments/assets/97e9c9ef-8571-4f63-9fe7-1f745739507e" />
1 parent 09c33f1 commit 986ceec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

static/app/stories/view/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export default function Stories() {
4242
<StorySidebar />
4343

4444
{story.isLoading ? (
45-
<VerticalScroll style={{gridArea: 'body'}}>
45+
<VerticalScroll>
4646
<LoadingIndicator />
4747
</VerticalScroll>
4848
) : story.isError ? (
49-
<VerticalScroll style={{gridArea: 'body'}}>
49+
<VerticalScroll>
5050
<Alert.Container>
5151
<Alert type="error" showIcon>
5252
<strong>{story.error.name}:</strong> {story.error.message}
@@ -60,7 +60,7 @@ export default function Stories() {
6060
})}
6161
</StoryMainContainer>
6262
) : (
63-
<VerticalScroll style={{gridArea: 'body'}}>
63+
<VerticalScroll>
6464
<strong>The file you selected does not export a story.</strong>
6565
</VerticalScroll>
6666
)}
@@ -98,6 +98,10 @@ const HeaderContainer = styled('header')`
9898
const VerticalScroll = styled('main')`
9999
overflow-x: visible;
100100
overflow-y: auto;
101+
102+
grid-row: 1;
103+
grid-column: 2;
104+
padding: ${space(2)};
101105
`;
102106

103107
const StoryMainContainer = styled('div')`

0 commit comments

Comments
 (0)