memos/web
Claude 858c1d2448
refactor(web): improve consistency and design of editor components
This commit standardizes the design patterns across all editor
enhancement features for better maintainability and consistency.

Key improvements:

**useListAutoCompletion hook:**
- Now self-manages event listeners (consistent with useSuggestions)
- Uses refs to avoid stale closures
- Proper cleanup on unmount
- No longer requires manual event handler in parent

**useSuggestions hook:**
- Enhanced TypeScript documentation with JSDoc
- Added usage examples
- Improved error handling with warnings
- Consistent interface design

**SuggestionsPopup component:**
- Auto-scrolls selected item into view during keyboard navigation
- Added max height (max-h-60) with proper overflow handling
- Improved styling with border and shadow
- Prevents text selection with select-none
- Smooth scroll behavior for better UX

**Editor component:**
- Simplified - removed manual keyboard handler
- Cleaner code with hooks managing their own concerns
- Better separation of responsibilities

**CommandSuggestions & TagSuggestions:**
- Added comprehensive JSDoc comments
- Explained filtering strategies (prefix vs substring)
- Documented user interaction patterns
- Clarified autocomplete behavior

Benefits:
- Consistent patterns across all features
- Self-contained, reusable hooks
- Better developer experience with docs
- Improved UX with auto-scroll
- Easier to maintain and test
2025-11-08 17:01:58 +00:00
..
public chore: enhance site.webmanifest in firefox (#4828) 2025-07-08 19:56:46 +08:00
src refactor(web): improve consistency and design of editor components 2025-11-08 17:01:58 +00:00
.gitignore chore: update gitignore 2025-04-17 23:11:36 +08:00
.prettierrc.js chore: fix linter 2025-03-02 15:40:16 +08:00
MARKDOWN_STYLE_GUIDE.md chore: remove unused syntax 2025-10-27 08:31:57 +08:00
README.md chore: tweak readme 2024-02-23 08:25:54 +08:00
components.json feat: themes (#4824) 2025-07-07 20:13:22 +08:00
eslint.config.mjs refactor: migrate eslint 2025-04-01 00:04:43 +08:00
index.html chore: remove fixed theme color 2025-07-15 23:26:07 +08:00
package.json chore: remove unused syntax 2025-10-27 08:31:57 +08:00
pnpm-lock.yaml chore: remove unused syntax 2025-10-27 08:31: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

README.md

The frontend of Memos