memos/web
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
..
public chore: enhance site.webmanifest in firefox (#4828) 2025-07-08 19:56:46 +08:00
src refactor: clean up MemoView and MemoEditor component architecture 2025-11-30 11:15:20 +08:00
.gitignore chore: update gitignore 2025-04-17 23:11:36 +08:00
biome.json chore(web): migrate from ESLint+Prettier to Biome 2025-11-14 23:58:07 +08:00
components.json feat: themes (#4824) 2025-07-07 20:13:22 +08:00
index.html chore: remove fixed theme color 2025-07-15 23:26:07 +08:00
package.json fix(markdown): render single newlines as line breaks 2025-11-26 20:13:57 +08:00
pnpm-lock.yaml fix(markdown): render single newlines as line breaks 2025-11-26 20:13:57 +08:00
tsconfig.json refactor: update import prefix with alias (#1433) 2023-04-01 16:03:14 +08:00
vite.config.mts refactor: update markdown parser 2025-10-26 11:28:40 +08:00