Repository navigation
fix(viewer): keep combining marks with their base character - #451
Merged
Merged
Conversation
The banner wrap broke long words between a character and its marks, so a line could start with a detached mark. Wrap and truncation now break only between clusters. A mark that the font of its cluster lacks drew as an empty box. It now counts as text no font can draw and becomes the ellipsis.
A mark kept after a lost mark attached to the ellipsis, in a font that may lack it, and drew as an empty box.
This was referenced Oct 29, 2026
A format character that followed a lost mark left with the rest of the cluster, so a bidi override or isolate after it never closed. Characters that draw nothing now stay after the ellipsis.
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.
Closes #438
Closes #439
Two fixes for combining marks in the native viewer's attention banner and thumbnail label.
The banner wrap broke a word wider than the line between any two characters, so a line could start with a detached mark. Wrap now breaks only between clusters, as the viewer already defines them for font choice: a character and the marks and format characters after it. Truncation before the final ellipsis also drops whole clusters.
With host font fallback (#421), a mark that no font draws together with its base drew as an empty box.
displayablenow checks each mark against the font its cluster gets. A mark that font lacks counts as text no font can draw and becomes the ellipsis, like an undrawable character already does. The rest of that cluster goes into the same ellipsis, so no later mark attaches to the ellipsis in a font that may lack it. The issue also allowed drawing the mark from its own font; that would place a floating accent after the base, so the ellipsis is the clearer signal that something was lost.Traceability
ui::tests::wrap_keeps_marks_with_their_charactere+ U+0301, both as one word wider than the line; truncation to two lineséwhole. Fails onorigin/main~/.pickforge/investigations/438-439/before-tests.txt,after-tests.txt~/.pickforge/investigations/438-439/compare-banners.png,qa-before/,qa-after/ui::tests::displayable_never_leaves_a_mark_its_font_lackse+ U+0301 unchanged. Host fonts: ideographs with U+1AB0, Thai with U+1AB0 and U+0E31, Arabic with U+1AB0 and U+064E, laid out with no glyph 0origin/mainthe hermetic case fails and the host case draws a box; on the first revision of this fix the Thai case still drew a boxbefore-tests.txt,before-host-boxes.txt,r2/before-hermetic.txt,r2/before-host.txt,r2/after-tests.txt日᪰本᪰-app, Thai label and banner日…本…-app,ก…-app, no boxescompare-labels.png,crop-after-thai-banner.png,crop-after-thai-label.png,qa-after-r2/"\u{2067}e\u{1ab0}\u{2069} rest"; QA label\u{2067}ก᪰\u{2069}-app\u{2067}e…\u{2069} rest, and the label readsก…-app. On 1f12029 the closing U+2069 was droppedr3/before.txt,r3/viewer-tests.txt,crop-after-bidi-label.png,qa-after-r3/wrap,displayableand layout tests; QA Latin labelcafé-appr2/viewer-tests.txt,qa-after/latin-label.png-D warnings,PICKFORGE_REQUIRE_XVFB=1 cargo test -p pickforge-viewerr2/fmt.txt,r2/clippy.txt,after-merge-viewer-tests.txt,r3/clippy.txt,r3/viewer-tests.txtfull-suite.shat 1f12029; 3bd7358 changes onlydisplayableand its test~/.pickforge/investigations/438-439/full/,full/emulator-rerun.txtpickcheck check --base origin/main --fail-on new,worsened,unmatched; gitleaks on the branch commitspickcheck.jsonAll evidence paths are under
~/.pickforge/investigations/438-439/.Known limit: the host-font part of the #439 test runs only where a host font draws U+1AB0 (it ran here). Without one it prints "skipped", and the hermetic cases remain the guard.
Not caused by this change: a long decomposed Latin word in the banner shows a gap about every 32 clusters, on
origin/maintoo. Filed as #450.Review
Sol, round 1 at eed0076: 6/10. Blocker: a mark kept after a lost mark attached to the ellipsis and drew as a box (
ก\u{1AB0}\u{0E31}). Fixed in 1f12029. Round 2 at 1f12029: 9/10, no findings.Fable at eed0076: 9/10. Its nits, the same mark after the ellipsis and the
wrapdoc, are fixed in 1f12029. It accepted the host-only test limit above. Fable recheck at 1f12029: 9/10. Nit: a bidi control right after a lost mark was dropped with the rest of its cluster, so an override or isolate did not close. Fixed in 3bd7358: characters that draw nothing stay after the ellipsis. Its second nit is the host-only test limit above. Sol at 3bd7358: 10/10, no findings.