Skip to content

PT-4960: Let an empty paragraph after a chapter be deleted, for release-prep (#39) - #47

Merged
lyonsil merged 1 commit into
release-prepfrom
release-prep-39-only
Nov 3, 2026
Merged

lyonsil merged 1 commit into
release-prepfrom
release-prep-39-only

Conversation

@jolierabideau

@jolierabideau jolierabideau commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Brings #39 (PT-4960: let an empty paragraph after a chapter be deleted) onto release-prep so it can go into the next RC build. Replaces #46, which also brought #42 along; #42 is a follow-up, not a show-stopper, so it stays off release-prep.

Testing: this tree (#39 without #42) was never tested on main, so I ran pnpm nx run-many -t test typecheck lint -p shared-react platform --skip-nx-cache on this branch: all passed (lint: 0 errors, 4 warnings). CI reruns here.

🤖 Generated with Claude Code


This change is Reviewable

* PT-4960: Let an empty paragraph after a chapter be deleted

With structure unprotected, a paragraph delete merges the paragraph into
the one before it. Right after a `\c` there is nothing to merge into, so
the delete was refused, and an empty line there could never be removed.

An empty paragraph right after a chapter is now removed by the usual two
presses when a paragraph follows it in the chapter, and the caret goes
to that paragraph. One alone in its chapter, or one with text, is still
refused. Delete in any empty paragraph now removes that paragraph rather
than pulling the next paragraph's text in under the empty one's marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Rebuild platform-editor dist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Keep the caret put and treat Backspace like Delete

Review of the empty-paragraph delete found two inconsistencies.

Delete at the end of a paragraph with an empty paragraph after it moved
the caret down past the removed paragraph. The arm picked the empty
paragraph for a merge, but the fire removed it and placed the caret
after it. The direction is now settled once at the arm, from where the
caret was (`$paraDeleteIntent`), and the fire reuses it, so the caret
stays at the end of its own paragraph. A selected marker's Delete now
lands the caret in the same place under "guarded" and "off".

Backspace at the start of a paragraph after an empty one still merged
its text in under the empty paragraph's marker, the trap Delete no
longer falls into. It now removes the empty paragraph instead, keeping
this paragraph's marker and the caret, under "guarded" and "off". A
selected marker still merges its paragraph up.

Also: update the docs and comments that described merges only, make
`$canRemoveEmptyParaAfterChapter` module-private, share the test
helpers, read the caret's focus, and cover two empty paragraphs after a
chapter, undo, and Delete before a chapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Rebuild platform-editor dist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Address review

- Arm a Backspace on an empty paragraph above the caret without selecting its marker, so a key
  typed after the arm stays in the caret's paragraph
- Share the "empty with a paragraph after it" rule between arming and deleting
- Test the after-chapter cases with ImmutableChapterNode, as the paragraph-structure view renders
- Add full-editor tests for the empty-paragraph deletes and their undo
- Update the Standard view merge test: an empty paragraph before is now removed, not merged into
- Correct comments and add a CHANGELOG entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Rebuild platform-editor dist after review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Leave a blank line when a chapter's only paragraph is deleted

Per product input, deleting the marker of an empty paragraph that is the
only one in its chapter is now allowed: it leaves a blank line with no
marker, with the caret in it, where the user picks a marker. A `\` menu
paragraph pick at the start of a line with no marker now gives it that
marker instead of doing nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Rebuild platform-editor dist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Restore rolled-up platform-editor typings

The previous dist rebuild committed the plain build's re-export stub and a
stray Editorial.d.ts instead of the extract-api rollup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Load a blank line after a bare chapter; keep Standard view unchanged

A chapter with no line after it now loads with the same empty implied
paragraph that deleting its only paragraph leaves, in views where
markers are not editable text, so a click below the chapter number no
longer puts the caret before the chapter. It saves as nothing, so the
file is unchanged.

The empty-paragraph removal and blanking no longer apply in Standard
view, where the marker is editable text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Rebuild platform-editor dist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PT-4960: Rebuild platform-editor dist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6f87a49)
@lyonsil
lyonsil merged commit be42d4d into release-prep Nov 3, 2026
2 of 3 checks passed
@lyonsil
lyonsil deleted the release-prep-39-only branch November 3, 2026 14:17
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.

2 participants