Repository navigation
Edit text: space between paragraphs - #1925
Open
regendorf-ux wants to merge 11 commits into
Open
regendorf-ux wants to merge 11 commits into
regendorf-ux wants to merge 11 commits into
Conversation
A line break in the edited text starts a paragraph; BlockStyle.paragraph_spacing (points, beyond the line spacing; half the size unless set) goes before each paragraph's first line. Paragraphs are wrapped and justified on their own, so a paragraph's last line is never stretched; the row-model rewrite keeps the rows a line break started apart from wrapped ones and shifts kept rows by the spacing added above them. A Paragraph spacing field in the Format text panel, text_edit takes paragraph_spacing, rows in every language, parity edit.line-paragraph-spacing shipped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cargo xtask assets checks each catalog's sha256; the rows this branch adds changed the files without updating it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ATTRIBUTION.toml: the 21 language files' sha256 recomputed from the merged files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: the language catalogs (both sides' rows kept), ATTRIBUTION.toml's checksums (recomputed from the merged files), and tests both sides appended at the same place. Upstream's new Vietnamese catalog gets this change's labels.
…ws_for_generic_args)
…thuanian catalogs' new rows beside this change's
Conflicts: ATTRIBUTION.toml, crates/ui-egui/src/i18n/es.tsv, crates/ui-egui/src/i18n/vi.tsv. Catalogs keep upstream's rows, then this branch's rows upstream lacks; ATTRIBUTION.toml is upstream's with every sha256 recomputed; progress lines keep both sides, upstream's first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TTRIBUTION hashes by key (ATTRIBUTION.toml ) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed on both sides kept (upstream's first), catalogs and ATTRIBUTION by key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What this changes
edit.line-paragraph-spacingwas partial: line spacing existed, the space between paragraphs didnot. Now a line break in the edited text starts a paragraph, and the paragraphs are set apart:
BlockStyle.paragraph_spacing: Option<f64>(points, beyond the line spacing).rewrite_blocksplits the text at line breaks, wraps and justifies each paragraph on its own (the last line of
each paragraph is never stretched), and steps down by the line spacing plus the gap before a
paragraph's first line; underlines follow.
Noneis half the font size when the text hasseveral paragraphs, so a plain Enter already reads as a paragraph; a non-finite value is refused.
text_regions) keeps the rows a line break started apart from wrappedones: the gap goes before those, and a row the page already had sits where it was, shifted by
the spacing added above it.
text_edittakesparagraph_spacing.parity/acrobat-features.tomledit.line-paragraph-spacing→ shipped (notes: space before and after as separate values arestill missing).
How you verified it
Re-run on 2026-10-15 after merging
maininto the branch (41809cf, then afa8e18). The merge needed the language catalogs (upstream's rows and this PR's kept), ATTRIBUTION.toml's checksums and the tests both sides had appended at the same place; the new Vietnamese catalog got this PR's 2 labels (written by an AI model, like the other languages' rows, so a native speaker's review is welcome). Reconciled with #1486 (line breaks kept when editing a multi-line paragraph): the default gap between paragraphs applies to upright text only; turned text keeps its rows where they were unless a spacing is set. #1539 merged without conflict. A needless borrow clippy found on Windows is fixed.Full run on Windows (Rust 1.98) at the branch merged with
main41809cf; aftermainafa8e18 was merged, re-checked on macOS (this PR's tests, thei18ntests,cargo clippy --all-targets -- -D warningson the changed crates and their dependents (automation, edit, engine, ui-egui, audit, redact, the apps),cargo xtask assets):cargo fmt --all --check,cargo xtask assets,cargo xtask layers, doctests: exit 0cargo clippy --workspace --all-targets -- -D warnings: clean on Windows; on macOS the only warnings aremain's own (crates/ui-egui/tests/view.rs: two helpers used only by a non-macOS test)paragraph_breaks_get_their_own_spacing,the_format_panel_has_a_paragraph_spacing_field, andmain'sturned_paragraph_keeps_its_line_breaks_when_a_word_is_addedcargo nextest run --workspace: 3422 of 3433 passed on Windows. The 11 failures fail the same way onmainwithout this change: the parity file's duplicate keys (alsocargo xtask parity; fix(parity): merge the keys concurrent merges left twice in acrobat-features.toml #2419 / M0: repair duplicate feature-parity assignments #2473), the zh-hant duplicates and the Vietnamese coverage tests ini18n(none lists this PR's labels),signing_with_translated_labels_through_tools(Tests: the translated-labels signing test uses an 8-character digital ID password #2429),canvas::tests::explicit_search_jumps_record_history_and_keep_match_destination,view::single_page_swipe_that_reaches_the_edge_does_not_turn_but_a_fresh_one_does,editing::files_dropped_beside_the_pages_panel_still_open_as_documents(intermittent)Tests.
paragraph_breaks_get_their_own_spacing(edit): a one-line source rewritten as"First one\nSecond one" gets the row step alone (15 pt for a 10 pt one-liner), 35 pt with a 20 pt
spacing, 15 pt with 0, and a wrapped single paragraph keeps the ordinary 12 pt step.
the_format_panel_has_a_paragraph_spacing_field(ui-egui): the field is in the panel while aparagraph is being edited.
Anything a reviewer should look at first
wording; a native speaker's review of those rows would be welcome.
left unstretched); with a single paragraph nothing changes.
same
BlockStyle.paragraph_spacing, a spacing field in the Format panel and thetext_editargument.On top of that, this PR stops justification at each paragraph's last line, adds a UI test beside the
edit-crate test, and carries the label in all 21 catalogs. Whichever you prefer is fine: if M7: line and paragraph spacing #1487
lands first I'll rebase this down to what it adds on top of it, or close it.
disabled as Planned and replaces
edit_text_ui::extras_panel, where this PR's field lives. This PRsupplies what the control would drive (
BlockStyle.paragraph_spacingapplied bytext_regions.rs);if M7: lay out Format text as Acrobat's panel #2249 lands first I'll move the field into its panel and enable it there.
Never-crash
unwrap/expect/panic!outside testsgetunsafeProvenance
Security
Parity and reach
parity/acrobat-features.tomlupdated with what is still missingHeadless through
text_edit(paragraph_spacing)No documented behaviour changed (
docs/has no entry for it)Merged with main dc41044 (2026-10-15): i18n: fill Vietnamese and Lithuanian coverage gaps on main #2510's Vietnamese and Lithuanian catalogs added rows beside this branch's in
vi.tsvandlt.tsv(andATTRIBUTION.toml's sha256 lines), nothing else. Main's rows kept, this branch's rows main lacks after them, hashes recomputed. Re-checked after the merge:cargo xtask assetsok,i18n::tests117/117.Merged with main 5fdd820 (2026-10-15): fix(ui): validated signature display, snapshot tab reuse #1895's catalog rows conflicted with this branch's in
es.tsvandvi.tsv(andATTRIBUTION.toml's sha256 lines), nothing else. Main's rows kept, this branch's rows main lacks after them, hashes recomputed. Re-checked after the merge:cargo xtask assetsok, clippy -D warnings on this branch's crates ok,i18n::tests117/117.Merged with main bc7a12b (2026-10-17): only the translation catalogs' new rows and
ATTRIBUTION.toml's hashes met this branch (both sides kept, hashes recomputed). Re-checked on macOS:cargo check --workspace --all-targets,cargo xtask assets,i18n::tests115/115.Merged with main 3f5a784 (2026-10-17): tests and docs both sides added kept (upstream's first), translation rows and
ATTRIBUTION.toml's hashes by key. Re-checked on macOS:cargo check --workspace --all-targets,cargo xtask assets,i18n::tests115/115.🤖 Generated with Claude Code