From b0166b9a5eb48c08b627a004f0ff7dd2e4caf689 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Mon, 9 Mar 2026 23:19:14 +0100 Subject: [PATCH] feat: add row/column management to table toolbar Replace single "Insert table" button with a Table dropdown that shows contextual row/column operations when the cursor is inside a table: add row, add column, delete row, delete column, delete table. Co-Authored-By: Claude Opus 4.6 --- docs/FEATURES.md | 2 +- src/lib/components/FormattingToolbar.svelte | 82 ++++++++++++++++++--- 2 files changed, 74 insertions(+), 10 deletions(-) diff --git a/docs/FEATURES.md b/docs/FEATURES.md index ff1a8da..7f1c533 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -26,7 +26,7 @@ - Code blocks (triple backtick) - Inline code (single backtick) - Links — insert, edit, and remove with URL input -- Tables (insert 3×3 via toolbar) +- Tables (insert, add/delete rows and columns) - Dividers (horizontal rules) - Text alignment (left, center, right, justify) - Line breaks diff --git a/src/lib/components/FormattingToolbar.svelte b/src/lib/components/FormattingToolbar.svelte index 4eb98e8..ccc01a2 100644 --- a/src/lib/components/FormattingToolbar.svelte +++ b/src/lib/components/FormattingToolbar.svelte @@ -24,7 +24,10 @@ Minus, ChevronDown, Ellipsis, - Table2 + Table2, + BetweenHorizontalEnd, + BetweenVerticalEnd, + RemoveFormatting } from 'lucide-svelte'; interface Props { @@ -282,6 +285,75 @@ {/if} + +
+ + {#if openDropdown === 'table'} +
+ + {#if editor?.isActive('table')} +
+ + +
+ + + + {/if} +
+ {/if} +
+
@@ -339,14 +411,6 @@ Code block -