Skip to content

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

Closed
jolierabideau wants to merge 2 commits into
release-prepfrom
release-prep-39
Closed

jolierabideau wants to merge 2 commits into
release-prepfrom
release-prep-39

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. It also brings #42 (PT-4974: export the project stylesheet's fonts as generateUsjFontCss), which #39 sits on top of on main. The behaviour, tests and rebuilt platform-editor dist are exactly those merged to main.

Testing: not re-run on this branch, since the code is byte-identical to main at 6f87a496, where #39's and #42's tests and CI passed. CI reruns here.

🤖 Generated with Claude Code


This change is Reviewable

rolfheij-sil and others added 2 commits November 2, 2026 09:54
…42)

Adds generateUsjFontCss(styleInfo, options?), the font part of
generateUsjCss's output only: the base rule (the project's default font with
the fallback chain, and its size) and, for each marker that names a font, a
font-family rule (the marker's font, then the project's default font, then
var(--usj-font-fallback, serif)). Weight, colour, size, margins, alignment
and the chapter-nested \ca/\cp rules are left out. Options are only zoom and
containerSelector, since nothing in a fonts-only sheet depends on direction.

Platform.Bible's formatted view takes only the project's fonts and builds
that sheet itself today by copying this file's private helpers; this export
lets it drop the copy (PT-4974). Both generators now share baseRule,
markerFontDeclaration and markerRule, so their font output cannot drift, and
for font-only input the two return identical CSS.

generateUsjCss changes only for non-finite sizes: every size check now goes
through isPositiveSize, which also rejects Infinity (it used to emit
"Infinitypt" or "Infinity%"). The unsafe-selector warning names the calling
export. The committed build output is regenerated.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Session-URL: https://claude.ai/code/session_012P3p4eMQi4Qdua5GWVAVRM
(cherry picked from commit 4c5d462)
* 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)
@jolierabideau

Copy link
Copy Markdown
Contributor Author

Superseded by #47, which brings over #39 only. #42 is a follow-up, not a show-stopper, so it stays off release-prep.

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