Repository navigation
feat(text-editor): insert as many table rows as are selected - #11139
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
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
force-pushed
the
feat/table-insert-multiple-rows
branch
from
October 26, 2026 14:22
833927d to
eae9b26
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.