memos/web/src/components/MemoEditor
Johnny 2516cdf2b4 refactor: clean up MemoView and MemoEditor component architecture
This commit refactors MemoView and MemoEditor components for better
maintainability, introducing React Context, custom hooks, and improved
folder structure.

MemoView improvements:
- Introduce MemoViewContext to eliminate prop drilling
- Reduce MemoHeader props from 18 to 8
- Reduce MemoBody props from 9 to 4
- Extract custom hooks: useMemoViewDerivedState, useMemoEditor,
  useMemoHandlers for better separation of concerns
- Fix React hooks ordering bug in edit mode

MemoEditor improvements:
- Extract state management into useMemoEditorState hook
- Extract keyboard handling into useMemoEditorKeyboard hook
- Extract event handlers into useMemoEditorHandlers hook
- Extract initialization logic into useMemoEditorInit hook
- Reduce main component from 461 to 317 lines (31% reduction)

Folder structure cleanup:
- Move SortableItem to memo-metadata (correct location)
- Move ErrorBoundary to components folder
- Flatten Toolbar/InsertMenu structure (remove unnecessary nesting)
- Consolidate hooks in main hooks folder
- Consolidate types in main types folder

Benefits:
- Better separation of concerns
- Improved testability
- Easier maintenance
- Cleaner code organization
- No functionality changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 11:15:20 +08:00
..
components refactor: clean up MemoView and MemoEditor component architecture 2025-11-30 11:15:20 +08:00
Editor feat: add LocationDialog and related hooks for location management in MemoEditor 2025-11-28 09:21:53 +08:00
hooks refactor: clean up MemoView and MemoEditor component architecture 2025-11-30 11:15:20 +08:00
Toolbar refactor: clean up MemoView and MemoEditor component architecture 2025-11-30 11:15:20 +08:00
types refactor: clean up MemoView and MemoEditor component architecture 2025-11-30 11:15:20 +08:00
constants.ts refactor(web): restructure MemoEditor with custom hooks and improved error handling 2025-11-25 21:29:54 +08:00
index.tsx refactor: clean up MemoView and MemoEditor component architecture 2025-11-30 11:15:20 +08:00