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: thread the real selection into SyncedReview panes so the anchor card renders selected, not merely linked (#3586)
[._.]/ Adam Eivy577282242709
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 891665ec16..58b8556bc0 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -195,3 +195,4 @@- **[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.+- **[issue-3586] The Writers Room synced review now shows which card you actually clicked.** All three panes drew their cards through a helper that had four states — selected, linked, dimmed, plain — but every caller passed "not selected" as a constant, so the strongest of the four was unreachable code. Because the mapping deliberately includes the selected item in its own pane's highlight set, the card you clicked came out styled exactly like the cards it links to: with a prose segment selected, the segment itself and the scene it maps to were the same faint accent border, and nothing on screen said which end of the cross-link you were standing on. The real selection is now threaded into each pane, so the anchor card takes the full accent ring and its linked counterparts keep the lighter treatment, in the prose, script and media panes alike.diff --git a/client/src/components/writers-room/SyncedReview.jsx b/client/src/components/writers-room/SyncedReview.jsxindex 7e9fd6664c..e0985d2189 100644--- a/client/src/components/writers-room/SyncedReview.jsx+++ b/client/src/components/writers-room/SyncedReview.jsx@@ -59,6 +59,14 @@ function computeHighlights(data, selection) {return { proseIds, sceneIds, mediaSceneIds };}+// The id the selection anchors on within `paneType`, or null when the selection+// lives in another pane. `computeHighlights` also adds the selected item to its+// own pane's highlight set, so without this the anchor card would be+// indistinguishable from the cards it links to.+function selectedIdFor(selection, paneType) {+ return selection?.type === paneType ? selection.id : null;+}+// Visual state for a card given the active selection: 'selected' | 'linked' |// 'dim' | 'none'. Drives the ring/opacity so a selection reads at a glance.function cardState(isSelected, isLinked, hasSelection) {@@ -274,6 +282,7 @@ export default function SyncedReview({ work }) {containerRef={proseRef}segments={data.prose.segments}proseIds={proseIds}+ selectedId={selectedIdFor(selection, 'prose')}hasSelection={hasSelection}onSelect={(id) => select('prose', id)}/>@@ -284,6 +293,7 @@ export default function SyncedReview({ work }) {containerRef={scriptRef}script={data.script}sceneIds={sceneIds}+ selectedId={selectedIdFor(selection, 'script')}hasSelection={hasSelection}segHeading={segHeading}onSelect={(id) => select('script', id)}@@ -295,6 +305,7 @@ export default function SyncedReview({ work }) {containerRef={mediaRef}items={data.media.items}mediaSceneIds={mediaSceneIds}+ selectedId={selectedIdFor(selection, 'media')}hasSelection={hasSelection}segHeading={segHeading}onSelect={(sceneId) => select('media', sceneId)}@@ -321,12 +332,12 @@ function ScrollPane({ containerRef, className = '', paneKey, icon: Icon, label,}// ---- Prose pane -----function ProsePane({ containerRef, className, segments, proseIds, hasSelection, onSelect }) {+function ProsePane({ containerRef, className, segments, proseIds, selectedId, hasSelection, onSelect }) {return (<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);+ const state = cardState(seg.id === selectedId, proseIds.has(seg.id), hasSelection);return (<buttonkey={seg.id}@@ -355,7 +366,7 @@ function ProsePane({ containerRef, className, segments, proseIds, hasSelection,}// ---- Script pane -----function ScriptPane({ containerRef, className, script, sceneIds, hasSelection, segHeading, onSelect }) {+function ScriptPane({ containerRef, className, script, sceneIds, selectedId, hasSelection, segHeading, onSelect }) {return (<ScrollPane containerRef={containerRef} className={className} paneKey="script" icon={Clapperboard} label="Script" count={script.scenes.length}>{!script.available ? (@@ -367,7 +378,7 @@ function ScriptPane({ containerRef, className, script, sceneIds, hasSelection, s) : (<div className="p-3 space-y-2">{script.scenes.map((sc) => {- const state = cardState(false, sceneIds.has(sc.id), hasSelection);+ const state = cardState(sc.id === selectedId, sceneIds.has(sc.id), hasSelection);return (<buttonkey={sc.id}@@ -402,7 +413,7 @@ function ScriptPane({ containerRef, className, script, sceneIds, hasSelection, s}// ---- Media pane -----function MediaPane({ containerRef, className, items, mediaSceneIds, hasSelection, segHeading, onSelect }) {+function MediaPane({ containerRef, className, items, mediaSceneIds, selectedId, hasSelection, segHeading, onSelect }) {return (<ScrollPane containerRef={containerRef} className={className} paneKey="media" icon={ImageIcon} label="Media" count={items.length}>{items.length === 0 ? (@@ -412,7 +423,7 @@ function MediaPane({ containerRef, className, items, mediaSceneIds, hasSelection) : (<div className="p-3 grid grid-cols-2 gap-2">{items.map((m) => {- const state = cardState(false, mediaSceneIds.has(m.sceneId), hasSelection);+ const state = cardState(m.sceneId === selectedId, mediaSceneIds.has(m.sceneId), hasSelection);return (<buttonkey={`${m.sceneId}-${m.ref}`}diff --git a/client/src/components/writers-room/SyncedReview.test.jsx b/client/src/components/writers-room/SyncedReview.test.jsxindex 7b29cb3e6a..ef3bd1219a 100644--- a/client/src/components/writers-room/SyncedReview.test.jsx+++ b/client/src/components/writers-room/SyncedReview.test.jsx@@ -64,6 +64,58 @@ describe('SyncedReview', () => {await waitFor(() => expect(screen.queryByText(/Clear link/)).toBeNull());});+ it('renders the anchor card of a cross-link stronger than the cards it links to', async () => {+ // seg-001 ↔ scene-01 ↔ one rendered media item, so every pane has both an+ // anchor candidate and a merely-linked card (#3586).+ const base = payload();+ getWritersRoomSyncedReview.mockResolvedValue(payload({+ prose: {+ segments: [+ { ...base.prose.segments[0], media: [{ sceneId: 'scene-01', ref: 'a.png' }] },+ base.prose.segments[1],+ ],+ },+ script: { ...base.script, scenes: [{ ...base.script.scenes[0], media: { ref: 'a.png' } }] },+ media: {+ items: [{+ sceneId: 'scene-01', ref: 'a.png', sceneHeading: 'Opening Scene', orphan: false,+ proseSegmentIds: ['seg-001'], prompt: 'a room', generatedAt: '2026-01-01T00:00:00Z',+ }],+ },+ }));+ const { container } = render(<SyncedReview work={work} />);+ await screen.findByText('The hero wakes.');++ const card = (pane, syncId) => container.querySelector(`[data-pane="${pane}"] [data-sync-id="${syncId}"]`);+ const isSelected = (el) => /\bring-port-accent\b/.test(el.className);+ const isLinked = (el) => /border-port-accent\/50/.test(el.className);++ // Selecting prose: its own card is the anchor; the script/media cards it+ // maps to get the weaker "linked" treatment.+ fireEvent.click(screen.getByText('The hero wakes.'));+ await waitFor(() => expect(isSelected(card('prose', 'seg-001'))).toBe(true));+ expect(isLinked(card('prose', 'seg-001'))).toBe(false);+ expect(isSelected(card('script', 'scene-01'))).toBe(false);+ expect(isLinked(card('script', 'scene-01'))).toBe(true);+ expect(isSelected(card('media', 'scene-01'))).toBe(false);+ expect(isLinked(card('media', 'scene-01'))).toBe(true);+ // an unrelated prose card dims rather than reading as linked+ expect(card('prose', 'seg-002').className).toMatch(/opacity-40/);++ // Selecting the script scene moves the anchor to the script pane.+ fireEvent.click(card('script', 'scene-01'));+ await waitFor(() => expect(isSelected(card('script', 'scene-01'))).toBe(true));+ expect(isSelected(card('prose', 'seg-001'))).toBe(false);+ expect(isLinked(card('prose', 'seg-001'))).toBe(true);+ expect(isSelected(card('media', 'scene-01'))).toBe(false);++ // …and selecting the media item moves it to the media pane.+ fireEvent.click(card('media', 'scene-01'));+ await waitFor(() => expect(isSelected(card('media', 'scene-01'))).toBe(true));+ expect(isSelected(card('script', 'scene-01'))).toBe(false);+ expect(isLinked(card('script', 'scene-01'))).toBe(true);+ });+it('toggling the Script pane off hides it but keeps at least one pane', async () => {getWritersRoomSyncedReview.mockResolvedValue(payload());render(<SyncedReview work={work} />);