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
feat(writers-room): inline Backends button opens Image Gen settings drawer in storyboard Config
Adam Eivyde6849f6df3e
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex bc9a4e9c99..cbc0eb3eb4 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -28,6 +28,8 @@## Changed+- **Writers Room storyboard Config — inline "Backends" button opens the Image Gen settings drawer.** The Config tab's image gen section already had a Local/Codex backend chip strip, but the chip only appeared when more than one backend was configured — and to enable Codex `$imagegen` you had to leave the Writers Room and navigate to Settings → Image Gen. The Config tab now mirrors the pattern from `ImageGen.jsx`: a small **Backends** gear-button next to the "Image generation" header opens a slide-over `Drawer` hosting the same `<ImageGenTab />` settings UI (deep-linkable via `?settings=imagegen`). When the drawer closes, `getSettings()` is re-fetched so newly-enabled backends surface as chips immediately without a page reload. A warning row also renders when zero backends are configured, pointing the user at the Backends button. Touched: `client/src/components/writers-room/StoryboardPanel.jsx`.+- **Gemini-CLI provider model list updated to current Google releases.** Replaced the deprecated `gemini-2.5-flash-lite` with the current set: `gemini-3.1-pro` (heavy), `gemini-3-flash` (medium), `gemini-2.5-pro`, `gemini-2.5-flash` (light + default). Tier mappings remap: `defaultModel`/`lightModel` → `gemini-2.5-flash`, `mediumModel` → `gemini-3-flash`, `heavyModel` → `gemini-3.1-pro`. The hardcoded gemini-cli fallback in `brain.js` and `writersRoom/evaluator.js` (used when both `defaultModel` and `lightModel` are unset on the provider) now points to `gemini-2.5-flash` instead of `gemini-2.5-flash-lite`. Mirror change applied to the upstream `portos-ai-toolkit` `providers.sample.json` so fresh installs pick up the new defaults. Touched: `data{,sample}/providers.json`, `server/services/{brain.js,brain.test.js,writersRoom/evaluator.js}`, `../portos-ai-toolkit/src/defaults/providers.sample.json`.- **Writers Room — Adapt prompt rewritten for paragraph-grain output.** The Adapt stage was producing 8 scenes for a 4,800-word piece because the prompt told the LLM "A scene = one continuous unit of action in one location" + "Don't pad. If the natural arc is 3 scenes, return 3." That's a screenplay rule; wrong for a storyboard companion where dense beat-level cards are the whole point. Reframed "scene" as "one storyboard panel," set an explicit count anchor ("a 4,000-word piece with ~80 paragraphs should yield ~50–80 scenes, not 8"), listed when to SPLIT (default — every substantive paragraph; new visual framing; back-and-forth dialogue) vs MERGE (rare — one-sentence paragraphs depicting the same instant; pure dialogue tags), removed the "don't pad" anti-pattern, and tightened action/visualPrompt budgets since each work now has many more cards. Sluglines may repeat across consecutive same-location scenes. Touched: `data{,sample}/prompts/stages/writers-room-script.md`.diff --git a/client/src/components/writers-room/StoryboardPanel.jsx b/client/src/components/writers-room/StoryboardPanel.jsxindex 44dcd6cb98..dc7b0a745e 100644--- a/client/src/components/writers-room/StoryboardPanel.jsx+++ b/client/src/components/writers-room/StoryboardPanel.jsx@@ -1,7 +1,9 @@import { useCallback, useEffect, useMemo, useRef, useState } from 'react';+import { useSearchParams } from 'react-router-dom';import {Clapperboard, Loader2, RefreshCcw, AlertTriangle, Palette, Check, Dice5, Cpu,Users, MapPin as MapPinIcon, ArrowRight, ListTree, SlidersHorizontal, Square,+ Settings as SettingsIcon,} from 'lucide-react';import { randomSeed } from '../../lib/genUtils';import toast from '../ui/Toast';@@ -15,6 +17,8 @@ import BackendChipStrip from '../media/BackendChipStrip';import { deriveAvailableBackends, IMAGE_GEN_MODE } from '../../lib/imageGenBackends';import { timeAgo } from '../../utils/formatters';import useMounted from '../../hooks/useMounted';+import Drawer from '../Drawer';+import { ImageGenTab } from '../settings/ImageGenTab';import SceneCard from './SceneCard';import StagePromptModelPicker from './StagePromptModelPicker';import CharactersBible from './CharactersBible';@@ -79,6 +83,22 @@ export default function StoryboardPanel({onTabChange,}) {const setTab = onTabChange;+ const [searchParams, setSearchParams] = useSearchParams();+ const settingsOpen = searchParams.get('settings') === 'imagegen';+ const openImageGenSettings = useCallback(() => {+ setSearchParams((prev) => {+ const next = new URLSearchParams(prev);+ next.set('settings', 'imagegen');+ return next;+ });+ }, [setSearchParams]);+ const closeImageGenSettings = useCallback(() => {+ setSearchParams((prev) => {+ const next = new URLSearchParams(prev);+ next.delete('settings');+ return next;+ });+ }, [setSearchParams]);const [latestScript, setLatestScript] = useState(null);const [latestFailure, setLatestFailure] = useState(null);const [loading, setLoading] = useState(false);@@ -97,6 +117,16 @@ export default function StoryboardPanel({const imageStyle = work.imageStyle || EMPTY_IMAGE_STYLE;const activeDraft = (work.drafts || []).find((d) => d.id === work.activeDraftVersionId);+ // Re-runnable so the Settings drawer can refresh availableBackends/imageCfg+ // when it closes — without this, enabling Codex in the drawer wouldn't+ // surface the chip until the user reloaded the page.+ const reloadSysSettings = useCallback(async () => {+ const s = await getSettings().catch(() => ({}));+ if (!mountedRef.current) return;+ setSysSettings(s);+ setImageCfg(readWrImageSettings(s));+ }, [mountedRef]);+useEffect(() => {let cancelled = false;Promise.all([@@ -113,6 +143,17 @@ export default function StoryboardPanel({return () => { cancelled = true; };}, []);+ // When the user closes the Image Gen settings drawer, settings may have+ // changed (e.g. they enabled Codex) — reload so the chip strip reflects+ // the new state without a page refresh. Mirrors the pattern in ImageGen.jsx.+ const wasSettingsOpenRef = useRef(false);+ useEffect(() => {+ if (wasSettingsOpenRef.current && !settingsOpen) {+ reloadSysSettings();+ }+ wasSettingsOpenRef.current = settingsOpen;+ }, [settingsOpen, reloadSysSettings]);+const loadLatestScript = useCallback(async () => {setLoading(true);const list = await listWritersRoomAnalyses(work.id).catch(() => []);@@ -343,9 +384,14 @@ export default function StoryboardPanel({stylePresets={stylePresets}imageStyle={imageStyle}onStyleChange={onStyleChange}+ onOpenImageGenSettings={openImageGenSettings}/>)}</div>++ <Drawer open={settingsOpen} onClose={closeImageGenSettings} title="Image Gen Settings">+ <ImageGenTab />+ </Drawer></div>);}@@ -653,7 +699,7 @@ function BoardsTab({}// ─── Config (image gen + style + Adapt LLM) ───────────────────────────────-function ConfigTab({ imageCfg, models, availableBackends, onCfgChange, stylePresets, imageStyle, onStyleChange }) {+function ConfigTab({ imageCfg, models, availableBackends, onCfgChange, stylePresets, imageStyle, onStyleChange, onOpenImageGenSettings }) {return (<div className="px-3 py-3 space-y-4"><section className="space-y-1.5">@@ -670,7 +716,22 @@ function ConfigTab({ imageCfg, models, availableBackends, onCfgChange, stylePres<WorldStyleRow value={imageStyle} presets={stylePresets} onChange={onStyleChange} /></section><section className="space-y-1.5 pt-3 border-t border-port-border">- <div className="text-[12px] font-semibold text-gray-200">Image generation</div>+ <div className="flex items-center justify-between gap-2">+ <div className="text-[12px] font-semibold text-gray-200">Image generation</div>+ <button+ type="button"+ onClick={onOpenImageGenSettings}+ className="flex items-center gap-1 px-2 py-1 text-[10px] rounded border border-port-border text-gray-300 hover:bg-port-border/40 hover:text-white"+ title="Configure image gen backends — enable Codex $imagegen, set local Python, etc."+ >+ <SettingsIcon size={10} /> Backends+ </button>+ </div>+ {availableBackends.length === 0 && (+ <div className="text-[10px] text-port-warning bg-port-warning/10 border border-port-warning/40 rounded px-2 py-1.5">+ No image gen backend configured. Click <span className="font-medium">Backends</span> to enable Local mflux or Codex <code className="text-gray-400">$imagegen</code>.+ </div>+ )}<ImageGenSettingsRow cfg={imageCfg} models={models} availableBackends={availableBackends} onChange={onCfgChange} /></section></div>