Skip to content

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

Give every deck card its own re-render button

Adam Eivy416999f06d4d
diff --git a/client/src/components/decks/DeckCardGrid.jsx b/client/src/components/decks/DeckCardGrid.jsx
index 28a96520be..549f2870f3 100644
--- a/client/src/components/decks/DeckCardGrid.jsx
+++ b/client/src/components/decks/DeckCardGrid.jsx
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
-import { AlertTriangle, Check, Hourglass, Link2, PencilLine, Play } from 'lucide-react';
+import { AlertTriangle, Check, Hourglass, Link2, PencilLine, Play, RefreshCw } from 'lucide-react';
import EntryThumbSlot from '../universe/EntryThumbSlot';
import Pill from '../ui/Pill';
import { CARD_STATUS, cardInFlightJobId, cardStatus, deckCompletion } from '../../lib/decks';
@@ -30,8 +30,20 @@ const STATUS_META = {
* Every card wears a labelled badge for its state and every group header spells
* its counts out in words, so "which cards still need a prompt, and which are
* ready to render" is answerable without opening a single card.
+ *
+ * Each card also carries its own re-render button, because once a card HAS an
+ * image its slot is a lightbox opener — re-rendering the one card you dislike
+ * otherwise meant opening its drawer or re-rendering the whole deck. It queues
+ * through the same `onRenderCard` the empty slot uses, so the server resolves
+ * the deck's own pinned backend, model and card trim; `renderTarget` is the
+ * page's resolved `useDeckRenderTarget(deck)`, and is used only to NAME those
+ * options on the button and to stand it down for the same unavailable local
+ * runtime that stops the batch actions above.
*/
-export default function DeckCardGrid({ deck, onOpenCard, onRenderCard, onPreview, onRenderComplete, onRenderTerminal }) {
+export default function DeckCardGrid({
+ deck, renderTarget, onOpenCard, onRenderCard, onPreview, onRenderComplete, onRenderTerminal,
+}) {
+ const { summary: renderSummary, blocked: runtimeBlocked } = renderTarget;
const groups = useMemo(() => {
const byGroup = Map.groupBy(deck.cards, (card) => card.group);
return [...byGroup].map(([key, cards]) => {
@@ -59,6 +71,7 @@ export default function DeckCardGrid({ deck, onOpenCard, onRenderCard, onPreview
const status = cardStatus(card);
const meta = STATUS_META[status];
const needsPrompt = !card.prompt;
+ const reRenderHint = renderHint({ card, needsPrompt, inFlight, runtimeBlocked, renderSummary });
return (
<li key={card.id} className="flex h-full flex-col items-center gap-1.5 rounded-lg border border-port-border bg-port-card p-2">
<EntryThumbSlot
@@ -90,7 +103,19 @@ export default function DeckCardGrid({ deck, onOpenCard, onRenderCard, onPreview
</span>
) : null}
</button>
- <Pill tone={meta.tone} size="xs" icon={meta.icon} className="mt-auto">{meta.label}</Pill>
+ <div className="mt-auto flex w-full flex-wrap items-center justify-center gap-1">
+ <Pill tone={meta.tone} size="xs" icon={meta.icon}>{meta.label}</Pill>
+ <button
+ type="button"
+ onClick={() => onRenderCard(card)}
+ disabled={needsPrompt || !!inFlight || runtimeBlocked}
+ title={reRenderHint}
+ aria-label={reRenderHint}
+ className="min-h-[32px] min-w-[32px] inline-flex shrink-0 items-center justify-center rounded text-gray-500 hover:text-port-accent hover:bg-port-accent/10 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-gray-500"
+ >
+ <RefreshCw size={13} aria-hidden="true" />
+ </button>
+ </div>
{/* Why it failed. The slot clears itself on a terminal
failure (so the card stays re-renderable), taking the
shared thumbnail's own message with it — this is the only
@@ -110,3 +135,16 @@ export default function DeckCardGrid({ deck, onOpenCard, onRenderCard, onPreview
</div>
);
}
+
+// Why this card's render button will or won't do anything, in one sentence.
+// Real text on the button's accessible name rather than a bare icon label,
+// because the two reasons it is inert (no prompt yet, a dead local runtime) are
+// both fixable elsewhere on the page — and a disabled button is neither
+// focusable nor hoverable on touch, so a `title` alone reaches nobody.
+function renderHint({ card, needsPrompt, inFlight, runtimeBlocked, renderSummary }) {
+ if (needsPrompt) return `Write a prompt for ${card.name} before rendering it`;
+ if (inFlight) return `${card.name} is rendering`;
+ if (runtimeBlocked) return `Cannot render ${card.name} — the local image runtime is unavailable`;
+ const verb = card.imageRefs?.length ? 'Re-render' : 'Render';
+ return renderSummary ? `${verb} ${card.name} on ${renderSummary}` : `${verb} ${card.name}`;
+}
diff --git a/client/src/components/decks/DeckCardGrid.test.jsx b/client/src/components/decks/DeckCardGrid.test.jsx
index 7819a0337e..44c0617587 100644
--- a/client/src/components/decks/DeckCardGrid.test.jsx
+++ b/client/src/components/decks/DeckCardGrid.test.jsx
@@ -23,9 +23,13 @@ const deck = {
],
};
+// The page resolves this once (`useDeckRenderTarget`) and hands the same object
+// to the render bar and the grid; the grid uses only these two fields.
+const renderTarget = (over = {}) => ({ summary: 'Local · flux2-klein-9b · 1096×1536', blocked: false, ...over });
+
const renderGrid = (over = {}) => {
const props = {
- deck, onOpenCard: vi.fn(), onRenderCard: vi.fn(), onPreview: vi.fn(),
+ deck, renderTarget: renderTarget(), onOpenCard: vi.fn(), onRenderCard: vi.fn(), onPreview: vi.fn(),
onRenderComplete: vi.fn(), onRenderTerminal: vi.fn(), ...over,
};
render(<DeckCardGrid {...props} />);
@@ -76,4 +80,31 @@ describe('DeckCardGrid', () => {
expect(props.onOpenCard).toHaveBeenCalledWith(expect.objectContaining({ id: 'b' }));
expect(screen.getByText('Alice')).toBeInTheDocument();
});
+
+ // A rendered card's slot is a lightbox opener, so before this button the only
+ // way to redo the one card you disliked was its drawer or the whole deck.
+ it('re-renders one card on the options the bar above is configured with', () => {
+ const props = renderGrid();
+ const reRender = screen.getByRole('button', { name: 'Re-render Card b on Local · flux2-klein-9b · 1096×1536' });
+ fireEvent.click(reRender);
+ expect(props.onRenderCard).toHaveBeenCalledWith(expect.objectContaining({ id: 'b' }));
+ // A card that has never rendered gets the same button, worded for a first run.
+ expect(screen.getByRole('button', { name: 'Render Card a on Local · flux2-klein-9b · 1096×1536' })).toBeEnabled();
+ });
+
+ it('names why a card cannot be rendered rather than showing a bare dead icon', () => {
+ renderGrid();
+ // No prompt, and already rendering: both fixable, neither by this button.
+ expect(screen.getByRole('button', { name: 'Write a prompt for Card e before rendering it' })).toBeDisabled();
+ expect(screen.getByRole('button', { name: 'Card c is rendering' })).toBeDisabled();
+ });
+
+ it('stands every card button down while the local runtime is unavailable', () => {
+ renderGrid({ renderTarget: renderTarget({ blocked: true }) });
+ const blocked = screen.getAllByRole('button', { name: /the local image runtime is unavailable/ });
+ // Every card except the promptless one and the in-flight one, which each
+ // keep their own more specific reason.
+ expect(blocked).toHaveLength(3);
+ blocked.forEach((b) => expect(b).toBeDisabled());
+ });
});
diff --git a/client/src/components/decks/DeckRenderControls.jsx b/client/src/components/decks/DeckRenderControls.jsx
index 3a34ebf481..88116f79f6 100644
--- a/client/src/components/decks/DeckRenderControls.jsx
+++ b/client/src/components/decks/DeckRenderControls.jsx
@@ -6,12 +6,9 @@ import CollapsibleSection from '../ui/CollapsibleSection';
import FormField from '../ui/FormField';
import DeckLlmPinPicker from './DeckLlmPinPicker';
import useFieldDraft from '../../hooks/useFieldDraft';
-import useImageRenderSettings from '../../hooks/useImageRenderSettings';
-import useLocalImageRuntime from '../../hooks/useLocalImageRuntime';
import {
DECK_CARD_SIZE, DECK_CARD_SIZE_BY_KIND, DECK_CARD_SIZE_MAX, DECK_CARD_SIZE_MIN,
} from '../../lib/decks';
-import { IMAGE_GEN_MODE, IMAGE_RUNTIME_READINESS, RENDER_TARGET, modeLabel } from '../../lib/imageGenBackends';
import { clampImageEdge } from '../../lib/imageGenResolutions';
import { pluralize } from '../../lib/textUtils';
@@ -31,11 +28,16 @@ const SIZE_BOUNDS = { min: DECK_CARD_SIZE_MIN, max: DECK_CARD_SIZE_MAX, step: 8
* resting state of a fully-prompted deck, which is exactly the state that
* looked broken. The accent button is whichever step is the next one to take,
* so the deck always points at its own next action.
+ *
+ * `renderTarget` is the page's resolved `useDeckRenderTarget(deck)` — the same
+ * object the card grid renders its per-card button from, so the options named
+ * here and the options one card re-renders on cannot drift apart.
*/
export default function DeckRenderControls({
- deck, completion, onPatch, onGeneratePrompts, onRenderMissing, onRenderAll, generating = false, rendering = false,
+ deck, completion, renderTarget, onPatch, onGeneratePrompts, onRenderMissing, onRenderAll,
+ generating = false, rendering = false,
}) {
- const { imageCfg, backends } = useImageRenderSettings({ record: deck, target: RENDER_TARGET.DECK });
+ const { backends, size, summary: renderSummary, localRuntime, blocked: runtimeBlocked } = renderTarget;
const total = completion?.total || 0;
const prompted = completion?.prompted || 0;
const rendered = completion?.rendered || 0;
@@ -44,25 +46,6 @@ export default function DeckRenderControls({
const unprompted = Math.max(0, total - prompted);
const busy = generating || rendering;
const promptsAreTheNextStep = unprompted > 0;
- const size = deck.cardSize || DECK_CARD_SIZE;
- // What this deck will actually render on, in the order a sentence wants it.
- // Formatted once: the collapsed header and the expanded note say the same
- // three facts, and a fourth would otherwise have to be added to both.
- const model = imageCfg.cloudModel || imageCfg.modelId;
- const renderFacts = backends.length
- ? [modeLabel(imageCfg.mode), model, `${size.width}×${size.height}`].filter(Boolean)
- : [];
- // `backends` is empty until the settings fetch lands, and until then imageCfg
- // is the UNRESOLVED placeholder (local + the install default) — probing on
- // that asks about the wrong model, and about a local runtime a cloud-pinned
- // deck never touches. Wait for the real answer.
- const rendersLocally = backends.length > 0 && imageCfg.mode === IMAGE_GEN_MODE.LOCAL;
- const localRuntime = useLocalImageRuntime(rendersLocally ? (imageCfg.modelId || null) : null);
- // Queueing 79 cards against a runtime the server will refuse is the reported
- // complaint one step earlier than the error message, so the buttons stand down
- // while it is unavailable. An unknown verdict does NOT block — a probe that
- // could not answer must not be able to lock the deck out of rendering.
- const runtimeBlocked = localRuntime.runtime?.readiness === IMAGE_RUNTIME_READINESS.UNAVAILABLE;
return (
<div className="bg-port-card border border-port-border rounded-md p-3 space-y-3">
@@ -75,7 +58,7 @@ export default function DeckRenderControls({
icon={Sliders}
id="deck-render-options"
label="Render options"
- summary={renderFacts.join(' · ')}
+ summary={renderSummary}
buttonClassName="min-h-[38px]"
bodyClassName="space-y-3 pt-2"
>
@@ -91,9 +74,9 @@ export default function DeckRenderControls({
<CardSize kind={deck.kind} size={size} onPatch={onPatch} />
{/* What an "Auto" pin and a blank model actually resolve to — the
controls above name the PIN, this names the outcome. */}
- {renderFacts.length ? (
+ {renderSummary ? (
<p className="text-[11px] text-gray-500">
- Renders on <span className="text-gray-300">{renderFacts.join(' · ')}</span>
+ Renders on <span className="text-gray-300">{renderSummary}</span>
</p>
) : null}
</CollapsibleSection>
diff --git a/client/src/components/decks/DeckRenderControls.test.jsx b/client/src/components/decks/DeckRenderControls.test.jsx
index a009e00f8a..efa796960b 100644
--- a/client/src/components/decks/DeckRenderControls.test.jsx
+++ b/client/src/components/decks/DeckRenderControls.test.jsx
@@ -3,26 +3,17 @@ import { act, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import DeckRenderControls from './DeckRenderControls';
-// The backend row and the LLM pin both fetch provider/settings state; this
-// suite is about the render-options panel, the batch actions, and the notes
-// that explain them.
-vi.mock('../../hooks/useImageRenderSettings', () => ({
- default: () => ({
- imageCfg: { mode: 'local', modelId: 'flux2-klein-9b' },
- backends: [{ id: 'local', label: 'Local' }],
- }),
-}));
+// The LLM pin fetches provider state; this suite is about the render-options
+// panel, the batch actions, and the notes that explain them.
vi.mock('./DeckLlmPinPicker', () => ({ default: () => <div /> }));
// The pin row probes the local catalog + the install's model pin itself, so the
// deck page threads neither through.
-const localRuntime = vi.hoisted(() => ({ value: { readiness: 'ready', modelId: 'flux2-klein-9b', model: 'FLUX.2 Klein 9B', runtimeLabel: 'Shared torch runtime', reason: null, remedy: null } }));
vi.mock('../../services/api', () => ({
listImageModels: vi.fn().mockResolvedValue([
{ id: 'flux2-klein-9b', name: 'FLUX.2 Klein 9B' },
{ id: 'qwen-image', name: 'Qwen-Image' },
]),
getSettings: vi.fn().mockResolvedValue({ imageGen: { local: { modelId: 'flux2-klein-9b' } } }),
- getImageGenStatus: vi.fn(async () => localRuntime.value),
}));
// The install modal opens its own SSE stream; this suite is about whether the
// render bar surfaces the runtime verdict and its fix, not about installing.
@@ -33,6 +24,18 @@ const deck = {
cardSize: { width: 1096, height: 1536 },
};
const completion = (over) => ({ total: 79, prompted: 0, rendered: 0, inFlight: 0, failed: 0, percent: 0, ...over });
+// The page resolves the render target once (`useDeckRenderTarget`) and hands
+// the same object to the bar and the grid, so the bar takes it as a prop.
+const ready = { readiness: 'ready', modelId: 'flux2-klein-9b', model: 'FLUX.2 Klein 9B', runtimeLabel: 'Shared torch runtime', reason: null, remedy: null };
+const renderTarget = (runtime = ready, over = {}) => ({
+ imageCfg: { mode: 'local', modelId: 'flux2-klein-9b' },
+ backends: [{ id: 'local', label: 'Local' }],
+ size: deck.cardSize,
+ summary: 'Local · flux2-klein-9b · 1096×1536',
+ localRuntime: { runtime, loading: false, refresh: vi.fn() },
+ blocked: runtime?.readiness === 'unavailable',
+ ...over,
+});
// Async so the mount's own settings fetch settles here rather than surfacing as
// an act() warning in whichever case happens to run first.
@@ -40,6 +43,7 @@ const renderControls = async (over = {}) => {
const props = {
deck,
completion: completion(),
+ renderTarget: renderTarget(),
onPatch: vi.fn(),
onGeneratePrompts: vi.fn(),
onRenderMissing: vi.fn(),
@@ -85,7 +89,8 @@ describe('DeckRenderControls render options', () => {
});
it('resets to the deck kind\'s own trim, and says which that is', async () => {
- const { onPatch } = await renderControls({ deck: { ...deck, cardSize: { width: 512, height: 512 } } });
+ const smaller = { ...deck, cardSize: { width: 512, height: 512 } };
+ const { onPatch } = await renderControls({ deck: smaller, renderTarget: renderTarget(ready, { size: smaller.cardSize }) });
await openOptions();
await userEvent.click(btn(/Reset to 1096×1536/));
expect(onPatch).toHaveBeenCalledWith({ cardSize: { width: 1096, height: 1536 } });
@@ -150,18 +155,13 @@ describe('DeckRenderControls local runtime', () => {
};
it('stays silent about a healthy runtime, and leaves the render buttons alone', async () => {
- localRuntime.value = {
- readiness: 'ready', modelId: 'flux2-klein-9b', model: 'FLUX.2 Klein 9B',
- runtimeLabel: 'Shared torch runtime', reason: null, remedy: null,
- };
await renderControls({ completion: completion({ prompted: 79 }) });
expect(screen.queryByRole('button', { name: /install runtime/i })).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: /^Render all/ })).toBeEnabled();
});
it('names the broken runtime and offers its one-button fix before any render is queued', async () => {
- localRuntime.value = broken;
- await renderControls();
+ await renderControls({ renderTarget: renderTarget(broken) });
expect(screen.getByText(/not installed or healthy/i)).toBeInTheDocument();
expect(screen.getByRole('button', { name: /install runtime/i })).toBeInTheDocument();
});
@@ -169,8 +169,7 @@ describe('DeckRenderControls local runtime', () => {
// The reported complaint one step earlier than the error message: queueing a
// whole deck against a runtime the server is going to refuse.
it('stands the render buttons down while the runtime is unavailable, and says why', async () => {
- localRuntime.value = broken;
- await renderControls({ completion: completion({ prompted: 79 }) });
+ await renderControls({ completion: completion({ prompted: 79 }), renderTarget: renderTarget(broken) });
expect(screen.getByRole('button', { name: /^Render all/ })).toBeDisabled();
expect(screen.getByRole('button', { name: /^Render missing/ })).toBeDisabled();
expect(screen.getByText(/local image runtime is unavailable/i)).toBeInTheDocument();
@@ -178,8 +177,8 @@ describe('DeckRenderControls local runtime', () => {
// An unanswerable probe must not be able to lock a working deck out.
it('does not block rendering on an unknown verdict', async () => {
- localRuntime.value = { readiness: 'unknown', modelId: 'flux2-klein-9b', model: 'FLUX.2 Klein 9B', reason: 'Could not verify', remedy: null };
- await renderControls({ completion: completion({ prompted: 79 }) });
+ const unknown = { readiness: 'unknown', modelId: 'flux2-klein-9b', model: 'FLUX.2 Klein 9B', reason: 'Could not verify', remedy: null };
+ await renderControls({ completion: completion({ prompted: 79 }), renderTarget: renderTarget(unknown) });
expect(screen.getByRole('button', { name: /^Render all/ })).toBeEnabled();
});
});
diff --git a/client/src/hooks/README.md b/client/src/hooks/README.md
index 2e6c26a34e..e0fd9692ba 100644
--- a/client/src/hooks/README.md
+++ b/client/src/hooks/README.md
@@ -72,6 +72,7 @@ grep -i "what you want to do" client/src/hooks/README.md
| `usePreviewRoute` | URL-driven `[preview, setPreview]` via `?preview=<filename>`. | Any page hosting `<MediaPreview>` — gives the preview a deep-link. |
| `useImageGenQueue` | Work-scoped live queue of in-flight image renders. | Pages that show per-work image-gen queue state. |
| `useLocalImageRuntime` | The local image runtime's verdict for one model — `{ runtime, loading, refresh }` — from `GET /api/image-gen/status?mode=local&modelId=…`, the same `diagnoseLocalRuntime` the renderer refuses against. `runtime` carries `readiness`, `reason` and a one-button `remedy`. Pass `null` while the host is still resolving which model it renders on. | Any surface whose renders can be blocked by an unhealthy local runtime: pair it with `LocalRuntimeStatus` to show the verdict and its fix, and read `readiness` to stand the surface's own Render button down. |
+| `useDeckRenderTarget` | What a deck's next card render runs on — `{ backends, size, summary, localRuntime, blocked }` — resolving the `RENDER_TARGET.DECK` pin ladder, the card trim, and the local runtime's verdict in one call. | Any deck surface that queues a render or names the options it will use (the render bar, the card grid's per-card re-render) — resolve it once on the page and pass it down rather than probing per consumer. |
| `useImageRenderSettings` | Load the pipeline image-gen config once (`getSettings → readPipelineImageSettings`), failing open to `PIPELINE_IMAGE_DEFAULTS`; takes `{ record, target }` to fold that record's `imageMode`/`imageModelId` pin, then the target's `renderDefaults` pin, over the install default; returns `{ imageCfg }`. | A single-image render slot that needs the render config and doesn't already load the full settings blob. Pass `record` + `target` whenever the render belongs to a pinnable record (universe, series, sprite). |
| `useUserTimezone` | Resolve the user's configured IANA timezone (`settings.timezone`) once, falling back to the browser zone then UTC; returns the tz string. | A date-scoped surface that must derive "today" the same way the server does (POST launcher/history day keys, #2681). |
| `useSingleImageRender` | Queue-one-render / wait-for-completion jobId lifecycle: builds opts from `imageCfg`, calls `buildPrompt`, POSTs `generateImage`, tracks the `jobId` head, and runs a once-per-`(key, filename)` completion guard before `onComplete`. | Single-image render slots driven by `EntryThumbSlot`/`MediaJobThumb` (style probe, characters step). Completion SSE stays in the thumb. |
diff --git a/client/src/hooks/index.js b/client/src/hooks/index.js
index 9a460f5523..55a20a71ad 100644
--- a/client/src/hooks/index.js
+++ b/client/src/hooks/index.js
@@ -29,6 +29,7 @@ export { default as useFocusTrap } from './useFocusTrap.js';
export { default as useNoteSave } from './useNoteSave.js';
export { default as useHoverTooltip } from './useHoverTooltip.js';
export { default as useImageGenQueue } from './useImageGenQueue.js';
+export { default as useDeckRenderTarget } from './useDeckRenderTarget.js';
export { default as useImageRenderSettings } from './useImageRenderSettings.js';
export { default as useLocalImageRuntime } from './useLocalImageRuntime.js';
export { default as useUserTimezone } from './useUserTimezone.js';
diff --git a/client/src/hooks/useDeckRenderTarget.js b/client/src/hooks/useDeckRenderTarget.js
new file mode 100644
index 0000000000..de8b2f932a
--- /dev/null
+++ b/client/src/hooks/useDeckRenderTarget.js
@@ -0,0 +1,45 @@
+import useImageRenderSettings from './useImageRenderSettings';
+import useLocalImageRuntime from './useLocalImageRuntime';
+import { DECK_CARD_SIZE } from '../lib/decks';
+import { IMAGE_GEN_MODE, IMAGE_RUNTIME_READINESS, RENDER_TARGET, modeLabel } from '../lib/imageGenBackends';
+
+/**
+ * "What will this deck's next card render actually run on, and can it run at
+ * all" — the backend pin ladder resolved for `RENDER_TARGET.DECK`, the card
+ * trim, the local runtime's verdict, and a one-line `summary` naming the
+ * options, in one object.
+ *
+ * A hook rather than state inside the render bar, because the deck page has two
+ * consumers of the same answer: the render bar (which shows the options and
+ * queues batches) and the card grid (whose per-card re-render button must queue
+ * against those same options, name them, and stand down for the same reason).
+ * Resolving it once also means one settings fetch and one runtime probe per
+ * page rather than one per consumer.
+ */
+export default function useDeckRenderTarget(deck) {
+ const { imageCfg, backends } = useImageRenderSettings({ record: deck, target: RENDER_TARGET.DECK });
+ const size = deck?.cardSize || DECK_CARD_SIZE;
+ // `backends` is empty until the settings fetch lands, and until then imageCfg
+ // is the UNRESOLVED placeholder (local + the install default) — probing on
+ // that asks about the wrong model, and about a local runtime a cloud-pinned
+ // deck never touches. Wait for the real answer.
+ const resolved = backends.length > 0;
+ const rendersLocally = resolved && imageCfg.mode === IMAGE_GEN_MODE.LOCAL;
+ const localRuntime = useLocalImageRuntime(rendersLocally ? (imageCfg.modelId || null) : null);
+ // Queueing against a runtime the server will refuse is the reported complaint
+ // one step earlier than the error message, so every render affordance stands
+ // down while it is unavailable. An unknown verdict does NOT block — a probe
+ // that could not answer must not be able to lock the deck out of rendering.
+ const blocked = localRuntime.runtime?.readiness === IMAGE_RUNTIME_READINESS.UNAVAILABLE;
+
+ // What this deck will actually render on, in the order a sentence wants it.
+ // Written once: the render bar's collapsed header, its expanded note and the
+ // grid's per-card button all say the same three facts, and a fourth would
+ // otherwise have to be added to each. Empty until the fetch lands, which is
+ // also how a caller knows not to claim anything about the render yet.
+ const summary = resolved
+ ? [modeLabel(imageCfg.mode), imageCfg.cloudModel || imageCfg.modelId, `${size.width}×${size.height}`].filter(Boolean).join(' · ')
+ : '';
+
+ return { backends, size, summary, localRuntime, blocked };
+}
diff --git a/client/src/pages/DeckDetail.jsx b/client/src/pages/DeckDetail.jsx
index 348cb49ad6..be097ac5be 100644
--- a/client/src/pages/DeckDetail.jsx
+++ b/client/src/pages/DeckDetail.jsx
@@ -9,6 +9,10 @@
* `MediaJobThumb`. In-flight state lives on each card's `render` record —
* stamped optimistically when a render is queued, flipped when the slot
* settles — so a render started here or on a previous visit reads the same.
+ *
+ * The deck's render target (backend pin, card trim, local-runtime verdict)
+ * resolves once here and is handed to both the action bar and the grid, so the
+ * options the bar advertises are exactly the ones a single card re-renders on.
*/
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
@@ -27,6 +31,7 @@ import DeckCardGrid from '../components/decks/DeckCardGrid';
import DeckCardDrawer from '../components/decks/DeckCardDrawer';
import DeckStylePanel from '../components/decks/DeckStylePanel';
import DeckRenderControls from '../components/decks/DeckRenderControls';
+import useDeckRenderTarget from '../hooks/useDeckRenderTarget';
import useMounted from '../hooks/useMounted';
import useUrlParams from '../hooks/useUrlParams';
import usePreviewRoute from '../hooks/usePreviewRoute';
@@ -61,6 +66,10 @@ function DeckEditor({ id }) {
const [rendering, setRendering] = useState(false);
const [savingCard, setSavingCard] = useState(false);
const loadSeqRef = useRef(0);
+ // Resolved once for the page: the render bar names these options, the grid's
+ // per-card re-render button renders on them, and both stand down together on
+ // an unavailable local runtime. Two consumers, one settings fetch.
+ const renderTarget = useDeckRenderTarget(deck);
const load = useCallback(async () => {
const seq = ++loadSeqRef.current;
@@ -259,6 +268,7 @@ function DeckEditor({ id }) {
<DeckRenderControls
deck={deck}
completion={completion}
+ renderTarget={renderTarget}
onPatch={patchDeck}
onGeneratePrompts={generatePrompts}
onRenderMissing={() => renderBatch({ onlyMissing: true }, 'Render missing')}
@@ -280,6 +290,7 @@ function DeckEditor({ id }) {
) : (
<DeckCardGrid
deck={deck}
+ renderTarget={renderTarget}
onOpenCard={openCard}
onRenderCard={renderCard}
onPreview={(card) => previewFilename(card.primaryImageRef || card.imageRefs.at(-1))}