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

Cover art switch follows the server when a restyle re-letters the cover

Claudeda64be806d2c
diff --git a/client/src/components/musicVideo/CoverArtPanel.jsx b/client/src/components/musicVideo/CoverArtPanel.jsx
index 2fb0deee27..f3f83be555 100644
--- a/client/src/components/musicVideo/CoverArtPanel.jsx
+++ b/client/src/components/musicVideo/CoverArtPanel.jsx
@@ -1,4 +1,4 @@
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { Download, Image as ImageIcon, Images, Sparkles } from 'lucide-react';
import GalleryImagePicker from '../imageGen/GalleryImagePicker';
@@ -45,6 +45,8 @@ export default function CoverArtPanel({ project, publishKit }) {
const [notes, setNotes] = useState('');
const [adjustImage, setAdjustImage] = useState(false);
const [lettering, setLettering] = useState(art.lettering !== false);
+ // Follow the server: a restyle or a new photo turns lettering back on there.
+ useEffect(() => { setLettering(art.lettering !== false); }, [art.lettering]);
const [pickerOpen, setPickerOpen] = useState(false);
const busy = publishKit.composing || publishKit.designing || publishKit.requestingImage;
const chosen = art.source ? `${art.source.kind}:${art.source.filename}` : null;
diff --git a/client/src/components/musicVideo/CoverArtPanel.test.jsx b/client/src/components/musicVideo/CoverArtPanel.test.jsx
index 644a0b6abc..d64b74fc6e 100644
--- a/client/src/components/musicVideo/CoverArtPanel.test.jsx
+++ b/client/src/components/musicVideo/CoverArtPanel.test.jsx
@@ -36,6 +36,16 @@ describe('CoverArtPanel', () => {
expect(publishKit.composeCover).toHaveBeenCalledWith(expect.objectContaining({ lettering: false }));
});
+ it('turns the switch back on when a restyle or a new photo re-letters the cover on the server', () => {
+ const publishKit = kit();
+ const { rerender } = render(<CoverArtPanel project={project({ source: { kind: 'image', filename: 'finished.png' }, lettering: false })} publishKit={publishKit} />);
+ expect(screen.getByLabelText(/Set the title and artist on the image/)).not.toBeChecked();
+ rerender(<CoverArtPanel project={project({ source: { kind: 'image', filename: 'finished.png' }, lettering: true })} publishKit={publishKit} />);
+ expect(screen.getByLabelText(/Set the title and artist on the image/)).toBeChecked();
+ fireEvent.click(screen.getByRole('button', { name: 'Apply to the cover' }));
+ expect(publishKit.composeCover).toHaveBeenCalledWith(expect.objectContaining({ lettering: true }));
+ });
+
it('keeps an image picked from history among the sources, marked as the current one', () => {
const sources = coverArtSources(project({ source: { kind: 'image', filename: 'history-example.png' } }));
expect(sources[0]).toMatchObject({ kind: 'image', filename: 'history-example.png', label: 'Current cover image' });