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: preview a mood board's poster on click and lead the collage grid with it
[._.]/ Adam Eivya5f70ca9d4d8
diff --git a/client/src/components/moodBoard/MoodBoardStylePanel.jsx b/client/src/components/moodBoard/MoodBoardStylePanel.jsxindex a5fbba5eec..e1c027987c 100644--- a/client/src/components/moodBoard/MoodBoardStylePanel.jsx+++ b/client/src/components/moodBoard/MoodBoardStylePanel.jsx@@ -10,7 +10,8 @@*/import { useCallback, useEffect, useRef, useState } from 'react';import socket from '../../services/socket';-import { ScanEye, Sparkles, ImageIcon, ChevronDown, ChevronRight } from 'lucide-react';+import { ScanEye, Sparkles, ImageIcon, ChevronDown, ChevronRight, X } from 'lucide-react';+import Modal from '../ui/Modal';import ProviderModelSelector from '../ProviderModelSelector';import MediaJobThumb from '../pipeline/MediaJobThumb';import toast from '../ui/Toast';@@ -60,6 +61,7 @@ export default function MoodBoardStylePanel({ board, onBoardChange }) {const jobRunningRef = useRef(false);jobRunningRef.current = jobRunning;const [savingStyle, setSavingStyle] = useState(false);+ const [previewOpen, setPreviewOpen] = useState(false);const [effort, setEffort] = useState('');const [rendererMode, setRendererMode] = useState('');const capturedKeyRef = useRef(null);@@ -278,7 +280,14 @@ export default function MoodBoardStylePanel({ board, onBoardChange }) {{jobId ? (<MediaJobThumb jobId={jobId} onFilename={handleComplete} size="fill" label="Board poster" />) : posterSrc ? (- <img src={posterSrc} alt="Board poster" className="w-full h-full object-cover" />+ <button+ type="button"+ onClick={() => setPreviewOpen(true)}+ aria-label="Preview board poster"+ className="block w-full h-full cursor-zoom-in"+ >+ <img src={posterSrc} alt="Board poster" className="w-full h-full object-cover" />+ </button>) : (<div className="w-full h-full flex flex-col items-center justify-center text-gray-600 gap-1"><ImageIcon className="w-6 h-6" aria-hidden="true" />@@ -404,6 +413,31 @@ export default function MoodBoardStylePanel({ board, onBoardChange }) {</div></div></div>+ {posterSrc ? (+ <Modal+ open={previewOpen}+ onClose={() => setPreviewOpen(false)}+ size="3xl"+ backdropClassName="bg-black/85"+ ariaLabelledBy="board-poster-preview-title"+ panelClassName="overflow-hidden bg-port-card border border-port-border rounded-xl shadow-2xl flex flex-col"+ >+ <header className="flex items-center justify-between gap-3 px-4 py-3 border-b border-port-border">+ <h2 id="board-poster-preview-title" className="text-sm font-semibold text-white">Board poster</h2>+ <button+ type="button"+ onClick={() => setPreviewOpen(false)}+ className="p-1.5 rounded text-gray-400 hover:text-white hover:bg-port-border/50 min-h-[44px] min-w-[44px] flex items-center justify-center"+ aria-label="Close"+ >+ <X className="w-4 h-4" />+ </button>+ </header>+ <div className="min-h-0 flex-1 overflow-auto bg-port-bg p-2 flex items-center justify-center">+ <img src={posterSrc} alt="Board poster preview" className="max-w-full max-h-full object-contain" />+ </div>+ </Modal>+ ) : null}</section>);}diff --git a/client/src/components/moodBoard/MoodBoardStylePanel.test.jsx b/client/src/components/moodBoard/MoodBoardStylePanel.test.jsxindex 5ca0355126..72b2a73d1c 100644--- a/client/src/components/moodBoard/MoodBoardStylePanel.test.jsx+++ b/client/src/components/moodBoard/MoodBoardStylePanel.test.jsx@@ -147,4 +147,13 @@ describe('MoodBoardStylePanel', () => {expect(screen.getByAltText('Board poster').getAttribute('src')).toBe('/data/images/poster.png');expect(screen.getByRole('button', { name: 'Regenerate poster' })).toBeEnabled();});++ it('opens the poster in a preview modal when clicked', async () => {+ render(<MoodBoardStylePanel board={{ ...analyzedBoard, posterImageRef: 'poster.png' }} onBoardChange={vi.fn()} />);+ expect(screen.queryByAltText('Board poster preview')).toBeNull();+ await userEvent.click(screen.getByRole('button', { name: 'Preview board poster' }));+ expect(screen.getByAltText('Board poster preview').getAttribute('src')).toBe('/data/images/poster.png');+ await userEvent.click(screen.getByRole('button', { name: 'Close' }));+ expect(screen.queryByAltText('Board poster preview')).toBeNull();+ });});diff --git a/server/services/moodBoard/collage.js b/server/services/moodBoard/collage.jsindex 61087112ee..9e4bb2efdf 100644--- a/server/services/moodBoard/collage.js+++ b/server/services/moodBoard/collage.js@@ -2,7 +2,8 @@* Mood Board — collage compilation + video frame extraction.** `composeBoardCollage` flattens every visual on a board into ONE near-square- * grid image saved to the gallery. Image pins contribute themselves; video pins+ * grid image saved to the gallery, led by the board poster when it has one.+ * Image pins contribute themselves; video pins* are sampled into N evenly spaced frames, each becoming a cell. Text pins and* pins with no local file (external URLs not yet re-hosted) are skipped and* counted. `extractItemFrames` does the same sampling for a single video pin and@@ -136,12 +137,19 @@ export async function composeBoardCollage(boardId, { framesPerVideo, addFramesToconst imported = [];let skipped = 0;+ // The board's poster is its cover image: it leads the grid. A pin of the+ // same file is not repeated.+ const posterName = typeof board.posterImageRef === 'string' ? assetBasename(board.posterImageRef.trim()) : null;+ const posterPath = posterName ? safeUnder(PATHS.images, posterName) : null;+ if (posterPath) sources.push(posterPath);+for (const item of items) {if (item.type === 'image') {const local = boardItemLocalImage(item);const dir = local?.kind === 'image' ? PATHS.images : local?.kind === 'image-ref' ? PATHS.imageRefs : null;const path = dir ? safeUnder(dir, local.filename) : null;- if (path) sources.push(path); else skipped += 1;+ if (!path) skipped += 1;+ else if (path !== posterPath) sources.push(path);} else if (item.type === 'video') {const file = videoFilename(item);if (!file) { skipped += 1; continue; }