You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[refactor] Split the CanvasWorkspace mega-component #174
src/canvas/CanvasWorkspace.tsx is 6,761 lines. The core Workspace() is a single function that holds 50 useState, 26 useEffect and 15 useCallback hooks. All canvas state and side effects are concentrated in one place, which makes it hard to unit test and risky to change.
Scope
Extract sub-components and hooks by responsibility: canvas interaction, selection, generation, history, and import/export.
Converge state into a reducer/context instead of dozens of scattered useState calls.
Add behaviour tests before restructuring so behaviour is pinned.
Acceptance criteria
The file is substantially smaller and Workspace()'s state/effect counts drop below an agreed maintainable threshold.
Behaviour is unchanged; new canvas unit tests cover the main interactions.
npm run check:i18n and the existing checks stay green.
Activity
[refactor] web: split CanvasWorkspace by responsibility
[refactor] Split CanvasWorkspace by responsibility (ThinkFlowLab#192)