···11+import { describe, it, expect } from 'vitest';
22+import { readFileSync } from 'node:fs';
33+import { dirname, join } from 'node:path';
44+import { fileURLToPath } from 'node:url';
55+66+// Read the page source off disk. We resolve via `fileURLToPath` + `join` rather
77+// than handing a `URL` straight to `readFileSync` because, under this repo's
88+// Astro/Vite-backed Vitest, the global `URL` resolves a relative specifier
99+// against the test module to an `http://localhost` dev-server URL (not `file:`),
1010+// which `readFileSync` rejects. This mirrors the sibling `_*.meta.test.ts` pages.
1111+const here = dirname( fileURLToPath( import.meta.url ) );
1212+const src = readFileSync( join( here, './write.astro' ), 'utf8' );
1313+1414+describe( '/write route', () => {
1515+ it( 'mounts WriteStudio as a client:only island', () => {
1616+ expect( src ).toContain( "import WriteStudio from '../components/WriteStudio.tsx'" );
1717+ expect( src ).toMatch( /<WriteStudio\s+client:only="react"/ );
1818+ } );
1919+2020+ it( 'ships a writing-focused title and the write chrome styles', () => {
2121+ expect( src ).toMatch( /<Base title="Write[^"]*"/ );
2222+ expect( src ).toContain( "import '../styles/write-chrome.css'" );
2323+ } );
2424+} );
+21
src/pages/write.astro
···11+---
22+import Base from '../layouts/Base.astro';
33+import WriteStudio from '../components/WriteStudio.tsx';
44+import LoadingScene from '../components/LoadingScene.astro';
55+// The island is `client:only`, so Astro's scoped styles never reach its DOM — its
66+// chrome is styled globally from these shared stylesheets plus the write-specific one.
77+import '../styles/app-bar.css';
88+import '../styles/editor-chrome.css';
99+import '../styles/login.css';
1010+import '../styles/write-chrome.css';
1111+---
1212+1313+<Base title="Write — SkyPress">
1414+ <main class="editor-shell">
1515+ <!-- client:only — auth + editor run only in the browser (Decisions 0001 & 0004).
1616+ Unlike /editor this surface never gates on auth: you can write signed out. -->
1717+ <WriteStudio client:only="react">
1818+ <LoadingScene slot="fallback" variant="editor" />
1919+ </WriteStudio>
2020+ </main>
2121+</Base>