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: surface Writers Room live-panel action descriptions and budget state without hover (#3567)
[._.]/ Adam Eivy42d5cef84e33
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex a5790961c0..8245d29f1e 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -193,3 +193,4 @@- **[issue-3565] Three Writers Room controls are now big enough to hit on a phone.** The Edit pencil on every Cast/Places/Objects bible row was an 11px icon with no padding around it — an ~11x11px tap target sitting next to the row text, so a thumb aiming for it selected the entry description instead. The snapshot Revert button in the Polish panel was 11px text and a matching icon on a row with no vertical padding of its own (~16px tall), and the World style Clear button in the Storyboard config tab was bare 9px text (~10x22px). All three now clear the 44px floor the rest of the app uses. Each one bleeds into the padding its own row already had rather than adding height on top of it, so the bible list and the snapshot list keep their density and the Clear button stays inside its stack gap instead of overlapping the style dropdown beneath it.- **[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 panel, bleeding into the padding their header already had so nothing grew taller, and the headers wrap instead of squeezing at phone widths.diff --git a/client/src/components/writers-room/CdBridgePanel.jsx b/client/src/components/writers-room/CdBridgePanel.jsxindex 6a84aecf02..6686316b5a 100644--- a/client/src/components/writers-room/CdBridgePanel.jsx+++ b/client/src/components/writers-room/CdBridgePanel.jsx@@ -7,6 +7,18 @@ import {sendWritersRoomCdBridge,} from '../../services/apiWritersRoom';import useMounted from '../../hooks/useMounted';+import LiveBudgetBadge from './LiveBudgetBadge';++// Both actions used to explain themselves only through `title`, which a touch+// screen never reveals (#3567). The sentence is the accessible name now — kept+// PREFIXED with the button's visible words so the two agree (WCAG 2.5.3 "Label+// in Name": a voice-control user must still be able to say "Propose treatment").+const PROPOSE_TEXT = 'Propose treatment';+const PROPOSE_HINT = 'Turns the prose at your cursor into a Creative Director treatment';+const PROPOSE_LABEL = `${PROPOSE_TEXT}: ${PROPOSE_HINT}`;+const SEND_TEXT = 'Send to Creative Director';+const SEND_HINT = 'Creates a new Creative Director project seeded with this treatment';+const SEND_LABEL = `${SEND_TEXT}: ${SEND_HINT}`;// Phase 5 Creative Director bridge panel. While the work has live mode opted// in, the writer can ask the Creative Director to turn the prose around the@@ -96,25 +108,27 @@ export default function CdBridgePanel({ workId, liveMode, usage, onUsageChange,const budget = liveMode?.dailyCallBudget ?? 0;const spent = usage?.count ?? 0;- const remainingLabel = budget > 0 ? `${Math.max(0, budget - spent)} / ${budget} left today` : 'unlimited';return (<div className="px-3 py-2 border-b border-port-border">- <div className="flex items-center justify-between gap-2">+ <div className="flex items-center justify-between gap-x-2 gap-y-1 flex-wrap"><div className="flex items-center gap-1.5 text-[11px] font-semibold text-port-accent"><Clapperboard size={12} /> CD Bridge</div>- <div className="flex items-center gap-2">- <span className="text-[10px] text-gray-500" title="Shares the daily suggestion budget">{remainingLabel}</span>+ <div className="flex items-center gap-2 flex-wrap">+ <LiveBudgetBadge label="Suggestions (shared)" budget={budget} spent={spent} />+ {/* 44px tap target; -my-2 bleeds into the panel's own py-2 so the+ header doesn't grow taller than it already was. */}<buttontype="button"onClick={requestProposal}disabled={loading}- className="flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-port-bg border border-port-border text-gray-300 hover:text-white disabled:opacity-50"- title="Propose a Creative Director treatment from the cursor"+ className="flex items-center justify-center gap-1 min-h-[44px] px-2 -my-2 text-[10px] rounded bg-port-bg border border-port-border text-gray-300 hover:text-white disabled:opacity-50"+ title={PROPOSE_LABEL}+ aria-label={PROPOSE_LABEL}>{loading ? <Loader2 size={10} className="animate-spin" /> : <Clapperboard size={10} />}- Propose treatment+ {PROPOSE_TEXT}</button></div></div>@@ -155,15 +169,17 @@ export default function CdBridgePanel({ workId, liveMode, usage, onUsageChange,</div>))}</div>+ <div className="text-[10px] text-gray-500">{SEND_HINT}.</div><buttontype="button"onClick={sendToCd}disabled={sending}- className="flex items-center gap-1 px-2 py-1 text-[10px] rounded bg-port-accent/15 text-port-accent hover:bg-port-accent/25 disabled:opacity-50"- title="Create a Creative Director project seeded with this treatment"+ className="flex items-center justify-center gap-1 min-h-[44px] px-3 text-[10px] rounded bg-port-accent/15 text-port-accent hover:bg-port-accent/25 disabled:opacity-50"+ title={SEND_LABEL}+ aria-label={SEND_LABEL}>{sending ? <Loader2 size={10} className="animate-spin" /> : <Send size={10} />}- Send to Creative Director+ {SEND_TEXT}</button></div>)}diff --git a/client/src/components/writers-room/LiveBudgetBadge.jsx b/client/src/components/writers-room/LiveBudgetBadge.jsxnew file mode 100644index 0000000000..dd08a7831b--- /dev/null+++ b/client/src/components/writers-room/LiveBudgetBadge.jsx@@ -0,0 +1,38 @@+import { AlertTriangle } from 'lucide-react';++// Shared daily-budget readout for the three Writers Room live panels (#3567).+//+// Each panel used to render its remaining-call count as a bare+// `<span title="Daily suggestion budget">7 / 10 left today</span>`. A touch+// screen fires no hover, so on a phone *what* the number counted was invisible,+// and a spent budget looked identical to a healthy one. The name of the budget+// is visible text now, and a low/exhausted balance carries a visible tone + icon+// plus the reset time rather than hiding it all in a tooltip.+//+// `label` is the visible name of the budget this panel spends — the CD bridge+// and continuation panels share ONE counter, so their labels say so.+//+// Deliberately no `aria-label` (the visible text is already the accessible name;+// an aria-label would shadow it and drift) and no `role="status"` (the two+// suggestion badges render the same shared count, so every spend would be+// announced twice).++// Warn once a fifth of the daily allowance is left — at least 1 call, so a tiny+// budget still gets a warning before it hits zero.+const LOW_RATIO = 0.2;++export default function LiveBudgetBadge({ label, budget, spent }) {+ const limited = budget > 0;+ const remaining = limited ? Math.max(0, budget - (spent || 0)) : null;+ const exhausted = limited && remaining === 0;+ const low = limited && !exhausted && remaining <= Math.max(1, Math.ceil(budget * LOW_RATIO));+ const tone = exhausted ? 'text-port-error' : low ? 'text-port-warning' : 'text-gray-500';++ return (+ <span className={`inline-flex items-center gap-1 text-[10px] leading-tight ${tone}`}>+ {(exhausted || low) && <AlertTriangle size={10} aria-hidden="true" className="shrink-0" />}+ {label}: {limited ? `${remaining} / ${budget} left today` : 'unlimited'}+ {exhausted ? ' — resets at UTC midnight' : ''}+ </span>+ );+}diff --git a/client/src/components/writers-room/LiveContinuationPanel.jsx b/client/src/components/writers-room/LiveContinuationPanel.jsxindex 331a9dc8f3..d233769c6d 100644--- a/client/src/components/writers-room/LiveContinuationPanel.jsx+++ b/client/src/components/writers-room/LiveContinuationPanel.jsx@@ -3,6 +3,12 @@ import { Sparkles, Loader2, Plus } from 'lucide-react';import toast from '../ui/Toast';import { suggestWritersRoomContinuation } from '../../services/apiWritersRoom';import useMounted from '../../hooks/useMounted';+import LiveBudgetBadge from './LiveBudgetBadge';++// The Suggest button explained itself only through `title`, which never appears+// on touch — that sentence is the accessible name now (#3567). It opens with the+// button's own visible word so the two agree (WCAG 2.5.3 "Label in Name").+const SUGGEST_LABEL = 'Suggest a continuation from the cursor';const KIND_LABEL = { beat: 'Beat', prose: 'Prose', dialogue: 'Dialogue' };const KIND_TONE = {@@ -117,7 +123,6 @@ export default function LiveContinuationPanel({const budget = liveMode?.dailyCallBudget ?? 0;const spent = usage?.count ?? 0;- const remainingLabel = budget > 0 ? `${Math.max(0, budget - spent)} / ${budget} left today` : 'unlimited';if (!liveMode?.enabled) {return (@@ -129,18 +134,21 @@ export default function LiveContinuationPanel({return (<div className="flex flex-col h-full min-h-0">- <div className="flex items-center justify-between gap-2 px-3 py-2 border-b border-port-border">+ <div className="flex items-center justify-between gap-x-2 gap-y-1 flex-wrap px-3 py-2 border-b border-port-border"><div className="flex items-center gap-1.5 text-[11px] font-semibold text-port-accent"><Sparkles size={12} /> Live Director</div>- <div className="flex items-center gap-2">- <span className="text-[10px] text-gray-500" title="Daily suggestion budget">{remainingLabel}</span>+ <div className="flex items-center gap-2 flex-wrap">+ <LiveBudgetBadge label="Suggestions" budget={budget} spent={spent} />+ {/* 44px tap target; -my-2 bleeds into the header's own py-2 so the+ row keeps the height it already had. */}<buttontype="button"onClick={requestSuggest}disabled={loading}- className="flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-port-bg border border-port-border text-gray-300 hover:text-white disabled:opacity-50"- title="Suggest a continuation from the cursor"+ className="flex items-center justify-center gap-1 min-h-[44px] px-2 -my-2 text-[10px] rounded bg-port-bg border border-port-border text-gray-300 hover:text-white disabled:opacity-50"+ title={SUGGEST_LABEL}+ aria-label={SUGGEST_LABEL}>{loading ? <Loader2 size={10} className="animate-spin" /> : <Sparkles size={10} />}Suggest@@ -169,11 +177,15 @@ export default function LiveContinuationPanel({{KIND_LABEL[opt.kind] || 'Beat'}</span>{(opt.kind === 'prose' || opt.kind === 'dialogue') && (+ // Every Insert button reads "Insert", so the accessible name+ // names WHICH suggestion it inserts; 44px tap target bleeding+ // into the card's own p-2.<buttontype="button"onClick={() => onInsert?.(opt)}- className="flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded bg-port-accent/15 text-port-accent hover:bg-port-accent/25"+ className="flex items-center justify-center gap-1 min-h-[44px] px-2 -my-2 text-[10px] rounded bg-port-accent/15 text-port-accent hover:bg-port-accent/25"title="Insert at cursor"+ aria-label={`Insert ${KIND_LABEL[opt.kind] || 'Beat'} suggestion ${i + 1} at cursor`}><Plus size={10} /> Insert</button>diff --git a/client/src/components/writers-room/LiveRenderPanel.jsx b/client/src/components/writers-room/LiveRenderPanel.jsxindex 3a3a2c5ce0..28115b8a76 100644--- a/client/src/components/writers-room/LiveRenderPanel.jsx+++ b/client/src/components/writers-room/LiveRenderPanel.jsx@@ -15,6 +15,13 @@ import {matchSceneCharacters,matchScenePlace,} from '../../lib/scenePrompt';+import LiveBudgetBadge from './LiveBudgetBadge';++// What the Render button does used to live only in its `title`, invisible on a+// touch screen (#3567). It is a visible helper line now, and rides along in the+// accessible name PREFIXED by the button's own visible words so the two agree+// (WCAG 2.5.3 "Label in Name").+const RENDER_HINT = 'Renders a quick reference image for the scene at your cursor';// Phase 5 live render preview. While the work has live mode opted in, the// writer can trigger a quick reference render for the scene their cursor sits@@ -235,38 +242,45 @@ export default function LiveRenderPanel({const budget = liveMode?.dailyRenderBudget ?? 0;const spent = renderUsage?.count ?? 0;- const remainingLabel = budget > 0 ? `${Math.max(0, budget - spent)} / ${budget} left today` : 'unlimited';const busy = reserving || genStatus === 'running';+ const renderText = genStatus === 'running' ? 'Rendering…' : 'Render scene';const targetLabel = target? `S${String(target.sceneNumber).padStart(2, '0')} ${target.scene.heading || ''}`.trim(): null;return (<div className="px-3 py-2 border-b border-port-border">- <div className="flex items-center justify-between gap-2">+ <div className="flex items-center justify-between gap-x-2 gap-y-1 flex-wrap"><div className="flex items-center gap-1.5 text-[11px] font-semibold text-port-success"><ImagePlus size={12} /> Live Render</div>- <div className="flex items-center gap-2">- <span className="text-[10px] text-gray-500" title="Daily render-preview budget">{remainingLabel}</span>+ <div className="flex items-center gap-2 flex-wrap">+ <LiveBudgetBadge label="Renders" budget={budget} spent={spent} />+ {/* 44px tap target; -my-2 bleeds into the panel's own py-2 so the+ header keeps the height it already had. */}<buttontype="button"onClick={renderCursorScene}disabled={busy}- className="flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-port-bg border border-port-border text-gray-300 hover:text-white disabled:opacity-50"- title="Render a quick reference image for the scene at your cursor"+ className="flex items-center justify-center gap-1 min-h-[44px] px-2 -my-2 text-[10px] rounded bg-port-bg border border-port-border text-gray-300 hover:text-white disabled:opacity-50"+ title={`${renderText}: ${RENDER_HINT}`}+ aria-label={`${renderText}: ${RENDER_HINT}`}>{busy ? <Loader2 size={10} className="animate-spin" /> : <ImagePlus size={10} />}- {genStatus === 'running' ? 'Rendering…' : 'Render scene'}+ {renderText}</button></div></div>{notice ? (<div className="mt-1.5 text-[10px] text-gray-400">{notice}</div>) : (- <div className="mt-1 text-[10px] text-gray-500 truncate" title={targetLabel || undefined}>- {targetLabel ? `Cursor scene: ${targetLabel}` : 'Place your cursor in a scene to render it.'}- </div>+ <>+ <div className="mt-1 text-[10px] text-gray-500">{RENDER_HINT}.</div>+ {/* The heading can be long, so this line (and only this line) truncates. */}+ <div className="text-[10px] text-gray-400 truncate" title={targetLabel || undefined}>+ {targetLabel ? `Cursor scene: ${targetLabel}` : 'Place your cursor in a scene to render it.'}+ </div>+ </>)}</div>);diff --git a/client/src/components/writers-room/livePanelsA11y.test.jsx b/client/src/components/writers-room/livePanelsA11y.test.jsxnew file mode 100644index 0000000000..888d76b00a--- /dev/null+++ b/client/src/components/writers-room/livePanelsA11y.test.jsx@@ -0,0 +1,207 @@+import { describe, it, expect, vi, beforeEach } from 'vitest';+import { render, screen, fireEvent } from '@testing-library/react';+import { MemoryRouter } from 'react-router';++// Regression guard for #3567: the three Writers Room live panels explained+// their actions and reported their daily budgets ONLY through `title="…"`,+// which a touch screen never reveals. Every action now carries an explicit+// accessible name, and each budget names itself in visible text.++const suggestWritersRoomContinuation = vi.fn();+const suggestWritersRoomCdBridge = vi.fn();+const sendWritersRoomCdBridge = vi.fn();+vi.mock('../../services/apiWritersRoom', () => ({+ suggestWritersRoomContinuation: (...a) => suggestWritersRoomContinuation(...a),+ suggestWritersRoomCdBridge: (...a) => suggestWritersRoomCdBridge(...a),+ sendWritersRoomCdBridge: (...a) => sendWritersRoomCdBridge(...a),+ reserveWritersRoomRenderPreview: vi.fn(),+ attachWritersRoomSceneImage: vi.fn(),+}));+vi.mock('../../services/apiSystem', () => ({ generateImage: vi.fn() }));+// Socket.IO auto-connects on import (LiveRenderPanel).+vi.mock('../../services/socket', () => ({+ default: { on: vi.fn(), off: vi.fn(), emit: vi.fn(), connected: false },+}));++import CdBridgePanel from './CdBridgePanel';+import LiveBudgetBadge from './LiveBudgetBadge';+import LiveContinuationPanel from './LiveContinuationPanel';+import LiveRenderPanel from './LiveRenderPanel';++beforeEach(() => {+ suggestWritersRoomContinuation.mockReset();+ suggestWritersRoomCdBridge.mockReset();+ sendWritersRoomCdBridge.mockReset();+});++const getCursorContext = () => ({ before: 'Some prose before. ', after: '', selection: '' });++// WCAG 2.5.3 "Label in Name": an aria-label that describes the action must still+// CONTAIN the words on the button, or voice control ("click Suggest") can no+// longer reach it. Every action here is labelled `<visible text>: <what it does>`.+function expectLabelInName(btn) {+ expect(btn.getAttribute('aria-label')).toContain(btn.textContent.trim());+}++function renderCdBridge(liveMode, usage) {+ render(+ <MemoryRouter>+ <CdBridgePanel+ workId="wr-work-1"+ liveMode={liveMode}+ usage={usage}+ onUsageChange={() => {}}+ getCursorContext={getCursorContext}+ onLinked={() => {}}+ />+ </MemoryRouter>,+ );+}++function renderContinuation(liveMode, usage) {+ render(+ <LiveContinuationPanel+ workId="wr-work-1"+ liveMode={liveMode}+ usage={usage}+ onUsageChange={() => {}}+ getCursorContext={getCursorContext}+ onInsert={() => {}}+ registerTrigger={() => {}}+ />,+ );+}++function renderLiveRender(liveMode) {+ render(+ <LiveRenderPanel+ workId="wr-work-1"+ liveMode={liveMode}+ getCursorOffset={() => 0}+ body=""+ renderContext={{ analysisId: null, scenes: [] }}+ registerQueue={() => {}}+ onSceneImageAttached={() => {}}+ workTitle="Example Work"+ />,+ );+}++describe('LiveBudgetBadge', () => {+ it('names the budget it reports in visible text', () => {+ render(<LiveBudgetBadge label="Renders" budget={10} spent={3} />);+ expect(screen.getByText('Renders: 7 / 10 left today')).toBeInTheDocument();+ });++ it('warns visibly (not just by tone) once the budget is spent', () => {+ render(<LiveBudgetBadge label="Renders" budget={10} spent={10} />);+ const badge = screen.getByText('Renders: 0 / 10 left today — resets at UTC midnight');+ expect(badge.className).toContain('text-port-error');+ });++ it('tones the readout as a warning while the budget runs low', () => {+ const { container } = render(<LiveBudgetBadge label="Renders" budget={10} spent={8} />);+ expect(screen.getByText('Renders: 2 / 10 left today').className).toContain('text-port-warning');+ // The warning is not colour-only — an icon rides along with it.+ expect(container.querySelector('svg')).not.toBeNull();+ });++ it('reads "unlimited" (with no warning tone) when no budget is configured', () => {+ render(<LiveBudgetBadge label="Suggestions" budget={0} spent={99} />);+ const badge = screen.getByText('Suggestions: unlimited');+ expect(badge.className).toContain('text-gray-500');+ expect(badge.className).not.toContain('text-port-error');+ });++ it('never reports a negative balance when spend has overrun the budget', () => {+ render(<LiveBudgetBadge label="Suggestions" budget={5} spent={9} />);+ expect(screen.getByText(/Suggestions: 0 \/ 5 left today/)).toBeInTheDocument();+ });+});++describe('CdBridgePanel a11y (#3567)', () => {+ const liveMode = { enabled: true, dailyCallBudget: 100 };++ it('exposes the Propose action by name and meets the 44px touch floor', () => {+ renderCdBridge(liveMode, { count: 0 });+ const btn = screen.getByRole('button', { name: 'Propose treatment: Turns the prose at your cursor into a Creative Director treatment' });+ expectLabelInName(btn);+ expect(btn.className).toContain('min-h-[44px]');+ });++ it('shows the shared suggestion budget without hover', () => {+ renderCdBridge(liveMode, { count: 40 });+ expect(screen.getByText('Suggestions (shared): 60 / 100 left today')).toBeInTheDocument();+ });++ it('explains the Send action in visible text as well as its accessible name', async () => {+ suggestWritersRoomCdBridge.mockResolvedValue({+ proposal: { logline: 'A logline.', scenes: [] },+ usage: { count: 1 },+ });+ renderCdBridge(liveMode, { count: 0 });+ fireEvent.click(screen.getByRole('button', { name: 'Propose treatment: Turns the prose at your cursor into a Creative Director treatment' }));++ const send = await screen.findByRole('button', {+ name: 'Send to Creative Director: Creates a new Creative Director project seeded with this treatment',+ });+ expectLabelInName(send);+ expect(send.className).toContain('min-h-[44px]');+ expect(+ screen.getByText('Creates a new Creative Director project seeded with this treatment.'),+ ).toBeInTheDocument();+ });+});++describe('LiveContinuationPanel a11y (#3567)', () => {+ const liveMode = { enabled: true, dailyCallBudget: 20 };++ it('exposes the Suggest action by name and meets the 44px touch floor', () => {+ renderContinuation(liveMode, { count: 0 });+ const btn = screen.getByRole('button', { name: 'Suggest a continuation from the cursor' });+ expectLabelInName(btn);+ expect(btn.className).toContain('min-h-[44px]');+ });++ it('shows the suggestion budget without hover', () => {+ renderContinuation(liveMode, { count: 18 });+ expect(screen.getByText('Suggestions: 2 / 20 left today')).toBeInTheDocument();+ });++ it('gives each Insert button an accessible name naming the suggestion it inserts', async () => {+ suggestWritersRoomContinuation.mockResolvedValue({+ options: [+ { kind: 'prose', text: 'Prose one.' },+ { kind: 'dialogue', text: 'Dialogue two.' },+ ],+ usage: { count: 1 },+ });+ renderContinuation(liveMode, { count: 0 });+ fireEvent.click(screen.getByRole('button', { name: 'Suggest a continuation from the cursor' }));++ const first = await screen.findByRole('button', { name: 'Insert Prose suggestion 1 at cursor' });+ expectLabelInName(first);+ expect(first.className).toContain('min-h-[44px]');+ expect(screen.getByRole('button', { name: 'Insert Dialogue suggestion 2 at cursor' })).toBeInTheDocument();+ });+});++describe('LiveRenderPanel a11y (#3567)', () => {+ const liveMode = { enabled: true, dailyRenderBudget: 5, renderUsage: { count: 1 } };++ it('exposes the Render action by name and meets the 44px touch floor', () => {+ renderLiveRender(liveMode);+ const btn = screen.getByRole('button', { name: 'Render scene: Renders a quick reference image for the scene at your cursor' });+ expectLabelInName(btn);+ expect(btn.className).toContain('min-h-[44px]');+ });++ it('shows the render budget and what the action does without hover', () => {+ renderLiveRender(liveMode);+ expect(screen.getByText('Renders: 4 / 5 left today')).toBeInTheDocument();+ expect(+ screen.getByText('Renders a quick reference image for the scene at your cursor.'),+ ).toBeInTheDocument();+ expect(screen.getByText('Place your cursor in a scene to render it.')).toBeInTheDocument();+ });+});diff --git a/client/src/components/writers-room/liveUsageSync.test.jsx b/client/src/components/writers-room/liveUsageSync.test.jsxindex fafdf8286c..230b1f4781 100644--- a/client/src/components/writers-room/liveUsageSync.test.jsx+++ b/client/src/components/writers-room/liveUsageSync.test.jsx@@ -57,16 +57,19 @@ describe('live text-suggest budget shares across panels', () => {suggestWritersRoomContinuation.mockResolvedValue({ options: [], usage: { count: 7 } });render(<Harness />);- // Both panels start at the full budget.- expect(screen.getAllByText('100 / 100 left today')).toHaveLength(2);+ // Both panels start at the full budget. Each readout names the budget it+ // reports in visible text (#3567), so match the labeled strings.+ expect(screen.getByText('Suggestions: 100 / 100 left today')).toBeInTheDocument();+ expect(screen.getByText('Suggestions (shared): 100 / 100 left today')).toBeInTheDocument();// Spend budget from the continuation panel.- fireEvent.click(screen.getByTitle('Suggest a continuation from the cursor'));+ fireEvent.click(screen.getByRole('button', { name: 'Suggest a continuation from the cursor' }));// BOTH readouts reflect the new count — the CD bridge panel did NOT make// the call but still updates because the counter is lifted into the parent.await waitFor(() => {- expect(screen.getAllByText('93 / 100 left today')).toHaveLength(2);+ expect(screen.getByText('Suggestions: 93 / 100 left today')).toBeInTheDocument();+ expect(screen.getByText('Suggestions (shared): 93 / 100 left today')).toBeInTheDocument();});});@@ -74,10 +77,11 @@ describe('live text-suggest budget shares across panels', () => {suggestWritersRoomCdBridge.mockResolvedValue({ proposal: null, usage: { count: 12 } });render(<Harness />);- fireEvent.click(screen.getByTitle('Propose a Creative Director treatment from the cursor'));+ fireEvent.click(screen.getByRole('button', { name: 'Propose treatment: Turns the prose at your cursor into a Creative Director treatment' }));await waitFor(() => {- expect(screen.getAllByText('88 / 100 left today')).toHaveLength(2);+ expect(screen.getByText('Suggestions: 88 / 100 left today')).toBeInTheDocument();+ expect(screen.getByText('Suggestions (shared): 88 / 100 left today')).toBeInTheDocument();});});});