feat: add image selection to Assets step and remove duplicate media library

This commit is contained in:
Ender 2025-10-24 20:59:42 +02:00
parent b3418e3c96
commit cdbc5062ca
4 changed files with 11 additions and 7 deletions

View File

@ -226,6 +226,8 @@ export default function EditorShell({ onLogout, initialPostId, onBack }: { onLog
} }
}} }}
onSetFeature={(url: string) => setMeta(m => ({ ...m, featureImage: url }))} onSetFeature={(url: string) => setMeta(m => ({ ...m, featureImage: url }))}
selectedKeys={genImageKeys}
onToggleSelect={toggleGenImage}
/> />
</StepContainer> </StepContainer>
)} )}

View File

@ -131,8 +131,7 @@ export default function MediaLibrary({
return ( return (
<Paper sx={{ p: 2 }}> <Paper sx={{ p: 2 }}>
<Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ mb: 2 }}> <Stack direction="row" justifyContent="flex-end" alignItems="center" sx={{ mb: 2 }}>
<Typography variant="h6">Media Library</Typography>
<Stack direction="row" spacing={1} alignItems="center"> <Stack direction="row" spacing={1} alignItems="center">
<TextField <TextField
size="small" size="small"

View File

@ -10,12 +10,16 @@ export default function StepAssets({
onInsertAtCursor, onInsertAtCursor,
onInsertImage, onInsertImage,
onSetFeature, onSetFeature,
selectedKeys,
onToggleSelect,
}: { }: {
draftId?: string | null; draftId?: string | null;
postClips: Clip[]; postClips: Clip[];
onInsertAtCursor: (html: string) => void; onInsertAtCursor: (html: string) => void;
onInsertImage: (url: string) => void; onInsertImage: (url: string) => void;
onSetFeature: (url: string) => void; onSetFeature: (url: string) => void;
selectedKeys?: string[];
onToggleSelect?: (key: string) => void;
}) { }) {
return ( return (
<Box sx={{ display: 'grid', gap: 2 }}> <Box sx={{ display: 'grid', gap: 2 }}>
@ -33,6 +37,9 @@ export default function StepAssets({
onInsert={onInsertImage} onInsert={onInsertImage}
onSetFeature={onSetFeature} onSetFeature={onSetFeature}
showSetFeature showSetFeature
selectionMode
selectedKeys={selectedKeys}
onToggleSelect={onToggleSelect}
/> />
</Box> </Box>
</Stack> </Stack>

View File

@ -1,5 +1,4 @@
import { Box, Stack, TextField, Typography } from '@mui/material'; import { Box, Stack, TextField, Typography } from '@mui/material';
import MediaLibrary from '../MediaLibrary';
import SelectedImages from './SelectedImages'; import SelectedImages from './SelectedImages';
import CollapsibleSection from './CollapsibleSection'; import CollapsibleSection from './CollapsibleSection';
import type { Clip } from './StepAssets'; import type { Clip } from './StepAssets';
@ -46,10 +45,7 @@ export default function StepGenerate({
<SelectedImages imageKeys={genImageKeys} onRemove={onToggleGenImage} /> <SelectedImages imageKeys={genImageKeys} onRemove={onToggleGenImage} />
</CollapsibleSection> </CollapsibleSection>
{/* Media library */} {/* Media library removed: selection now happens in Assets step */}
<CollapsibleSection title="Media Library">
<MediaLibrary selectionMode selectedKeys={genImageKeys} onToggleSelect={onToggleGenImage} />
</CollapsibleSection>
{/* Prompt */} {/* Prompt */}
<CollapsibleSection title="AI Prompt"> <CollapsibleSection title="AI Prompt">