Skip to content

Commit f074d53

Browse files
committed
refactor(plan): remove chat-area plan display, improve auto-collapse
- Remove PlanApprovalAlert from BaseChat.tsx plan display is now solely in the workbench Plan panel (eliminates dual display) - Plan panel auto-collapses when tasks reach 100% regardless of approvedByUser state (works on page reload too) - Action buttons hidden when all tasks are done (no Approve/Cancel shown for completed plans) - Initial state: panel starts collapsed if progress is already 100%
1 parent 0e9a58b commit f074d53

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

app/components/chat/BaseChat.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import type { DesignScheme } from '~/types/design-scheme';
3232
import type { ElementInfo } from '~/components/workbench/Inspector';
3333
import LlmErrorAlert from './LLMApiAlert';
3434
import { ResizeHandle } from '~/components/ui/ResizeHandle';
35-
import { PlanApprovalAlert } from './PlanApprovalAlert';
3635
import { createScopedLogger } from '~/utils/logger';
3736

3837
const logger = createScopedLogger('BaseChat');
@@ -469,8 +468,6 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
469468
/>
470469
)}
471470
{llmErrorAlert && <LlmErrorAlert alert={llmErrorAlert} clearAlert={() => clearLlmErrorAlert?.()} />}
472-
{/* Plan Approval Alert - shows when a plan is pending approval */}
473-
<PlanApprovalAlert />
474471
</div>
475472
{progressAnnotations && <ProgressCompilation data={progressAnnotations} />}
476473

app/components/workbench/Plan.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ const PlanActions = memo(({ approvedByUser, progress }: { approvedByUser: boolea
112112
rejectPlan();
113113
}, []);
114114

115-
if (approvedByUser && progress >= 100) {
115+
// All tasks done — show completion status, no buttons needed
116+
if (progress >= 100) {
116117
return (
117118
<div className="flex items-center gap-2 text-sm text-green-500">
118119
<div className="i-ph:check-circle-fill" />
@@ -162,17 +163,18 @@ export const Plan = memo(({ className }: PlanProps) => {
162163
const state = useStore(planStore);
163164
const progress = useStore(planProgress);
164165

165-
const [isOpen, setIsOpen] = React.useState(true);
166+
// Start collapsed if all tasks are already done (e.g. page reload)
167+
const [isOpen, setIsOpen] = React.useState(progress < 100);
166168

167169
// Auto-collapse the plan panel after all tasks complete
168170
useEffect(() => {
169-
if (state.approvedByUser && progress >= 100) {
171+
if (progress >= 100) {
170172
const timer = setTimeout(() => setIsOpen(false), 3000);
171173
return () => clearTimeout(timer);
172174
}
173175

174176
return undefined;
175-
}, [state.approvedByUser, progress]);
177+
}, [progress]);
176178

177179
if (!state.isActive || state.tasks.length === 0) {
178180
return null;

0 commit comments

Comments
 (0)