feat: add drag and drop errors

This commit is contained in:
2025-11-03 15:26:09 +01:00
parent 74053b695a
commit c361505175
6 changed files with 283 additions and 85 deletions
@@ -21,6 +21,7 @@ import SongTo from "./SongTo";
import SpecificityContext from "./SpecificityContext";
const MAX_STEP_INDEX = 8;
const CUSTOM_SANITIZE_OPTIONS = { autoInjectPreChorus: false };
const CreateLyricsWithAi = () => {
const { selectedProject } = useUser();
@@ -133,10 +134,10 @@ const CreateLyricsWithAi = () => {
// Structure personnalisée: prioriser selections.customStructure puis config.structure
const savedCustom = Array.isArray(sel.customStructure)
? sanitizeStructureList(sel.customStructure)
? sanitizeStructureList(sel.customStructure, CUSTOM_SANITIZE_OPTIONS)
: null;
const cfgStructure = Array.isArray(cfg.structure)
? sanitizeStructureList(cfg.structure)
? sanitizeStructureList(cfg.structure, CUSTOM_SANITIZE_OPTIONS)
: null;
const fallbackStructure =
savedCustom && savedCustom.length ? savedCustom : cfgStructure;
@@ -201,7 +202,7 @@ const CreateLyricsWithAi = () => {
: style || undefined;
const sanitizedCustom =
Array.isArray(customStructure) && customStructure.length > 0
? sanitizeStructureList(customStructure)
? sanitizeStructureList(customStructure, CUSTOM_SANITIZE_OPTIONS)
: [];
const sanitizedParsed = Array.isArray(parsedStructure)
? sanitizeStructureList(parsedStructure)