Repository navigation
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
Closed
jolierabideau wants to merge 2 commits into
jolierabideau wants to merge 2 commits into
Conversation
…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)
Contributor
Author
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.
Brings #39 (PT-4960: let an empty paragraph after a chapter be deleted) onto
release-prepso it can go into the next RC build. It also brings #42 (PT-4974: export the project stylesheet's fonts asgenerateUsjFontCss), which #39 sits on top of onmain. The behaviour, tests and rebuiltplatform-editordist are exactly those merged tomain.mainis PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42, and both regeneratepackages/platform/dist/index.jsandindex.js.map. Picking PT-4960: Let an empty paragraph after a chapter be deleted #39 alone conflicts in those two files, and resolving that by hand would give the commit a different patch-id. Picking PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42 first lets both apply cleanly.-x) of4c5d462a(PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42) then6f87a496(PT-4960: Let an empty paragraph after a chapter be deleted #39), the squash-merge commits onmain, on top ofrelease-prep's tip (1fb9b90e). No conflicts.main(git patch-id --stable: PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42 →c5f32440…, PT-4960: Let an empty paragraph after a chapter be deleted #39 →75297a7a…, matching on both sides), so a later rebase ofrelease-prepontomainwill recognize and skip them. Please merge with a rebase or merge commit, not squash — squashing the two together would produce a patch-id that matches nothing onmain.release-prep's only change not onmainis the README note about this branch, so this branch's tree is byte-identical tomainat6f87a496apart from that README.Testing: not re-run on this branch, since the code is byte-identical to
mainat6f87a496, where #39's and #42's tests and CI passed. CI reruns here.🤖 Generated with Claude Code
This change is