Skip to content

Deleting multiple elements - #2519

Merged
tf merged 8 commits into
codevise:masterfrom
tf:multi-del
Oct 26, 2026
Merged

tf merged 8 commits into
codevise:masterfrom
tf:multi-del

Conversation

@tf

@tf tf commented Oct 26, 2026

Copy link
Copy Markdown
Member

No description provided.

tf added 8 commits October 26, 2026 11:13
Tab labels could only be looked up via translation keys derived from
the tab name, which does not allow interpolating values like a count
into the label. An optional label now takes precedence over the
translation lookup.
The contentElement option of renderEntry is meant for specs that need
a single content element and do not care about the rest of the entry.
Appending it to seeded content elements made the resulting ids and
order implicit. renderEntry now raises an error instead, so specs seed
all of their content elements explicitly.
The helper for building editable text values lived among the storybook
helpers, which made it unavailable via the support module used by
specs. It now lives in its own support module and also builds blocks
of other types and multiple blocks at once.
Deleting a series of elements meant deleting them one by one so far.
Holding Ctrl/Meta while clicking a content element now adds it to or
removes it from a new multi selection, which holds a list of items
instead of a single id. Items always refer to whole content elements.

Modifier clicks do not place the caret in editable texts of the
content element, and an editable text that has focus loses it once its
content element becomes part of a multi selection. Otherwise typing
would change a content element of the multi selection.

Since the controls of the selection rect all act on a single element,
elements that are part of a multi selection only display a plain
border.
Text blocks render their own selection rect and handle clicks inside
the editable text, so clicking them while holding Ctrl/Meta placed the
cursor instead of extending the selection. The modifier click now adds
the text block as a whole to the multi selection without moving the
cursor into the text. A text block that is being edited loses focus
once it becomes part of a multi selection, so typing cannot change it.

A plain click into the text of a multi selected text block selects it
on its own. When a multi selection shrinks to a single text block, the
text block regains focus, since a selected text block without cursor
would display no selection rect.
Deleting the content elements of a multi selection one by one would
send a request per element and could not merge the elements which
become adjacent along the way. The new method records all deletions of
a section in a single batch, moving the content elements to the trash,
and merges content elements that become adjacent. Since a multi
selection can span sections, one request per section is performed.

Deleting a single content element is now the special case of deleting
a selection of one.
Selecting multiple content elements in the preview navigated the
sidebar back to the outline since the editor did not know the new
selection type. It now shows a view with a tab that lists the type of
each selected element and offers deleting them via its actions menu.
The back link resets the selection, which makes the preview navigate
the sidebar back to the outline.

The configuration of multiple content elements cannot be edited at
once, so the view deliberately only offers actions that apply to the
selection as a whole.
Spelling out the block structure of editable text values made specs
and stories harder to read than the texts they care about. Values that
consist of blocks of a single type with plain text use the helper now.
Values with marks or block attributes, children of list blocks and
expected values in assertions keep spelling out their structure.
@tf tf added this to the v17.3 milestone Oct 26, 2026
@tf
tf merged commit d685841 into codevise:master Oct 26, 2026
18 checks passed
@tf
tf deleted the multi-del branch October 26, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant