Fix syntax error: re-introduce 'if' statement in LayoutComponents after backend logic removal
This commit is contained in:
@@ -2472,6 +2472,7 @@ Format: { "ideas": [{ "title": "Short Title", "subtitle": "One line", "tag": "To
|
||||
}
|
||||
|
||||
|
||||
if (isQaFailureArtifact) {
|
||||
// --- REPAIR MODE (F3: Retention & Match) ---
|
||||
// "Broken frontend is treated as a REPAIR task"
|
||||
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.
|
||||
requestKind = 'plan';
|
||||
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).`;
|
||||
}
|
||||
}
|
||||
|
||||
// IMMEDIATE FEEDBACK: If we are planning, switch to Plan tab immediately so user sees the stream
|
||||
if (requestKind === 'plan') {
|
||||
// IMMEDIATE FEEDBACK: If we are planning, switch to Plan tab immediately so user sees the stream
|
||||
if (requestKind === 'plan') {
|
||||
dispatch({ type: 'TRANSITION', to: OrchestratorState.Planning });
|
||||
dispatch({ type: 'SET_TAB', tab: TabId.Plan });
|
||||
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();
|
||||
let currentProjectId = state.activeProject?.id || null;
|
||||
|
||||
@@ -2697,28 +2698,28 @@ if ((window as any).electron) {
|
||||
{ role: 'user', content: userPrompt }
|
||||
], state.chatSettings.activeModel);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
clearTimeout(timeoutId);
|
||||
setTimeout(() => {
|
||||
dispatch({ type: 'ADD_LOG', log: { id: Date.now().toString(), timestamp: Date.now(), type: 'system', message: "[OFFLINE] Simulated response." } });
|
||||
finalizeRequest();
|
||||
}, 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;
|
||||
const id = setInterval(() => {
|
||||
setActiveTechIndex((i) => (techTags.length ? (i + 1) % techTags.length : 0));
|
||||
}, 900);
|
||||
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'}`}>
|
||||
|
||||
{/* STREAMING EDITOR OVERLAY (SLIDES IN) */}
|
||||
@@ -3186,7 +3187,7 @@ return (
|
||||
{showSkillsSelector && <SkillsSelectorModal onClose={() => setShowSkillsSelector(false)} onSelect={(cmd) => setInput(prev => prev + ' ' + cmd)} />}
|
||||
{state.personaCreateModalOpen && <PersonaCreateModal state={state} dispatch={dispatch} />}
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
const LogMessage = ({ message, type }: { message: string, type: 'user' | 'system' | 'error' }) => {
|
||||
|
||||
Reference in New Issue
Block a user