Просмотр исходного кода

fix: remove saved notification, fix nested button in ChapterHistoryList, remove duplicate title selection

nonvioce 6 месяцев назад
Родитель
Сommit
cf47334884

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

@@ -349,7 +349,6 @@ export default function ChapterDraftPipeline({
               loreFiles={loreFiles}
               embedHooks={pipelineState.embedHooks}
               manualHooks={pipelineState.manualHooks}
-              titleCandidates={pipelineState.controlCard?.chapterTitleCandidates || []}
               onComplete={handleStep3Complete}
               onBack={() => setCurrentStep(2)}
             />

+ 6 - 3
src/app/features/novel-writer/components/ChapterHistoryList.tsx

@@ -608,9 +608,12 @@ export default function ChapterHistoryList({ projectPath }: ChapterHistoryListPr
           <ul className="divide-y divide-gray-100">
             {chapters.map((chapter) => (
               <li key={chapter.fileName}>
-                <button
+                <div
                   onClick={() => handleViewChapter(chapter)}
-                  className="w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-50 transition-colors text-left group"
+                  onKeyDown={(e) => { if (e.key === 'Enter') handleViewChapter(chapter); }}
+                  role="button"
+                  tabIndex={0}
+                  className="w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-50 transition-colors text-left group cursor-pointer"
                 >
                   {/* 章节序号徽章 */}
                   <div className="shrink-0 w-9 h-9 rounded-lg bg-indigo-100 text-indigo-600 flex items-center justify-center text-xs font-bold group-hover:bg-indigo-200 transition-colors">
@@ -675,7 +678,7 @@ export default function ChapterHistoryList({ projectPath }: ChapterHistoryListPr
                       />
                     </svg>
                   </div>
-                </button>
+                </div>
               </li>
             ))}
           </ul>

+ 0 - 13
src/app/features/novel-writer/components/NovelContextManager.tsx

@@ -104,7 +104,6 @@ export default function NovelContextManager({
   const [showPipeline, setShowPipeline] = useState(false);
   const [showCloseConfirm, setShowCloseConfirm] = useState(false);
   const [marathonMode, setMarathonMode] = useState(false);
-  const [savedNotification, setSavedNotification] = useState(false);
   const [selectedTemplateId, setSelectedTemplateId] = useState<string>(() => {
     if (typeof window !== 'undefined') {
       return localStorage.getItem(TEMPLATE_STORAGE_KEY) || PROMPT_TEMPLATES[0].id;
@@ -210,8 +209,6 @@ export default function NovelContextManager({
       setShowPipeline(false);
       try {
         await saveChapter(content, chapterTitle);
-        setSavedNotification(true);
-        setTimeout(() => setSavedNotification(false), 3000);
 
         // Background agents: RollingSummarizer every 5 chapters, MilestoneAudit every 20
         const newChapterIndex = chapters.length + 1;
@@ -445,16 +442,6 @@ export default function NovelContextManager({
         {currentPhase !== 'phase1' && currentPhase !== 'phase3' && (
           <>
           <div className="flex-1 flex flex-col">
-            {/* Saved notification */}
-            {savedNotification && (
-              <div className="mx-5 mt-3 px-4 py-2 bg-green-50 border border-green-200 rounded-lg text-sm text-green-700 flex items-center gap-2 shrink-0">
-                <svg className="w-4 h-4 text-green-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
-                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
-                </svg>
-                已自动保存
-              </div>
-            )}
-
             {/* Prompt template selector */}
             <div className="px-5 py-3 bg-white border-b border-gray-100 shrink-0">
               <div className="flex items-center gap-2">

+ 0 - 16
src/app/features/novel-writer/components/pipeline/Step5ReviewSubmit.tsx

@@ -20,7 +20,6 @@ interface Step5ReviewSubmitProps {
   loreFiles: WorldLoreFile[];
   embedHooks: { id: string; type: string; description: string; embedMethod: string }[];
   manualHooks: string[];
-  titleCandidates: string[];
   onComplete: (chapterTitle: string) => void;
   onBack: () => void;
 }
@@ -183,7 +182,6 @@ export default function Step5ReviewSubmit({
   loreFiles,
   embedHooks,
   manualHooks,
-  titleCandidates,
   onComplete,
   onBack,
 }: Step5ReviewSubmitProps) {
@@ -379,20 +377,6 @@ const handleSaveChapter = useCallback(async () => {
           className="w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 bg-white"
           placeholder={`第${chapterIndex}章`}
         />
-        {titleCandidates.length > 0 && (
-          <div className="flex flex-wrap gap-1.5 mt-2">
-            <span className="text-xs text-gray-400">候选标题:</span>
-            {titleCandidates.map((t, i) => (
-              <button
-                key={i}
-                onClick={() => setChapterTitle(t)}
-                className="px-2 py-0.5 text-xs border border-indigo-200 rounded-full text-indigo-600 hover:bg-indigo-50 transition-colors"
-              >
-                {t}
-              </button>
-            ))}
-          </div>
-        )}
       </div>
 
       {hookWarning && (