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

fix: keep the definitions SVG renderer internal (#9567)

Adam Eivy325614c47a12
diff --git a/server/services/musicVideo/castAndSetsDefinitions.js b/server/services/musicVideo/castAndSetsDefinitions.js
index 845a8aae6b..70a8916ce0 100644
--- a/server/services/musicVideo/castAndSetsDefinitions.js
+++ b/server/services/musicVideo/castAndSetsDefinitions.js
@@ -294,7 +294,7 @@ function partMarkup(part, character, override = {}) {
* named expression or pose applied. Input is re-validated, so a hand-edited or
* stale record can never smuggle markup into the sheet.
*/
-export function renderCharacterSvg(character, stateName = null, { size = 160 } = {}) {
+function renderCharacterSvg(character, stateName = null, { size = 160 } = {}) {
const safe = normalizeDefinitions({ characters: [character] })?.characters?.[0];
if (!safe) return '';
const key = slug(stateName);
diff --git a/server/services/musicVideo/castAndSetsDefinitions.test.js b/server/services/musicVideo/castAndSetsDefinitions.test.js
index a527d6c15d..08ed1b7b03 100644
--- a/server/services/musicVideo/castAndSetsDefinitions.test.js
+++ b/server/services/musicVideo/castAndSetsDefinitions.test.js
@@ -6,7 +6,7 @@
*/
import { describe, it, expect } from 'vitest';
-import { normalizeDefinitions, renderCharacterSvg, renderDefinitionsSection } from './castAndSetsDefinitions.js';
+import { normalizeDefinitions, renderDefinitionsSection } from './castAndSetsDefinitions.js';
const character = () => ({
id: 'Boat',
@@ -51,15 +51,15 @@ describe('normalizeDefinitions', () => {
});
});
-describe('renderCharacterSvg / renderDefinitionsSection', () => {
+describe('renderDefinitionsSection', () => {
it('draws the base pose and applies a named expression to the right part', () => {
- const base = renderCharacterSvg(character());
- const proud = renderCharacterSvg(character(), 'proud');
+ const tiles = renderDefinitionsSection({ characters: [character()] }).split('<figure').slice(1);
+ const [base, proud] = tiles;
expect(base).toContain('<svg viewBox="0 0 200 200"');
expect(base).toContain('fill="#f5f0e6"');
expect(base).not.toContain('rotate(-10');
expect(proud).toContain('rotate(-10 100 120)');
- // The hidden part is not drawn in that expression.
+ // The part the expression hides is not drawn in it.
expect(base).toContain('<circle');
expect(proud).not.toContain('<circle');
});