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

Show thumbnails in the X story image picker on the Publish page

Claude6079cac306f3
diff --git a/client/src/components/musicVideo/PublishPostingPanel.jsx b/client/src/components/musicVideo/PublishPostingPanel.jsx
index 1d094c21c2..b7519e2b14 100644
--- a/client/src/components/musicVideo/PublishPostingPanel.jsx
+++ b/client/src/components/musicVideo/PublishPostingPanel.jsx
@@ -1,7 +1,7 @@
import { useState } from 'react';
import ConfirmButtonPair from '../ui/ConfirmButtonPair.jsx';
import { safeReadJsonStorage, safeWriteJsonStorage } from '../../lib/safeStorage.js';
-import { ExternalLink, X as XIcon, LogIn, Link as LinkIcon, Check, ChevronDown, ChevronRight, Undo2 } from 'lucide-react';
+import { ExternalLink, X as XIcon, LogIn, Link as LinkIcon, Check, ChevronDown, ChevronRight, ImageOff, Undo2 } from 'lucide-react';
import PublishCard from './PublishCard.jsx';
import { DISTROKID_GENRES, suggestDistrokidGenres } from '../../../../server/lib/distrokidGenres.js';
import { publishRowAnchor } from '../../lib/musicVideoStages.js';
@@ -58,6 +58,31 @@ function verticalCutChoices(project) {
return cuts;
}
+/** The story reply's image, picked by sight: a tile per video frame plus "No image". */
+function StoryImagePicker({ idFor, thumbnails, value, onChange }) {
+ const tile = (selected) => `relative rounded overflow-hidden border-2 aspect-video min-h-[44px] ${selected ? 'border-port-accent ring-2 ring-port-accent/40' : 'border-port-border'}`;
+ const mark = <span className="absolute top-1 right-1 rounded-full bg-port-accent text-white p-0.5" aria-hidden="true"><Check size={12} /></span>;
+ return (
+ <div className="space-y-0.5 min-w-0">
+ <span id={idFor('storyImage')} className="block text-[11px] text-port-text-muted">Image on the story reply (optional)</span>
+ <div role="radiogroup" aria-labelledby={idFor('storyImage')} className="grid grid-cols-3 sm:grid-cols-4 gap-2">
+ <button type="button" role="radio" aria-checked={!value} onClick={() => onChange('')}
+ className={`${tile(!value)} flex items-center justify-center gap-1 bg-port-bg text-xs text-port-text-muted`}>
+ <ImageOff size={14} aria-hidden="true" /> No image
+ {!value && mark}
+ </button>
+ {thumbnails.map((name, i) => (
+ <button key={name} type="button" role="radio" aria-checked={value === name} aria-label={`Video frame ${i + 1}`} title={name}
+ onClick={() => onChange(name)} className={tile(value === name)}>
+ <img src={`/data/video-thumbnails/${encodeURIComponent(name)}`} alt="" loading="lazy" className="w-full h-full object-cover" />
+ {value === name && mark}
+ </button>
+ ))}
+ </div>
+ </div>
+ );
+}
+
function TargetOptions({ target, kit, project, options, setOption, flairs, idFor, account }) {
const field = (key, label, input) => (
<div key={key} className="space-y-0.5 min-w-0">
@@ -184,11 +209,7 @@ function TargetOptions({ target, kit, project, options, setOption, flairs, idFor
return (
<div className="space-y-2">
{area('prompt', 'Prompt reply (optional, e.g. the prompt that started it)')}
- {kit.thumbnails?.length > 0 && field('storyImage', 'Image on the story reply (optional)',
- <select id={idFor('storyImage')} aria-label="Image on the story reply" value={options.storyImage || ''} onChange={(e) => setOption('storyImage', e.target.value)} className={inputCls}>
- <option value="">None</option>
- {kit.thumbnails.map((name) => <option key={name} value={name}>{name}</option>)}
- </select>)}
+ {kit.thumbnails?.length > 0 && <StoryImagePicker idFor={idFor} thumbnails={kit.thumbnails} value={options.storyImage || ''} onChange={(name) => setOption('storyImage', name)} />}
</div>
);
}
diff --git a/client/src/components/musicVideo/PublishPostingPanel.test.jsx b/client/src/components/musicVideo/PublishPostingPanel.test.jsx
index 052db1cd42..c336daff22 100644
--- a/client/src/components/musicVideo/PublishPostingPanel.test.jsx
+++ b/client/src/components/musicVideo/PublishPostingPanel.test.jsx
@@ -54,6 +54,22 @@ describe('PublishPostingPanel (#9282)', () => {
expect(publishing.prepare).toHaveBeenLastCalledWith('substack', { publication: 'other' });
});
+ it('picks the X story image from thumbnails, with No image as the default', () => {
+ const publishing = hook();
+ render(<PublishPostingPanel project={project({ thumbnails: ['t1.jpg', 't2.jpg'] })} publishing={publishing} />);
+ expandAll();
+ const picker = within(row('X thread')).getByRole('radiogroup', { name: 'Image on the story reply (optional)' });
+ expect(within(picker).getByRole('radio', { name: 'No image' })).toBeChecked();
+ expect(within(picker).getByRole('radio', { name: 'Video frame 2' }).querySelector('img')).toHaveAttribute('src', '/data/video-thumbnails/t2.jpg');
+ fireEvent.click(within(picker).getByRole('radio', { name: 'Video frame 2' }));
+ expect(within(picker).getByRole('radio', { name: 'Video frame 2' })).toBeChecked();
+ fireEvent.click(within(row('X thread')).getByRole('button', { name: 'Fill draft' }));
+ expect(publishing.prepare).toHaveBeenLastCalledWith('x', { storyImage: 't2.jpg' });
+ fireEvent.click(within(picker).getByRole('radio', { name: 'No image' }));
+ fireEvent.click(within(row('X thread')).getByRole('button', { name: 'Fill draft' }));
+ expect(publishing.prepare).toHaveBeenLastCalledWith('x', {});
+ });
+
it('lets the director pick which 9:16 cut a Shorts draft posts (#10150)', () => {
const publishing = hook();
const p = { ...project({ master: { renderHistoryId: 'r1' }, exports: [{ kind: 'vertical-9x16', filename: 'v.mp4', startSec: 10, endSec: 40 }] }),