From b1cd0551c99462ba1228b3d3a665e89807815780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= <16311043+immakermatty@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:09:03 +0000 Subject: [PATCH 1/4] feat(web): a narrow window shows the rail only beside the open left panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Below 768 px, where T3's left panel is a sheet, the conversation takes the whole width and the Lazurio rail is hidden. Opening the left panel brings the rail in beside it: the panel moves aside by the rail's width and the rail slides in with it (none with reduced motion). The wide layout is unchanged. CSS only, in index.html; the contract test guards the rule and T3's breakpoint. Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread b2963c0a-0588-4dde-8ece-390971647afc Co-Authored-By: Claude Opus 5.5 --- apps/web/index.html | 34 +++++++++++++++++++++++ docs/operations/lazurio-fork-release.md | 6 ++++ scripts/lazurio-release-contract.test.mjs | 16 +++++++++++ 3 files changed, 56 insertions(+) diff --git a/apps/web/index.html b/apps/web/index.html index b72a9d3d7d106..670d7013e1c7d 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -714,6 +714,40 @@ background-repeat: repeat; background-size: var(--surface-grain-size); } + /* A narrow window, where T3's left panel is a sheet (sidebar.tsx, SIDEBAR_MOBILE_QUERY): the + conversation takes the whole width and the rail stands only beside the open panel, which + moves aside for it. The rail slides with the panel. */ + @media (max-width: 767px) { + #root { + padding-left: 0; + } + lazurio-rail:defined { + visibility: hidden; + transform: translateX(-100%); + transition: + transform 200ms ease-in-out, + visibility 0s linear 200ms; + } + body:has([data-mobile="true"][data-sidebar="sidebar"][data-open]) > lazurio-rail:defined { + z-index: calc(var(--z-sheet) + 1); + visibility: visible; + transform: none; + transition: transform 200ms ease-in-out; + } + lazurio-rail:defined + ~ * + [data-slot="sheet-viewport"]:has(> [data-mobile="true"][data-sidebar="sidebar"]) { + padding-left: var(--lazurio-rail-width, 0px); + } + lazurio-rail:defined ~ * [data-mobile="true"][data-sidebar="sidebar"] { + width: calc(100vw - var(--lazurio-rail-width, 0px) - var(--spacing) * 3); + } + } + @media (max-width: 767px) and (prefers-reduced-motion: reduce) { + body > lazurio-rail:defined { + transition: none !important; + } + } diff --git a/docs/operations/lazurio-fork-release.md b/docs/operations/lazurio-fork-release.md index 39562fd693429..ae6b70f5a3037 100644 --- a/docs/operations/lazurio-fork-release.md +++ b/docs/operations/lazurio-fork-release.md @@ -508,6 +508,12 @@ Slot jsou dva upstream soubory, každý jako vlastní řádek v nechalo pod railem. Proto se při definovaném railu stane obal sidebaru (`[data-slot="sidebar-wrapper"]`) jejich containing blockem (`contain: layout paint`). Bez shellu pravidlo neplatí. + V úzkém okně (pod 768 px, kdy je levý panel T3 modální sheet, `SIDEBAR_MOBILE_QUERY` + v `sidebar.tsx`) má rozhovor celou šířku a rail není vidět; ukáže se, až když člověk otevře + levý panel, a panel se mu odsune o šířku railu. Rail přitom vyjede spolu s panelem + (200 ms, bez pohybu při omezeném pohybu). Jen CSS v `index.html`; široké rozložení se nemění. + Při otevřeném panelu nese rail `aria-hidden` od modálního sheetu T3 a klávesnice z panelu na + rail nepřejde (stejně jako dosud, kdy ho panel překrýval); ukazatel i dotyk na něm fungují. Buddyho spouštěč začíná 22 px od pravého a dolního okraje okna a uživatel ho přetáhne kamkoli (LazurioPlatform F60, dodatek z 2026-11-14). Composer Chatu proto zůstává tam, kde ho kreslí T3, a `--lazurio-buddy-clearance` nečte; kontraktní test hlídá, že se pravidlo nevrátí. diff --git a/scripts/lazurio-release-contract.test.mjs b/scripts/lazurio-release-contract.test.mjs index 93546a0737f6c..7fa5b847dfebe 100644 --- a/scripts/lazurio-release-contract.test.mjs +++ b/scripts/lazurio-release-contract.test.mjs @@ -1387,6 +1387,22 @@ NodeTest.test("the Lazurio shell slot survives a rebuild on a new upstream tag", /lazurio-rail:defined ~ #root \[data-slot="sidebar-wrapper"\] \{\s*contain: layout paint;\s*\}/, ); NodeAssert.match(sidebarUi, /data-slot="sidebar-wrapper"/); + // A narrow window: the conversation takes the whole width without the rail, and the rail stands + // beside the open left panel, which moves aside for it. The breakpoint is T3's own for its sheet. + const narrow = page.match(/@media \(max-width: 767px\) \{([\s\S]*?)\n \}\n/)?.[1] ?? ""; + NodeAssert.match(sidebarUi, /const SIDEBAR_MOBILE_QUERY = "\(max-width: 767px\)";/); + NodeAssert.match(sidebarUi, /data-mobile="true"\s*data-sidebar="sidebar"/); + NodeAssert.match(narrow, /#root \{\s*padding-left: 0;\s*\}/); + NodeAssert.match(narrow, /lazurio-rail:defined \{\s*visibility: hidden;/); + NodeAssert.match( + narrow, + /body:has\(\[data-mobile="true"\]\[data-sidebar="sidebar"\]\[data-open\]\) > lazurio-rail:defined \{\s*z-index: calc\(var\(--z-sheet\) \+ 1\);\s*visibility: visible;/, + ); + NodeAssert.match(narrow, /padding-left: var\(--lazurio-rail-width, 0px\);/); + NodeAssert.ok( + page.indexOf("@media (max-width: 767px)") > page.search(/#root \{\s*box-sizing: border-box;/), + "the narrow rule follows the rail's padding, so it wins", + ); NodeAssert.match( page, /\s*<\/lazurio-rail>\s*
/, From c3e33da1a55e14220fa2a2423e6882b2bbeab63b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= <16311043+immakermatty@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:31:25 +0000 Subject: [PATCH 2/4] fix(web): the narrow rail lives inside the open panel, reachable by keyboard and screen readers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit T3's left panel in a narrow window is a modal sheet: it keeps the focus inside and marks the rest of the page aria-hidden, so a rail beside it was out of reach for the keyboard and screen readers. A short script in index.html's head moves the rail into the panel, as its first child, while the panel is on the page, and back before #root once it is gone, where it stays the jump's target. The panel leaves room for it. The sidebar wrapper stays contained while the rail is not #root's sibling, so T3's fixed controls stay below the panel. Agent: environment a480495c-25e0-4e51-828b-1dbf1b77d62f · T3 thread b2963c0a-0588-4dde-8ece-390971647afc Co-Authored-By: Claude Opus 5.5 --- apps/web/index.html | 65 ++++++++++++++--------- docs/operations/lazurio-fork-release.md | 11 ++-- scripts/lazurio-release-contract.test.mjs | 25 +++++++-- 3 files changed, 66 insertions(+), 35 deletions(-) diff --git a/apps/web/index.html b/apps/web/index.html index 670d7013e1c7d..91548487d3b1e 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -714,41 +714,56 @@ background-repeat: repeat; background-size: var(--surface-grain-size); } - /* A narrow window, where T3's left panel is a sheet (sidebar.tsx, SIDEBAR_MOBILE_QUERY): the - conversation takes the whole width and the rail stands only beside the open panel, which - moves aside for it. The rail slides with the panel. */ + /* A narrow window, where T3's left panel is a modal sheet (sidebar.tsx, SIDEBAR_MOBILE_QUERY): + the conversation takes the whole width without the rail, and the open panel carries the + rail at its left edge. The script below moves the rail into the panel while it is open, so + the rail is part of the dialog for the keyboard and screen readers and slides with it. */ @media (max-width: 767px) { #root { padding-left: 0; } - lazurio-rail:defined { - visibility: hidden; - transform: translateX(-100%); - transition: - transform 200ms ease-in-out, - visibility 0s linear 200ms; + body > lazurio-rail:defined { + display: none; } - body:has([data-mobile="true"][data-sidebar="sidebar"][data-open]) > lazurio-rail:defined { - z-index: calc(var(--z-sheet) + 1); - visibility: visible; - transform: none; - transition: transform 200ms ease-in-out; + /* The rail is no longer #root's sibling while it is in the panel; T3's fixed controls stay + contained all the same, below the panel. */ + :root:has(lazurio-rail:defined) #root [data-slot="sidebar-wrapper"] { + contain: layout paint; } - lazurio-rail:defined - ~ * - [data-slot="sheet-viewport"]:has(> [data-mobile="true"][data-sidebar="sidebar"]) { + [data-mobile="true"][data-sidebar="sidebar"]:has(> lazurio-rail:defined) { padding-left: var(--lazurio-rail-width, 0px); } - lazurio-rail:defined ~ * [data-mobile="true"][data-sidebar="sidebar"] { - width: calc(100vw - var(--lazurio-rail-width, 0px) - var(--spacing) * 3); - } - } - @media (max-width: 767px) and (prefers-reduced-motion: reduce) { - body > lazurio-rail:defined { - transition: none !important; - } } + diff --git a/docs/operations/lazurio-fork-release.md b/docs/operations/lazurio-fork-release.md index ae6b70f5a3037..a627c96cfcc9d 100644 --- a/docs/operations/lazurio-fork-release.md +++ b/docs/operations/lazurio-fork-release.md @@ -509,11 +509,12 @@ Slot jsou dva upstream soubory, každý jako vlastní řádek v (`[data-slot="sidebar-wrapper"]`) jejich containing blockem (`contain: layout paint`). Bez shellu pravidlo neplatí. V úzkém okně (pod 768 px, kdy je levý panel T3 modální sheet, `SIDEBAR_MOBILE_QUERY` - v `sidebar.tsx`) má rozhovor celou šířku a rail není vidět; ukáže se, až když člověk otevře - levý panel, a panel se mu odsune o šířku railu. Rail přitom vyjede spolu s panelem - (200 ms, bez pohybu při omezeném pohybu). Jen CSS v `index.html`; široké rozložení se nemění. - Při otevřeném panelu nese rail `aria-hidden` od modálního sheetu T3 a klávesnice z panelu na - rail nepřejde (stejně jako dosud, kdy ho panel překrýval); ukazatel i dotyk na něm fungují. + v `sidebar.tsx`) má rozhovor celou šířku a rail není vidět. Ukáže se, až člověk otevře levý + panel: krátký skript v hlavičce `index.html` přesune rail do otevřeného panelu jako jeho první + prvek a panel mu nechá místo. Rail je tak součástí dialogu: klávesnice na něj dojde Tabem + a čtečka ho čte, i když modální sheet zbytek stránky skryje (`aria-hidden`) a drží fokus v sobě. + Po zavření panelu se rail vrátí před `#root`, kde zůstává cílem skoku ⌘⇧E. Široké rozložení + se nemění. Buddyho spouštěč začíná 22 px od pravého a dolního okraje okna a uživatel ho přetáhne kamkoli (LazurioPlatform F60, dodatek z 2026-11-14). Composer Chatu proto zůstává tam, kde ho kreslí T3, a `--lazurio-buddy-clearance` nečte; kontraktní test hlídá, že se pravidlo nevrátí. diff --git a/scripts/lazurio-release-contract.test.mjs b/scripts/lazurio-release-contract.test.mjs index 7fa5b847dfebe..6f585618083db 100644 --- a/scripts/lazurio-release-contract.test.mjs +++ b/scripts/lazurio-release-contract.test.mjs @@ -1387,22 +1387,37 @@ NodeTest.test("the Lazurio shell slot survives a rebuild on a new upstream tag", /lazurio-rail:defined ~ #root \[data-slot="sidebar-wrapper"\] \{\s*contain: layout paint;\s*\}/, ); NodeAssert.match(sidebarUi, /data-slot="sidebar-wrapper"/); - // A narrow window: the conversation takes the whole width without the rail, and the rail stands - // beside the open left panel, which moves aside for it. The breakpoint is T3's own for its sheet. + // A narrow window: the conversation takes the whole width without the rail, and the open left + // panel (T3's modal sheet) carries the rail inside it, so the dialog's focus trap and its + // aria-hidden on the page outside leave the rail reachable. The breakpoint and the sheet's + // attributes are T3's own. const narrow = page.match(/@media \(max-width: 767px\) \{([\s\S]*?)\n \}\n/)?.[1] ?? ""; NodeAssert.match(sidebarUi, /const SIDEBAR_MOBILE_QUERY = "\(max-width: 767px\)";/); NodeAssert.match(sidebarUi, /data-mobile="true"\s*data-sidebar="sidebar"/); NodeAssert.match(narrow, /#root \{\s*padding-left: 0;\s*\}/); - NodeAssert.match(narrow, /lazurio-rail:defined \{\s*visibility: hidden;/); + NodeAssert.match(narrow, /body > lazurio-rail:defined \{\s*display: none;\s*\}/); NodeAssert.match( narrow, - /body:has\(\[data-mobile="true"\]\[data-sidebar="sidebar"\]\[data-open\]\) > lazurio-rail:defined \{\s*z-index: calc\(var\(--z-sheet\) \+ 1\);\s*visibility: visible;/, + /:root:has\(lazurio-rail:defined\) #root \[data-slot="sidebar-wrapper"\] \{\s*contain: layout paint;\s*\}/, + ); + NodeAssert.match( + narrow, + /\[data-mobile="true"\]\[data-sidebar="sidebar"\]:has\(> lazurio-rail:defined\) \{\s*padding-left: var\(--lazurio-rail-width, 0px\);\s*\}/, ); - NodeAssert.match(narrow, /padding-left: var\(--lazurio-rail-width, 0px\);/); NodeAssert.ok( page.indexOf("@media (max-width: 767px)") > page.search(/#root \{\s*box-sizing: border-box;/), "the narrow rule follows the rail's padding, so it wins", ); + const mover = + page.match(/ diff --git a/apps/web/src/lazurio/narrowRail.browser.test.tsx b/apps/web/src/lazurio/narrowRail.browser.test.tsx new file mode 100644 index 0000000000000..1fceeb87ef514 --- /dev/null +++ b/apps/web/src/lazurio/narrowRail.browser.test.tsx @@ -0,0 +1,178 @@ +import { page, userEvent } from "vite-plus/test/browser"; +import { describe, expect, it } from "vite-plus/test"; + +import indexHtml from "../../index.html?raw"; +import { render } from "../../test/render"; +import { Sidebar, SidebarProvider, SidebarTrigger } from "../components/ui/sidebar"; + +// The rail in a narrow window (index.html, the Lazurio shell slot): hidden beside the +// conversation, inside T3's open left panel, and shown wherever it stands while a dialog of its +// own is open. The style and the script are index.html's own; the rail is a stand-in with the +// shape the shell's `` has: an open shadow root, a control and a dialog. + +const narrowStyle = (() => { + const match = indexHtml.match(/\n(\s*\/\* A narrow window[\s\S]*?)\n\s*<\/style>/); + if (!match?.[1]) throw new Error("Could not find the narrow rail style in index.html"); + return match[1]; +})(); +const moverScript = (() => { + const match = indexHtml.match(/