Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: show one SyncedReview pane at a time below lg so Script and Media aren't clipped off-screen (#3566)
[._.]/ Adam Eivy7f5a4431683e
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex a16ee93355..891665ec16 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -194,3 +194,4 @@- **[issue-3579] Refusing a 3D model install on unsupported hardware now says why in English, and a new reason code can no longer go label-less.** The image-to-3D registry answers "can this host run that target?" with stable codes like `requires-linux-host` and `cuda-probe-failed`; the 3D page turned those into sentences from a hand-written table of its own, and the install endpoint had no table at all — so asking to install a target this machine can't run streamed back "This host cannot run TRELLIS.2 (CUDA) (requires-linux-host)", handing the user the internal code instead of the one thing they could act on. Both sides now render the same shared map, which lives next to the function that returns the codes and is mirrored to the client the way the catalog type registry already is. A parity test asserts the two copies never drift, and — the reason the drift was worth fixing rather than just re-syncing — it also reads the resolver's source and asserts the labelled set still *equals* the codes it can actually return. The previous arrangement failed silently: the CUDA lane added three codes by hand on each side, and a fourth that someone forgot to mirror would have rendered as the generic "Unsupported on this host" with every test still green.- **[issue-3568] The Writers Room prose editor starts above the fold on a phone again.** The work header laid out every control in one wrapping row, so at ~375px the title field, status dropdown, Edit/Read/Review toggle, Save, Snapshot and the Work menu stacked into four or five rows and ate 250-300px of a 667px screen — the textarea you came to write in began below the fold before the keyboard even opened. The header is now two compact rows on a phone: title, Save, Snapshot and the Work menu on the first, and the status dropdown plus the view toggle on a sub-bar of their own beneath it. The view toggle and Snapshot drop their text labels under `sm` so both rows stay single-line at 375px, keeping their names for screen readers. Nothing moved into the overflow menu — every control is still one tap away — and the desktop layout is the same single row in the same left-to-right order, because the sub-bar dissolves back into the header row at `sm` and up rather than being a second copy of the controls: the markup order *is* the desktop order, so the desktop tab order still follows what is on screen. Each control on the phone rows now clears the 44px touch floor.- **[issue-3567] The Writers Room live panels no longer hide what their buttons do — or how much daily budget is left — behind a mouse hover.** The CD Bridge, Live Director and Live Render headers each printed a bare "12 / 20 left today" whose meaning (which budget? shared with what?) lived only in a `title` tooltip, and the Propose / Suggest / Render / Send actions explained themselves the same way. A touch screen fires no hover, so on a phone none of it existed. The three readouts are now one shared badge that names its budget in visible text — and turns amber, then red with a warning icon and the UTC-midnight reset time, as the allowance runs down, so a spent budget stops looking identical to a full one. Each action carries the sentence as an explicit accessible name, prefixed with the words actually printed on the button so voice control can still reach it, and the two actions whose description had nowhere else to live (Send to Creative Director, Render scene) also print it as visible helper text. The five buttons involved were bare 18px-tall glyph rows; they now clear the same 44px tap-target floor as the rest of the app, and the headers wrap onto a second line instead of squeezing at phone widths — so, unlike the list rows in #3565, the header buttons take the extra height rather than clawing it back with a negative margin that would collide with the wrapped line above them.+- **[issue-3566] The Writers Room synced review no longer hides its Script and Media panes on a phone.** The three panes were laid out as a grid that only ever split into columns at desktop widths; below that they stacked into one column inside a fixed-height, `overflow-hidden` container with nothing to scroll, so on a ~375px screen the Prose pane filled the view and Script and Media sat past the bottom edge, unreachable — the cross-link highlighting the panel exists for was invisible on half of it. Narrow widths now show one pane at a time, picked from a 44px-tall selector that replaces the desktop "which panes sit side by side" toggles in the same spot on the toolbar; each pane keeps its own scroller, so selecting a prose segment still scrolls the linked scene into view when you switch to it. Picking a pane on the phone selector also re-enables it, so a pane switched off on a desktop session isn't stranded, and if the pane you were viewing is switched off the view falls back to one that's still on rather than going blank. Desktop layout is unchanged.diff --git a/client/src/components/writers-room/SyncedReview.jsx b/client/src/components/writers-room/SyncedReview.jsxindex 7718492451..ab81d2889a 100644--- a/client/src/components/writers-room/SyncedReview.jsx+++ b/client/src/components/writers-room/SyncedReview.jsx@@ -80,6 +80,10 @@ export default function SyncedReview({ work }) {const [error, setError] = useState(null);const [selection, setSelection] = useState(null);const [visible, setVisible] = useState(() => new Set(['prose', 'script', 'media']));+ // Below `lg` the three panes collapse to one column, so only one is shown at a+ // time — stacking them inside the fixed-height, overflow-hidden grid pushed+ // Script and Media off-screen with nothing to scroll (#3566).+ const [mobilePane, setMobilePane] = useState('prose');const mountedRef = useMounted();const proseRef = useRef(null);@@ -141,9 +145,21 @@ export default function SyncedReview({ work }) {});}, []);+ // Picking a pane on mobile also re-enables it, so the narrow layout never+ // needs the (desktop-only) visibility toggles to reach a pane.+ const showPane = useCallback((key) => {+ setVisible((prev) => (prev.has(key) ? prev : new Set(prev).add(key)));+ setMobilePane(key);+ }, []);+const hasSelection = !!selection;const visibleCount = [...visible].length;const colClass = visibleCount === 1 ? 'lg:grid-cols-1' : visibleCount === 2 ? 'lg:grid-cols-2' : 'lg:grid-cols-3';+ // Derived (not stored) so disabling the active pane on desktop can't leave the+ // narrow layout pointing at a pane that is no longer rendered.+ const activePane = visible.has(mobilePane) ? mobilePane : [...visible][0];+ // Every pane renders; below `lg` all but the active one are display:none.+ const paneClass = (key) => `${key === activePane ? '' : 'hidden'} lg:block`;if (loading && !data) {return (@@ -173,7 +189,8 @@ export default function SyncedReview({ work }) {<div className="w-full h-full flex flex-col bg-port-bg min-h-0">{/* Toolbar */}<div className="flex items-center gap-2 px-4 py-2 border-b border-port-border bg-port-bg/60 shrink-0 flex-wrap">- <div className="flex items-center bg-port-card border border-port-border rounded p-0.5" role="group" aria-label="Visible panes">+ {/* Desktop: pick which panes sit side by side. */}+ <div className="hidden lg:flex items-center bg-port-card border border-port-border rounded p-0.5" role="group" aria-label="Visible panes">{PANES.map(({ key, label, icon: Icon }) => (<buttonkey={key}@@ -190,6 +207,24 @@ export default function SyncedReview({ work }) {))}</div>+ {/* Mobile: one column fits one pane — switch between them instead. */}+ <div className="flex lg:hidden items-center gap-1 flex-1 bg-port-card border border-port-border rounded p-0.5" role="group" aria-label="Active pane">+ {PANES.map(({ key, label, icon: Icon }) => (+ <button+ key={key}+ type="button"+ aria-pressed={key === activePane}+ onClick={() => showPane(key)}+ className={`flex flex-1 items-center justify-center gap-1 px-2 min-h-[44px] text-[11px] rounded ${+ key === activePane ? 'bg-port-accent text-white' : 'text-gray-400'+ }`}+ title={`Show ${label} pane`}+ >+ <Icon size={12} /> {label}+ </button>+ ))}+ </div>+{data.script.stale && (<span className="flex items-center gap-1 text-[10px] text-port-warning border border-port-warning/40 rounded px-1.5 py-0.5" title="The draft changed after this script was generated — re-run Adapt to refresh the mapping."><AlertTriangle size={10} /> Script is stale@@ -231,6 +266,7 @@ export default function SyncedReview({ work }) {<div className={`flex-1 min-h-0 grid grid-cols-1 ${colClass} gap-px bg-port-border overflow-hidden`}>{visible.has('prose') && (<ProsePane+ className={paneClass('prose')}containerRef={proseRef}segments={data.prose.segments}proseIds={proseIds}@@ -240,6 +276,7 @@ export default function SyncedReview({ work }) {)}{visible.has('script') && (<ScriptPane+ className={paneClass('script')}containerRef={scriptRef}script={data.script}sceneIds={sceneIds}@@ -250,6 +287,7 @@ export default function SyncedReview({ work }) {)}{visible.has('media') && (<MediaPane+ className={paneClass('media')}containerRef={mediaRef}items={data.media.items}mediaSceneIds={mediaSceneIds}@@ -266,9 +304,9 @@ export default function SyncedReview({ work }) {// Shared pane chrome: the scroll container + sticky header. Each pane passes// its own item list (or empty state) as children.-function ScrollPane({ containerRef, icon: Icon, label, count, children }) {+function ScrollPane({ containerRef, className = '', paneKey, icon: Icon, label, count, children }) {return (- <div ref={containerRef} className="bg-port-bg overflow-y-auto min-h-0">+ <div ref={containerRef} data-pane={paneKey} className={`bg-port-bg overflow-y-auto min-h-0 ${className}`}><div className="flex items-center gap-1.5 px-3 py-1.5 text-[11px] uppercase tracking-wider text-gray-400 border-b border-port-border bg-port-card/60 sticky top-0 z-10"><Icon size={12} /> {label}<span className="text-gray-600">· {count}</span>@@ -279,9 +317,9 @@ function ScrollPane({ containerRef, icon: Icon, label, count, children }) {}// ---- Prose pane -----function ProsePane({ containerRef, segments, proseIds, hasSelection, onSelect }) {+function ProsePane({ containerRef, className, segments, proseIds, hasSelection, onSelect }) {return (- <ScrollPane containerRef={containerRef} icon={FileText} label="Prose" count={segments.length}>+ <ScrollPane containerRef={containerRef} className={className} paneKey="prose" icon={FileText} label="Prose" count={segments.length}><div className="p-3 space-y-2">{segments.map((seg) => {const state = cardState(false, proseIds.has(seg.id), hasSelection);@@ -313,9 +351,9 @@ function ProsePane({ containerRef, segments, proseIds, hasSelection, onSelect })}// ---- Script pane -----function ScriptPane({ containerRef, script, sceneIds, hasSelection, segHeading, onSelect }) {+function ScriptPane({ containerRef, className, script, sceneIds, hasSelection, segHeading, onSelect }) {return (- <ScrollPane containerRef={containerRef} icon={Clapperboard} label="Script" count={script.scenes.length}>+ <ScrollPane containerRef={containerRef} className={className} paneKey="script" icon={Clapperboard} label="Script" count={script.scenes.length}>{!script.available ? (<div className="p-4 text-[11px] text-gray-500 text-center">{script.status === 'failed'@@ -360,9 +398,9 @@ function ScriptPane({ containerRef, script, sceneIds, hasSelection, segHeading,}// ---- Media pane -----function MediaPane({ containerRef, items, mediaSceneIds, hasSelection, segHeading, onSelect }) {+function MediaPane({ containerRef, className, items, mediaSceneIds, hasSelection, segHeading, onSelect }) {return (- <ScrollPane containerRef={containerRef} icon={ImageIcon} label="Media" count={items.length}>+ <ScrollPane containerRef={containerRef} className={className} paneKey="media" icon={ImageIcon} label="Media" count={items.length}>{items.length === 0 ? (<div className="p-4 text-[11px] text-gray-500 text-center">No rendered media yet — generate scene images from the Storyboard panel.diff --git a/client/src/components/writers-room/SyncedReview.test.jsx b/client/src/components/writers-room/SyncedReview.test.jsxindex fb27c147b2..7b29cb3e6a 100644--- a/client/src/components/writers-room/SyncedReview.test.jsx+++ b/client/src/components/writers-room/SyncedReview.test.jsx@@ -76,6 +76,52 @@ describe('SyncedReview', () => {expect(screen.getByText('The hero wakes.')).toBeTruthy();});+ it('stacks to a single pane below lg and switches with the mobile selector', async () => {+ getWritersRoomSyncedReview.mockResolvedValue(payload());+ const { container } = render(<SyncedReview work={work} />);+ await screen.findByText('The hero wakes.');++ const paneClasses = () => Object.fromEntries(+ ['prose', 'script', 'media'].map((k) => [k, container.querySelector(`[data-pane="${k}"]`).className]),+ );++ // Only the active pane is displayed at narrow widths; the rest are display:none+ // until `lg` — no pane is left clipped below the fold (#3566).+ let classes = paneClasses();+ expect(classes.prose).not.toMatch(/\bhidden\b/);+ expect(classes.script).toMatch(/\bhidden\b/);+ expect(classes.media).toMatch(/\bhidden\b/);+ ['prose', 'script', 'media'].forEach((k) => expect(classes[k]).toMatch(/\blg:block\b/));++ fireEvent.click(screen.getByTitle('Show Media pane'));+ await waitFor(() => expect(paneClasses().media).not.toMatch(/\bhidden\b/));+ classes = paneClasses();+ expect(classes.prose).toMatch(/\bhidden\b/);+ expect(classes.script).toMatch(/\bhidden\b/);+ expect(screen.getByTitle('Show Media pane').getAttribute('aria-pressed')).toBe('true');+ });++ it('falls back to a still-enabled pane when the active one is toggled off', async () => {+ getWritersRoomSyncedReview.mockResolvedValue(payload());+ render(<SyncedReview work={work} />);+ await screen.findByText('The hero wakes.');+ // Prose starts active on mobile; disabling it must hand the mobile view to+ // another enabled pane rather than render nothing.+ fireEvent.click(screen.getByTitle('Toggle Prose pane'));+ await waitFor(() => expect(screen.getByTitle('Show Script pane').getAttribute('aria-pressed')).toBe('true'));+ });++ it('re-enables a disabled pane when it is picked from the mobile selector', async () => {+ getWritersRoomSyncedReview.mockResolvedValue(payload());+ render(<SyncedReview work={work} />);+ await screen.findByText('Opening Scene');+ fireEvent.click(screen.getByTitle('Toggle Script pane'));+ await waitFor(() => expect(screen.queryByText('Opening Scene')).toBeNull());+ fireEvent.click(screen.getByTitle('Show Script pane'));+ expect(await screen.findByText('Opening Scene')).toBeTruthy();+ expect(screen.getByTitle('Toggle Script pane').getAttribute('aria-pressed')).toBe('true');+ });+it('shows the stale badge when the script is stale', async () => {getWritersRoomSyncedReview.mockResolvedValue(payload({script: { ...payload().script, stale: true },