memos/web/src/components/MemoEditor/Editor
Cursor Agent f95e4452a5 feat: add table editor dialog for visual table editing
Add a dialog-based table editor that makes creating and editing markdown
tables much easier than manipulating raw pipe-delimited text.

Features:
- Visual grid of input fields for editing headers and cells
- Add and remove rows and columns
- Sort columns ascending/descending (supports both text and numeric)
- Tab key navigation between cells (auto-creates new rows at the end)
- Properly formatted/aligned markdown output on confirm
- Row numbers with hover-to-delete interaction
- Column sort indicators and remove buttons

Integration points:
1. Toolbar: New 'Table' button in the InsertMenu (+) dropdown opens the
   dialog for creating new tables from the editor
2. Slash command: /table now opens the dialog instead of inserting raw
   markdown, via new Command.action callback support
3. Rendered tables: Edit pencil icon appears on hover over rendered tables
   in MemoContent, opens dialog pre-populated with parsed table data,
   and saves changes directly via updateMemo mutation (same pattern as
   TaskListItem checkbox toggling)

New files:
- utils/markdown-table.ts: Parse, serialize, find/replace markdown tables
- components/TableEditorDialog.tsx: Reusable table editor dialog component

Modified:
- Extended Command interface with optional action callback for dialogs
- SlashCommands handles action-based commands (skips text insertion)
- Editor accepts custom commands via props
- EditorContent creates commands with table editor wired in
- MemoEditor manages table dialog state shared between slash cmd and toolbar
- InsertMenu includes Table entry and its own dialog for toolbar flow
- Table.tsx (MemoContent) adds edit button and dialog for rendered tables

Co-authored-by: milvasic <milvasic@users.noreply.github.com>
2026-02-06 22:44:15 +00:00
..
SlashCommands.tsx feat: add table editor dialog for visual table editing 2026-02-06 22:44:15 +00:00
SuggestionsPopup.tsx feat: add slash commands tooltip to InsertMenu 2025-12-22 22:42:23 +08:00
TagSuggestions.tsx refactor: consolidate and update type definitions across MemoEditor components 2025-12-28 13:17:02 +08:00
commands.ts feat: add table editor dialog for visual table editing 2026-02-06 22:44:15 +00:00
index.tsx feat: add table editor dialog for visual table editing 2026-02-06 22:44:15 +00:00
shortcuts.ts feat: add slash commands tooltip to InsertMenu 2025-12-22 22:42:23 +08:00
useListCompletion.ts fix: improve editor auto-scroll and Safari IME handling (#5469) 2026-01-13 21:19:31 +08:00
useSuggestions.ts fix: cursor position after slash commands 2026-01-05 22:24:13 +08:00