fix: expand final SQL to session panel width

This commit is contained in:
2026-07-23 15:44:16 +02:00
parent 4108b99405
commit 9b5fca59e8
2 changed files with 17 additions and 2 deletions
@@ -38,6 +38,15 @@ test("renders the document titles from the API", async () => {
expect(screen.getByRole("heading", { name: "Final SQL" })).toBeInTheDocument(); expect(screen.getByRole("heading", { name: "Final SQL" })).toBeInTheDocument();
}); });
test("lets the Final SQL document use the full resized panel width", async () => {
wrap(<SessionDocumentsPanel session={base} onClose={vi.fn()} onResume={vi.fn()} desktopSplit />);
const sqlSection = (await screen.findByRole("heading", { name: "Final SQL" })).closest("section");
expect(sqlSection).toHaveClass("w-full");
expect(sqlSection?.parentElement).toHaveClass("w-full");
expect(sqlSection?.parentElement).not.toHaveClass("max-w-[76ch]");
});
test("shows Resume for resumable, hides it for finalized", async () => { test("shows Resume for resumable, hides it for finalized", async () => {
const { rerender } = wrap(<SessionDocumentsPanel session={base} onClose={vi.fn()} onResume={vi.fn()} />); const { rerender } = wrap(<SessionDocumentsPanel session={base} onClose={vi.fn()} onResume={vi.fn()} />);
expect(await screen.findByRole("button", { name: /resume/i })).toBeInTheDocument(); expect(await screen.findByRole("button", { name: /resume/i })).toBeInTheDocument();
+8 -2
View File
@@ -183,9 +183,15 @@ export function SessionDocumentsPanel({ session, onClose, onResume, desktopSplit
{isLoading ? ( {isLoading ? (
<p className="text-xs text-muted-foreground">Loading…</p> <p className="text-xs text-muted-foreground">Loading…</p>
) : ( ) : (
<div className="flex max-w-[76ch] flex-col gap-7"> <div className="flex w-full flex-col gap-7">
{docs.map((doc, idx) => ( {docs.map((doc, idx) => (
<section key={doc.key} className={idx > 0 ? "border-t border-border/50 pt-7" : ""}> <section
key={doc.key}
className={[
doc.format === "sql" ? "w-full" : "max-w-[76ch]",
idx > 0 ? "border-t border-border/50 pt-7" : "",
].join(" ")}
>
<div className="mb-3 flex items-center gap-2"> <div className="mb-3 flex items-center gap-2">
<h3 className="thot-label"> <h3 className="thot-label">
{doc.title} {doc.title}