Repository navigation
Conversation
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| Existing Defaults Unchanged | The PR commit e187967 ("fix(paper): retain source spans on current drawings (#12035)") changes four files. None of the changes alters a user-facing default. - crates/sketch/src/lib.rs: adds re-export… |
Full details: Existing Defaults Unchanged
-
Explanation
The PR commit e187967 ("fix(paper): retain source spans on current drawings (
#12035)") changes four files. None of the changes alters a user-facing default. - crates/sketch/src/lib.rs: adds re-exports for new items (FlowedPaperText, PaperSourceFlow, PaperTextFlow, paper_text_with_flow*). This is additive API surface. - crates/sketch/src/paper_text.rs: adds PaperTextFlow, PaperSourceFlow, FlowedPaperText and paper_text_with_flow* functions. It also adds source, source_spans and wrapped fields to PaperLines. The wrap logic in measure() keeps the same wrap decisions and the same painted text. The change tracks original byte offsets alongside it. The existing paper_text/paper_lines entry points keep their behaviour. - crates/ui-egui/src/drawing_workspace.rs: removes the unused pub(crate) left_inset helper. The removed code had no caller after the Browser panel change, so no UI layout or behaviour changes. - crates/sketch/src/paper_text_tests.rs: adds tests only. No preference value, default setting, command default, UI default layout, or shortcut is changed. The description's "Changes a default: no" line is consistent with the code. The check only applies to UX defaults, so kernel or geometry results (solidcore) are out of scope and were not changed anyway.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Thanks @0xlillith, this is a clean, careful slice, and it's what we hoped for when we asked for it on #4890. I read the diff in full against What's good
A few things worth a look
Looking ahead, not for this PR. With both sets in, Checks on my side, on the PR head: the 49 paper-text tests pass ( Nice work. Points 1 and 2 are the ones I'd want written down before P2 starts, and the rest are small. |
|
Hi @0xlillith, a heads-up so our two pieces join cleanly. #12349 (merged into When the two meet, the run ranges would be recorded in One point to settle, nothing urgent: a wrapped line is the value's words put back one space apart. So between two wrapped lines, the original text has a space (or several), not a line break, and |
|
Hi @0xlillith, a small offer for this PR now that #12846 is on #12846 added
Entirely your call. If it helps, we can also make that change as a small follow-up once this lands. |
|
Thanks for both integration notes. The current source port records the mapping in PaperLines::set_with_flow and adds PaperFonts::text_with_flow through the sheet’s existing measurement/font-waiting path. Wrapped runs carry source word spans, preserving the removed whitespace as explicit gaps. The original contiguous run_ranges contract remains available for unwrapped text; wrapped source uses a separate run_spans API. The existing tests are retained, with additional wrapping and PaperFonts coverage. This is source-prepared and independently reviewed, not yet runtime-qualified. P2’s final-placement binding remains separate consumer work; this update does not claim that placement issue is solved. |
|
drawings now includes main as of today; please merge drawings into your branch. Thanks! |
|
The paper-text source-flow change is now ported to Drawings The source-flow API still preserves wrapped UTF-8 spans alongside the existing measurement and font path. Existing compatibility wrappers remain. Current-base compilation and tests are pending before the branch update is pushed. |
477c6d4 to
e187967
Compare
Change
Paper text producers retain a label’s original UTF-8 source alongside the exact shaped records a consumer receives. Fixes #12035.
The additive
PaperSourceFlowAPI records wrapped runs as source spans, preserving line breaks and omitted whitespace. Validation rejects changed glyphs, clusters, font identity, placement, text or run order. ExistingPaperTextFlow,run_ranges, measurement and font-loading contracts remain intact. The PDF consumer and checked-font snapshots remain separate P2 work; B1/F4 design review remains pending.Current Drawings integration also removes the unused private
left_insethelper after the shared Browser panel removed its last caller. One test compares its single expected range throughstd::slice::from_ref, preserving the same range and satisfying strict Clippy.Changes a default: no
Validation
On exact tree
7cb7877895114e77219cccfd7fca4a4d7a728cbb, the actual freshly compiled Sketch executable passed all 61 paper-text tests, including all 11 owned cases. Its actual test inventory, source/index and executable hashes were checked. No test was ignored or omitted from this focused selection.Full
cargo xtask cicompleted on that exact tree: 17,190 passed, 31 failed, 75 skipped. All 61 paper-text tests, including all 11 owned cases, passed in this full run as well. Strict workspace Clippy, shared-crate checks, WebAssembly checks (29 crates), and documentation tests passed. The repository policy check reports 17 known failures and 14 unlisted failures and exits nonzero. No full-gate pass or baseline qualification for every unlisted failure is claimed; web checks were not reached after native failure. Actual source/index and executable guards remained unchanged.The preceding
6b74a604full gate failed strict Clippy on the single-range array assertion. That failed gate and its separate 61-test focused pass remain archived. The correction changes only the assertion’s equivalent slice expression; all production bytes and other test assertions are unchanged. The earlier copied-cache run lacked the 11 owned cases and is not qualification for this unit.This unit adds source-association metadata, with no application or IO consumer and no new rendered output. The tests compare flowed and ordinary paint records/fonts exactly, retain original whitespace and UTF-8 spans, and reject altered records. No old image is presented as new evidence. PDF visual and extraction evidence belongs to the separate consumer.
Native run:
4d417901-7c51-49d1-af07-9a9e85aef248. The terminal raw gate, JUnit, policy output, actual Sketch inventory/executable and source snapshot are preserved locally. Publication retains the exact tested tree; it is not a separate test run on the resulting commit.Integration status
Integrated on
drawings@8a0b1fdfe164cba6dc654880b7495a7b81d15c9b. Current paper-line/font APIs and upstream exports are retained. This update resolves the old branch conflicts while retaining upstream APIs. The full gate is non-green as disclosed above; maintainer review and approved remote CI remain necessary.