Jelajahi Sumber

fix: pass workingTitle from Step0 to Step3 so title selection flows through

nonvioce 6 bulan lalu
induk
melakukan
08d17e2caa

+ 1 - 0
src/app/features/novel-writer/components/ChapterDraftPipeline.tsx

@@ -397,6 +397,7 @@ export default function ChapterDraftPipeline({
               loreFiles={loreFiles}
               loreFiles={loreFiles}
               embedHooks={pipelineState.embedHooks}
               embedHooks={pipelineState.embedHooks}
               manualHooks={pipelineState.manualHooks}
               manualHooks={pipelineState.manualHooks}
+              initialTitle={pipelineState.controlCard?.workingTitle}
               onComplete={handleStep3Complete}
               onComplete={handleStep3Complete}
               onBack={() => setCurrentStep(2)}
               onBack={() => setCurrentStep(2)}
               autoMode={autoMode}
               autoMode={autoMode}

+ 3 - 1
src/app/features/novel-writer/components/pipeline/Step5ReviewSubmit.tsx

@@ -23,6 +23,7 @@ interface Step5ReviewSubmitProps {
   onComplete: (chapterTitle: string) => void;
   onComplete: (chapterTitle: string) => void;
   onBack: () => void;
   onBack: () => void;
   autoMode?: boolean;
   autoMode?: boolean;
+  initialTitle?: string;
 }
 }
 
 
 function DiffViewer({
 function DiffViewer({
@@ -186,8 +187,9 @@ export default function Step5ReviewSubmit({
   onComplete,
   onComplete,
   onBack,
   onBack,
   autoMode = false,
   autoMode = false,
+  initialTitle,
 }: Step5ReviewSubmitProps) {
 }: Step5ReviewSubmitProps) {
-  const [chapterTitle, setChapterTitle] = useState(`第${chapterIndex}章`);
+  const [chapterTitle, setChapterTitle] = useState(initialTitle || `第${chapterIndex}章`);
   const [hasStartedUpdate, setHasStartedUpdate] = useState(false);
   const [hasStartedUpdate, setHasStartedUpdate] = useState(false);
   const [isSaving, setIsSaving] = useState(false);
   const [isSaving, setIsSaving] = useState(false);
   const [saveSuccess, setSaveSuccess] = useState(false);
   const [saveSuccess, setSaveSuccess] = useState(false);