Repository navigation
PT-4960: Let an empty paragraph after a chapter be deleted, for release-prep (#39) - #47
Merged
Merged
Conversation
* 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)
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. Replaces #46, which also brought #42 along; #42 is a follow-up, not a show-stopper, so it stays offrelease-prep.-x) of6f87a496(the squash-merge commit of PT-4960: Let an empty paragraph after a chapter be deleted #39 onmain) on top ofrelease-prep's tip (1fb9b90e).main, PT-4960: Let an empty paragraph after a chapter be deleted #39 sits on top of PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42 (4c5d462a), and both regeneratepackages/platform/dist/index.jsandindex.js.map, so PT-4960: Let an empty paragraph after a chapter be deleted #39's committed bundle can't apply without PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42. I resolved it by rebuilding the dist on this branch (scripts/rebuild-committed-output.mjs), so the bundle contains PT-4960: Let an empty paragraph after a chapter be deleted #39 and not PT-4974: Export the font part of the project stylesheet as generateUsjFontCss #42.scripts/verify-committed-dist.mjspasses. Everything else applied cleanly: the source and test changes, and the CHANGELOG entry, are identical tomain's PT-4960: Let an empty paragraph after a chapter be deleted #39 (git patch-id --stableof the non-dist diff matches:37a38297…).da178a7e…) does not matchmain's (75297a7a…), so a later rebase ofrelease-prepontomainwon't skip it automatically. When that rebase reaches this commit, the source hunks are already onmainand merge cleanly; onlypackages/platform/dist/index.jsandindex.js.mapconflict. Takemain's version of those two files (they are generated), and the commit becomes empty and is dropped (orgit rebase --skipit).Testing: this tree (#39 without #42) was never tested on
main, so I ranpnpm nx run-many -t test typecheck lint -p shared-react platform --skip-nx-cacheon this branch: all passed (lint: 0 errors, 4 warnings). CI reruns here.🤖 Generated with Claude Code
This change is