Skip to content

fix(viewer): keep combining marks with their base character - #451

Merged
ElbertePlinio merged 5 commits into
mainfrom
fix/438-439-combining-marks
Oct 29, 2026
Merged

ElbertePlinio merged 5 commits into
mainfrom
fix/438-439-combining-marks

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

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. displayable now 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

Requirement Verification Scenario and edge cases Result Evidence
#438: break long words only at cluster boundaries ui::tests::wrap_keeps_marks_with_their_character Ideographs each followed by U+1AB0, decomposed e + U+0301, both as one word wider than the line; truncation to two lines No line starts with a mark, lines join back to the word, truncation keeps é whole. Fails on origin/main ~/.pickforge/investigations/438-439/before-tests.txt, after-tests.txt
#438: wrapped word with marks on screen QA on a private Xvfb, before and after builds 250 ideographs each followed by U+1AB0, no spaces; a 150-cluster decomposed Latin word Before: lines 2 and 3 start with a lone mark. After: every line starts with an ideograph ~/.pickforge/investigations/438-439/compare-banners.png, qa-before/, qa-after/
#439: never draw a mark as a box ui::tests::displayable_never_leaves_a_mark_its_font_lacks Hermetic: a base no font draws takes its marks into the ellipsis; a mark no font has; a mark after a lost mark; e + 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 0 Pass. On origin/main the hermetic case fails and the host case draws a box; on the first revision of this fix the Thai case still drew a box before-tests.txt, before-host-boxes.txt, r2/before-hermetic.txt, r2/before-host.txt, r2/after-tests.txt
#439: cluster no single host font covers, on screen QA, before and after CJK label 日᪰本᪰-app, Thai label and banner Before: a box after each ideograph. After: 日…本…-app, ก…-app, no boxes compare-labels.png, crop-after-thai-banner.png, crop-after-thai-label.png, qa-after-r2/
A bidi control after a lost mark stays Same test, hermetic case "\u{2067}e\u{1ab0}\u{2069} rest"; QA label \u{2067}ก᪰\u{2069}-app The isolate must still close after the ellipsis Pass: \u{2067}e…\u{2069} rest, and the label reads ก…-app. On 1f12029 the closing U+2069 was dropped r3/before.txt, r3/viewer-tests.txt, crop-after-bidi-label.png, qa-after-r3/
Text without marks unchanged Existing wrap, displayable and layout tests; QA Latin label café-app Pass, same pixels r2/viewer-tests.txt, qa-after/latin-label.png
Viewer checks fmt, clippy -D warnings, PICKFORGE_REQUIRE_XVFB=1 cargo test -p pickforge-viewer Also after merging main (fontdb 0.24) Pass; 171 viewer tests after the merge, and again at 3bd7358 r2/fmt.txt, r2/clippy.txt, after-merge-viewer-tests.txt, r3/clippy.txt, r3/viewer-tests.txt
Full suite full-suite.sh at 1f12029; 3bd7358 changes only displayable and its test build, lint, typecheck, viewer build, vitest coverage, cargo cargo 353 passed; vitest 3503 passed and 1 failed: an Android emulator test this change does not touch, which passes 5 of 5 alone and is filed as #449 ~/.pickforge/investigations/438-439/full/, full/emulator-rerun.txt
PickCheck and secret scan pickcheck check --base origin/main --fail-on new,worsened,unmatched; gitleaks on the branch commits 17 files checked at 3bd7358 0 violations; no leaks pickcheck.json

All 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/main too. 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 wrap doc, 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.

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.
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.
@ElbertePlinio
ElbertePlinio merged commit 8bbcfd7 into main Oct 29, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/438-439-combining-marks branch October 29, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant