refactor(web): remove the dead right-panel and subagent-preview code

v0.1.1 replaced both surfaces: the session tray took the right panel's
todo/tasks, and the in-place `?sub=` child view took the subagent preview.

- delete `features/chat/side-panel.tsx` (nothing imported it since the tray
  landed)
- delete `SubagentModal` and its private helpers (`SUB_BADGE`, `SUB_DOT`,
  `SubagentEntry`, `parseSubagentLines`, `SUB_ROLES`); the child view builds its
  timeline from the parent's entries instead of `subagent.read`
- drop `chatCommands.readSubagent` (its only caller is gone)
- drop the deprecated store slice `PreviewTarget` / `preview` / `setPreview`,
  including the session-migration re-key and the `PanelTab` alias
- drop their exclusive CSS (`.sub-item*`, `.sub-preview*`, `.sub-steer`) and the
  6 orphan catalog keys (chat.subagentTitle, chat.preview, chat.previewNote,
  chat.task, chat.currentSubagents, chat.steerRequired)
- tests: remove the two SubagentModal cases and the preview/readSubagent
  expectations (295 tests, down from 297 — exactly the deleted cases)

Verification: typecheck clean, vitest 295/295, vite build green, visual matrix
24/24 clean.
This commit is contained in:
yuez committed 2026-10-27 09:26:36 +08:00
1 parent bcf50b516f
commit 3789394c85
12 files changed
+12 -653

No files matched your search

+1 -3
View File
@@ -9,7 +9,7 @@ import { entryFixture, sessionFixture } from "./chat-fixtures";
beforeEach(() => {
useSessionsStore.getState().reset();
useChatStore.setState({ history: {}, sending: null, preview: null });
useChatStore.setState({ history: {}, sending: null });
window.history.replaceState(null, "", "/chat");
});
@@ -21,7 +21,6 @@ describe("session id migration (`tmp-N` → real id)", () => {
hasMore: true,
});
useChatStore.getState().setSending({ sessionId: "tmp-1", text: "hello" });
useChatStore.getState().setPreview({ sessionId: "tmp-1", subagentId: "sa1" });
window.history.replaceState(null, "", "/chat/tmp-1?workspace=w1");
const seen: string[] = [];
@@ -41,7 +40,6 @@ describe("session id migration (`tmp-N` → real id)", () => {
expect(useChatStore.getState().history["01a1-real"]?.entries).toHaveLength(1);
expect(useChatStore.getState().history["01a1-real"]?.cursor).toEqual({ before: "u1", hasMore: true });
expect(useChatStore.getState().sending).toEqual({ sessionId: "01a1-real", text: "hello" });
expect(useChatStore.getState().preview).toEqual({ sessionId: "01a1-real", subagentId: "sa1" });
expect(replaceChatUrl("tmp-1", "01a1-real", "w1")).toBe(true);
expect(window.location.pathname + window.location.search).toBe("/chat/01a1-real?workspace=w1");