Fix syntax error: re-introduce 'if' statement in LayoutComponents after backend logic removal

This commit is contained in:
Gemini AI
2025-12-20 17:33:52 +04:00
Unverified
parent a4b12251fd
commit f35f7bd6c5

View File

@@ -2472,6 +2472,7 @@ Format: { "ideas": [{ "title": "Short Title", "subtitle": "One line", "tag": "To
} }
if (isQaFailureArtifact) {
// --- REPAIR MODE (F3: Retention & Match) --- // --- REPAIR MODE (F3: Retention & Match) ---
// "Broken frontend is treated as a REPAIR task" // "Broken frontend is treated as a REPAIR task"
const originalIntent = state.activeProject?.originalPrompt || "Unknown Intent"; const originalIntent = state.activeProject?.originalPrompt || "Unknown Intent";
@@ -2557,22 +2558,22 @@ Brief plan starting with '[PLAN]'.`;
// We ignore overrideInput / one-shot triggers for the initial build request. // We ignore overrideInput / one-shot triggers for the initial build request.
requestKind = 'plan'; requestKind = 'plan';
systemPrompt = `[SYSTEM INSTRUCTION]: Propose an implementation plan starting with '[PLAN]'. DO NOT output code yet.`; systemPrompt = `[SYSTEM INSTRUCTION]: Propose an implementation plan starting with '[PLAN]'. DO NOT output code yet.`;
} }
if (state.preferredFramework) { if (state.preferredFramework) {
systemPrompt += `\n\n[USER PREFERENCE]: The user has explicitly requested to use the "${state.preferredFramework}" framework. You MUST prioritize this framework, along with its standard ecosystem (e.g. if React, use typical React libs; if Tailwind, use utility classes).`; systemPrompt += `\n\n[USER PREFERENCE]: The user has explicitly requested to use the "${state.preferredFramework}" framework. You MUST prioritize this framework, along with its standard ecosystem (e.g. if React, use typical React libs; if Tailwind, use utility classes).`;
} }
// IMMEDIATE FEEDBACK: If we are planning, switch to Plan tab immediately so user sees the stream // IMMEDIATE FEEDBACK: If we are planning, switch to Plan tab immediately so user sees the stream
if (requestKind === 'plan') { if (requestKind === 'plan') {
dispatch({ type: 'TRANSITION', to: OrchestratorState.Planning }); dispatch({ type: 'TRANSITION', to: OrchestratorState.Planning });
dispatch({ type: 'SET_TAB', tab: TabId.Plan }); dispatch({ type: 'SET_TAB', tab: TabId.Plan });
dispatch({ type: 'UPDATE_PLAN', plan: "# Analyzing Request...\n\n*Forging blueprint based on 2025 System Standards...*" }); dispatch({ type: 'UPDATE_PLAN', plan: "# Analyzing Request...\n\n*Forging blueprint based on 2025 System Standards...*" });
} }
setThinkingLabel('Thinking...'); setThinkingLabel('Thinking...');
if ((window as any).electron) { if ((window as any).electron) {
const sessionId = Date.now().toString(); const sessionId = Date.now().toString();
let currentProjectId = state.activeProject?.id || null; let currentProjectId = state.activeProject?.id || null;
@@ -2697,28 +2698,28 @@ if ((window as any).electron) {
{ role: 'user', content: userPrompt } { role: 'user', content: userPrompt }
], state.chatSettings.activeModel); ], state.chatSettings.activeModel);
} else { } else {
clearTimeout(timeoutId); clearTimeout(timeoutId);
setTimeout(() => { setTimeout(() => {
dispatch({ type: 'ADD_LOG', log: { id: Date.now().toString(), timestamp: Date.now(), type: 'system', message: "[OFFLINE] Simulated response." } }); dispatch({ type: 'ADD_LOG', log: { id: Date.now().toString(), timestamp: Date.now(), type: 'system', message: "[OFFLINE] Simulated response." } });
finalizeRequest(); finalizeRequest();
}, 1000); }, 1000);
} }
}; };
const showStreaming = (state.state === OrchestratorState.Building) && state.activeBuildSessionId != null && state.streamingCode != null; const showStreaming = (state.state === OrchestratorState.Building) && state.activeBuildSessionId != null && state.streamingCode != null;
useEffect(() => { useEffect(() => {
if (!showStreaming) return; if (!showStreaming) return;
const id = setInterval(() => { const id = setInterval(() => {
setActiveTechIndex((i) => (techTags.length ? (i + 1) % techTags.length : 0)); setActiveTechIndex((i) => (techTags.length ? (i + 1) % techTags.length : 0));
}, 900); }, 900);
return () => clearInterval(id); return () => clearInterval(id);
}, [showStreaming, techTags.length]); }, [showStreaming, techTags.length]);
return ( return (
<div className={`flex flex-col glass-panel z-20 transition-all duration-500 overflow-hidden relative ${state.chatDocked === 'bottom' ? 'h-96 w-[calc(100%-24px)] fixed bottom-3 left-3 rounded-2xl shadow-2xl border-t border-white/10' : 'w-96 m-3 rounded-2xl shadow-2xl'}`}> <div className={`flex flex-col glass-panel z-20 transition-all duration-500 overflow-hidden relative ${state.chatDocked === 'bottom' ? 'h-96 w-[calc(100%-24px)] fixed bottom-3 left-3 rounded-2xl shadow-2xl border-t border-white/10' : 'w-96 m-3 rounded-2xl shadow-2xl'}`}>
{/* STREAMING EDITOR OVERLAY (SLIDES IN) */} {/* STREAMING EDITOR OVERLAY (SLIDES IN) */}
@@ -3186,7 +3187,7 @@ return (
{showSkillsSelector && <SkillsSelectorModal onClose={() => setShowSkillsSelector(false)} onSelect={(cmd) => setInput(prev => prev + ' ' + cmd)} />} {showSkillsSelector && <SkillsSelectorModal onClose={() => setShowSkillsSelector(false)} onSelect={(cmd) => setInput(prev => prev + ' ' + cmd)} />}
{state.personaCreateModalOpen && <PersonaCreateModal state={state} dispatch={dispatch} />} {state.personaCreateModalOpen && <PersonaCreateModal state={state} dispatch={dispatch} />}
</div> </div>
); );
}; };
const LogMessage = ({ message, type }: { message: string, type: 'user' | 'system' | 'error' }) => { const LogMessage = ({ message, type }: { message: string, type: 'user' | 'system' | 'error' }) => {