Skip to content

Commit 328974b

Browse files
gregbergeclaude
andauthored
fix(frontend): size text snapshot editor to content (ARG-454) (#2350)
The single text/ARIA snapshot editor sits in a row flex container whose default `align-items: stretch` stretched the bordered viewer to the full panel height, leaving a large empty box for short snapshots. Wrap it in a `w-full self-start` div so it sizes to its content; the outer panel is already `overflow-y-auto`, so tall snapshots still scroll. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0810fca commit 328974b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

apps/frontend/src/containers/Build/BuildDiffDetail.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,11 +1508,17 @@ type SnapshotProps = { url: string; contentType: string };
15081508

15091509
function SuspendedSnapshot(props: SnapshotProps) {
15101510
const [text] = useTextContent([props.url]);
1511+
// Size the editor to its content instead of stretching to fill the flex row:
1512+
// `self-start` opts out of the row's default `align-items: stretch` so a short
1513+
// snapshot (e.g. a one-line ARIA tree) stays short, while the outer panel
1514+
// (`overflow-y-auto`) scrolls when the content is tall.
15111515
return (
1512-
<Editor
1513-
value={text}
1514-
language={getLanguageFromContentType(props.contentType)}
1515-
/>
1516+
<div className="w-full self-start">
1517+
<Editor
1518+
value={text}
1519+
language={getLanguageFromContentType(props.contentType)}
1520+
/>
1521+
</div>
15161522
);
15171523
}
15181524

0 commit comments

Comments
 (0)