Skip to content

feat(text-editor): insert as many table rows as are selected - #11139

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/table-insert-multiple-rows
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/table-insert-multiple-rows

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #8677

Problem and change

The table options menu could only add a single row before or after the
selection, so adding several rows meant repeating the action once per row.

When several rows are selected, "Add before" / "Add after" in the Rows
section now read "Add N rows before" / "Add N rows after" and insert that
many empty rows in a single transaction (one undo step). The insertion
reuses prosemirror-tables' addRow and re-reads the table after each row so
merged cells crossing the insertion point keep growing their row span. A
cursor or a single-row selection keeps the previous behaviour and labels.

The row counting and insertion live in a small addRows helper covered by
unit tests.

Tests

New unit tests plugins/text-editor-resources/src/components/extension/table/addRows.test.ts. Checked manually on a self-hosted instance: with cells of three rows selected the table menu offers "Add 3 rows before/after", which inserts three empty rows that a single undo removes; with only a cursor the single-row entries are shown.

The table options menu could only add a single row before or after the
selection, so adding several rows meant repeating the action once per row.

When several rows are selected, "Add before" / "Add after" in the Rows
section now read "Add N rows before" / "Add N rows after" and insert that
many empty rows in a single transaction (one undo step). The insertion
reuses prosemirror-tables' addRow and re-reads the table after each row so
merged cells crossing the insertion point keep growing their row span. A
cursor or a single-row selection keeps the previous behaviour and labels.

The row counting and insertion live in a small addRows helper covered by
unit tests.

Fixes hcengineering#8677

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
@MichaelUray
MichaelUray force-pushed the feat/table-insert-multiple-rows branch from 833927d to eae9b26 Compare October 26, 2026 14:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tables: Insert multiple rows at once

1 participant