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

DistroKid AI disclosure ticks the parts in DistroKid's new modal and saves it

[._.]/ Adam Eivy18b87c4dac72
diff --git a/client/src/lib/distrokidForm.test.js b/client/src/lib/distrokidForm.test.js
index d1e0437f3f..a27a4eea7a 100644
--- a/client/src/lib/distrokidForm.test.js
+++ b/client/src/lib/distrokidForm.test.js
@@ -92,6 +92,34 @@ describe('DistroKid form recipe', () => {
expect(checked('ai_gate_')).toBe('0');
});
+ it("ticks the parts in DistroKid's modal, whose audio boxes have no name, and saves it", () => {
+ // The live shape since October 2026: a SweetAlert modal; closing it without Save resets the gate.
+ document.body.innerHTML = `
+ ${radios('ai_gate_ef56', ['0', '1'])}
+ <div class="swal2-popup ai-credits-swal-modal">
+ <label><input type="checkbox" class="distroAiLyrics" name="ai_lyrics_ef56" value="1">Lyrics (written by AI)</label>
+ <label><input type="checkbox" class="distroAiMusic" name="ai_music_ef56" value="1">Music (composed by AI)</label>
+ <label><input type="checkbox" class="distroAiRecordingScope" value="full">All of the audio</label>
+ <label><input type="checkbox" class="distroAiRecordingScope" value="partial">Part of the audio</label>
+ ${radios('ai_partial_audio_type_ef56', ['vocals', 'instruments'])}
+ <button class="swal2-cancel">Cancel</button><button class="swal2-confirm">Save</button>
+ </div>`;
+ let saved = 0;
+ document.querySelector('.swal2-confirm').addEventListener('click', () => { saved += 1; });
+ expect(discloseDistrokidAi({ step: 'parts', ai: { lyrics: false, music: true, vocals: true } })).toBe(true);
+ const box = (sel) => document.querySelector(sel).checked;
+ expect([box('.distroAiLyrics'), box('.distroAiMusic'), box('[value=full]'), box('[value=partial]')]).toEqual([false, true, true, false]);
+ expect(saved).toBe(1);
+ });
+
+ it('does not save the modal when a part it needed is missing', () => {
+ document.body.innerHTML = `<div class="ai-credits-swal-modal"><input type="checkbox" name="ai_music_ef56"><button class="swal2-confirm">Save</button></div>`;
+ let saved = 0;
+ document.querySelector('.swal2-confirm').addEventListener('click', () => { saved += 1; });
+ expect(discloseDistrokidAi({ step: 'parts', ai: { lyrics: false, music: true, vocals: true } })).toBe(false);
+ expect(saved).toBe(0);
+ });
+
it('leaves no paid extra ticked, and names the ones it unticked', () => {
expect(untickDistrokidExtras()).toEqual({ unticked: ['Social Media Pack', 'Leave a Legacy'], stillTicked: [] });
expect(document.querySelectorAll('input[name=extras]:checked')).toHaveLength(0);
diff --git a/server/lib/distrokidForm.js b/server/lib/distrokidForm.js
index 7ad761eb5b..a934b1715a 100644
--- a/server/lib/distrokidForm.js
+++ b/server/lib/distrokidForm.js
@@ -127,7 +127,8 @@ export function fillDistrokidFields(plan) {
* The AI disclosure, in two steps because the parts appear once the gate says
* yes. `{ step: 'gate', ai }` answers the gate; `{ step: 'parts', ai }` ticks
* lyrics, music, and all of the audio (AI vocals) or part of it (AI
- * instruments under a human voice). `ai`: { lyrics, music, vocals }.
+ * instruments under a human voice), then presses the parts modal's Save when
+ * DistroKid shows them in one. `ai`: { lyrics, music, vocals }.
* Resolves true when every field it needed was there.
*/
export function discloseDistrokidAi({ step, ai }) {
@@ -143,8 +144,10 @@ export function discloseDistrokidAi({ step, ai }) {
gate.scrollIntoView?.({ block: 'center' });
return set(gate, true);
}
- const full = document.querySelector('input[name^="ai_"][value="full"]');
- const partial = document.querySelector('input[name^="ai_"][value="partial"]');
+ // The parts now open in a SweetAlert modal whose audio-scope boxes carry no name.
+ const scope = (value) => document.querySelector(`input[name^="ai_"][value="${value}"], input.distroAiRecordingScope[value="${value}"]`);
+ const full = scope('full');
+ const partial = scope('partial');
const partialAudio = !ai.vocals && ai.music;
let audio = set(full, !!ai.vocals) && set(partial, partialAudio);
if (audio && partialAudio) {
@@ -160,9 +163,13 @@ export function discloseDistrokidAi({ step, ai }) {
audio = set(kinds.find((k) => k.value === 'instruments'), true);
}
}
- return set(document.querySelector('input[name^="ai_lyrics_"]'), !!ai.lyrics)
+ const parts = set(document.querySelector('input[name^="ai_lyrics_"]'), !!ai.lyrics)
&& set(document.querySelector('input[name^="ai_music_"]'), !!ai.music)
&& audio;
+ // The modal keeps nothing until Save, and closing it any other way resets the gate to No.
+ const save = document.querySelector('.ai-credits-swal-modal .swal2-confirm');
+ if (parts && save) save.click();
+ return parts;
}
/**