状态(2026-07-15):已实施,本文保留为历史实施计划。当前实现以
packages/ui/src/TaskList.tsx、packages/ui/src/TaskListItem.tsx和packages/ui/src/app-shell/WorkspaceShellLayout.tsx为准; 下文复选框是计划模板,不代表当前完成度,旧ChatMessage相关步骤也不代表 V4 会话渲染结构。For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Reduce repeated workspace UI renders in large sessions without changing task, shell, menu, or composer behavior.
Architecture: Stabilize props at existing component boundaries and defer heavy per-row context-menu content until the menu opens. Keep business state in current stores; use refs only to read latest values inside stable event callbacks.
Tech Stack: React 19, TypeScript, Zustand, Radix context menus/tooltips, Vitest.
DESIGN.md; no visual redesign is part of this work.packages/ui/src/logger.ts; this plan does not require new logging.pnpm typecheck and pnpm lint before commit.Files:
packages/ui/src/TaskList.tsxpackages/ui/test/taskListRenderStability.test.tsInterfaces:
Produces stable props for MemoTaskItem: onArchiveTaskInline, onCancelArchiveConfirm, onTogglePinTask, onStartRenameTask, onArchiveTask, onMarkTaskAsUnread.
[ ] Add a failing test that re-renders TaskList with changed local state inputs while task data is unchanged, then asserts unchanged row action props keep reference identity.
[ ] Run the specific test and verify it fails because the current row action props change.
[ ] Refactor TaskList callbacks to read latest mutable values through refs where necessary and keep callback references stable.
[ ] Run the specific test and verify it passes.
Files:
packages/ui/src/TaskListItem.tsxpackages/ui/test/taskListItemHoverActions.test.tsInterfaces:
TaskListItemContextMenu open-only rendering behavior covered by a focused test.loadTaskPaths and loadProviderConfig tied to the open state.Defers hover-only archive tooltip/action content until the row is hovered or already confirming archive.
[ ] Add a test proving closed task rows do not render TaskListItemContextMenu.
[ ] Add a test proving opening the row context menu renders menu content once.
[ ] Add a failing test proving idle rows do not mount the hover-only archive tooltip/action.
[ ] Gate hover-only action content behind hover/archive-confirming state while preserving ContextMenu trigger behavior.
[ ] Run the specific tests and verify they pass.
Files:
packages/ui/src/app-shell/WorkspaceShellLayout.tsxInterfaces:
Stabilizes resetKeys arrays and render callback props passed to boundaries and mobile shell.
[ ] Memoize reset key arrays by their semantic values.
[ ] Memoize render callbacks that are passed as props.
[ ] Run affected UI tests.
Files:
packages/ui/src/ChatView.tsxpackages/ui/src/ChatView/ChatViewComposer.tsxpackages/ui/src/ChatView/ChatPromptEditor.tsxInterfaces:
Stabilizes equivalent attachmentAction, submit control, initialConfig, and toolbar callbacks where they cross memoized component boundaries.
[ ] Add or extend a focused render-stability test if an existing composer test can isolate the boundary.
[ ] Memoize equivalent action objects and callbacks.
[ ] Run affected UI tests.
Files:
All changed code and docs.
[ ] Run targeted tests for the changed UI files.
[ ] Run pnpm typecheck.
[ ] Run pnpm lint.
[ ] Review git diff.
[ ] Commit with a Conventional Commits message.