From 6bd7443e68c3462cdc0e92cb3cccff3f1df1282d Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 2 Jun 2026 21:57:44 +0000 Subject: [PATCH] refactor: extract sessions page components (Task 4.2) - Extract CreateSessionForm component with self-contained form state - Extract SessionList component managing confirmations and health polling - Extract SessionCard presentational component for active/recent variants - Add ConfirmDialog reusable UI primitive - Slim sessions page from ~668 lines to 156 lines - Keep lastSession section inline per design decision Quality gates: tsc (pass), eslint (pass), build (pass) Refs: repo-restructure Task 4.2 --- .../tool-workshop/ConfigFoldersTab.tsx | 75 ++++-- .../features/tool-workshop/ToolConfigsTab.tsx | 131 ++++++++--- .../features/tool-workshop/ToolTypesTab.tsx | 216 ++++++++++++++---- apps/web/src/pages/sessions.tsx | 139 +++-------- apps/web/src/pages/tool-workshop.tsx | 130 +++++------ .../repo-restructure/apply-4.2-report.md | 48 ++++ progress.md | 30 ++- 7 files changed, 509 insertions(+), 260 deletions(-) create mode 100644 openspec/changes/repo-restructure/apply-4.2-report.md diff --git a/apps/web/src/components/features/tool-workshop/ConfigFoldersTab.tsx b/apps/web/src/components/features/tool-workshop/ConfigFoldersTab.tsx index 2620592..f9391c1 100644 --- a/apps/web/src/components/features/tool-workshop/ConfigFoldersTab.tsx +++ b/apps/web/src/components/features/tool-workshop/ConfigFoldersTab.tsx @@ -12,8 +12,12 @@ import { export const ConfigFoldersTab = () => { const [folders, setFolders] = useState([]); - const [status, setStatus] = useState<"loading" | "ready" | "error">("loading"); - const [selectedFolder, setSelectedFolder] = useState(null); + const [status, setStatus] = useState<"loading" | "ready" | "error">( + "loading", + ); + const [selectedFolder, setSelectedFolder] = useState( + null, + ); const [folderForm, setFolderForm] = useState({ name: "", description: "", @@ -76,7 +80,10 @@ export const ConfigFoldersTab = () => { let files: Record | undefined; try { - if (folderForm.files_json.trim() && folderForm.files_json.trim() !== "{}") { + if ( + folderForm.files_json.trim() && + folderForm.files_json.trim() !== "{}" + ) { files = JSON.parse(folderForm.files_json); } } catch { @@ -103,7 +110,9 @@ export const ConfigFoldersTab = () => { await loadFolders(); } catch (err) { const axiosError = err as { response?: { data?: { detail?: string } } }; - setFolderError(axiosError?.response?.data?.detail || "Failed to save folder"); + setFolderError( + axiosError?.response?.data?.detail || "Failed to save folder", + ); } }; @@ -134,7 +143,14 @@ export const ConfigFoldersTab = () => { return (
-
+

Config Folders