From d0eaf41ceaedefa8285aa3f476efc305ad82f4b2 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 18 Jan 2026 01:23:20 +0000 Subject: [PATCH] Add tasks for custom hook extraction --- docs/react-hook-extraction-tasks.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/react-hook-extraction-tasks.md diff --git a/docs/react-hook-extraction-tasks.md b/docs/react-hook-extraction-tasks.md new file mode 100644 index 0000000..4f34a0f --- /dev/null +++ b/docs/react-hook-extraction-tasks.md @@ -0,0 +1,20 @@ +# React Hook Extraction Tasks + +## Component candidates + +- [ ] **Extract data source editor state logic into a hook.** + - **Component:** `src/components/molecules/DataSourceEditorDialog.tsx` + - **Why:** Manages editing state, sync with props, and dependency add/remove logic in the component body. + - **Proposed hook:** `useDataSourceEditor` (or similar) to own `editingSource`, `updateField`, and dependency helpers, plus derived dependency lists. +- [ ] **Extract component binding dialog state into a hook.** + - **Component:** `src/components/molecules/ComponentBindingDialog.tsx` + - **Why:** Holds editable component state and binding update handlers inline. + - **Proposed hook:** `useComponentBindingDialog` to sync `editingComponent` with props and expose `updateBindings`/`handleSave`. +- [ ] **Extract template export/copy/download actions into a hook.** + - **Component:** `src/components/TemplateExplorer.tsx` + - **Why:** Clipboard interactions, blob creation, and KV export are embedded in the view component. + - **Proposed hook:** `useTemplateExplorerActions` to return `copyToClipboard`, `downloadJSON`, and `exportCurrentData` handlers. +- [ ] **Extract component tree expansion state into a hook.** + - **Component:** `src/components/molecules/ComponentTree.tsx` + - **Why:** Expansion state, “expand all,” and “collapse all” logic are in the component, but reusable across tree UIs. + - **Proposed hook:** `useComponentTreeExpansion` to compute expandable IDs and manage `expandedIds` with expand/collapse/toggle functions.