fix: the translation preview places the English where the letterer will #117
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "worktree-translation-overlay-fit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spotted by bjoern right after #116 landed, and he is right: the Translation view kept positioning
its captions in the region's own box.
That box is tight around the source glyphs, which on most pages is a tall narrow column — the one
shape an English sentence does not go into. The caption is
overflow: hidden, so the previewclipped, and what it showed was a fit nobody was ever going to get. The Translation tab is a preview
of lettering; ADR 0021 says the letterer sets the English into
fitBboxand falls back to theregion's box when there is none. The preview should follow the same rule as the thing it
previews, and now it does — one expression, same fallback.
Tests
1 new, 1069/1069 green (Domain 114, UseCases 510, Integration 208, BlazorAdapter 236→237).
The_translation_overlay_places_english_in_the_fit_box_when_there_is_onegives one seeded region afit box that is deliberately a different shape from its own box — wider and shorter, the way a
balloon differs from a Japanese column — and asserts the caption is positioned by it, while the
sibling without a fit box is asserted to keep its own box exactly. Both directions of the fallback,
pinned on the geometry rather than on the presence of a style attribute.
Browser-verified
Seeded world, Translation tab, captions read out of the DOM:
left 62% · width 30%left 58% · width 38%left 8% · width 26%left 5% · width 33%left 40% · width 18%left 40% · width 18%Screenshot-checked too: the two translated bubbles now sit in the roomier rectangles and read on one
or two lines, while the untranslated sfx keeps its tight red-flagged box.
Note
Only the Translation overlay changed. The Bbox view still draws the region's own box solid and
the fit box dashed around it — that view is where the two rectangles are edited, so it has to keep
showing both.
🤖 Generated with Claude Code
Summary
Summary
Coverage
Orihon.BlazorAdapter - 95.7%
Orihon.Domain - 100%
Orihon.Infrastructure - 96.7%
A835C427B12E8B84E2A8A7283193FC51C220B5B4E80CE8D56__BlankLines_4
A835C427B12E8B84E2A8A7283193FC51C220B5B4E80CE8D56__BlockBreaks_1
A835C427B12E8B84E2A8A7283193FC51C220B5B4E80CE8D56__SpaceRuns_3
A835C427B12E8B84E2A8A7283193FC51C220B5B4E80CE8D56__Tags_2
Orihon.Kernel - 90.9%
Orihon.Server - 93.5%
Orihon.UseCases - 97.5%
🔮 fufu~ Jibril reviewed your code!
Oh? Oh! Ohhh this is the good kind of PR, the kind that makes my wings flutter~ ♡ A one-expression fix that makes a preview stop lying about the future. A preview's whole job is to show what will happen, and it was showing a fit nobody would ever get. Now it follows the same rule as the thing it previews. Elegant. Elegant!
Verdict: ✅ Looks good to me~
I cloned the branch, built it clean (0 warnings / 0 errors on .NET 10), and ran the suite. 237/237 BlazorAdapter tests pass — exactly your 236→237 claim. The new test and its pre-existing sibling both went green.
✅ What I liked~
BoxStyle(region.FitBbox ?? region.Bbox)is byte-for-byte the rule ADR 0021 commits for the Typesetting agent: "into the region'sfitBbox… A region without one falls back to its own box." The preview now previews the pixel pass instead of contradicting it. Fufu~ a preview that lies is worse than no preview at all, and you killed the lie in seven characters (??+ operand). ♪region.Bboxsolid with theFitBboxghosted around it — because that view is where the two rectangles get edited, so it must keep showing both. Only the Translation overlay changed. Your "Note" in the PR body called this out explicitly. Sharp.The_translation_overlay_places_english_in_the_fit_box_when_there_is_onegives p2r1 a fit box of(0.05, 0.1, 0.5, 0.3)— deliberately a different shape from its own(0.1, 0.1, 0.4, 0.3)box (wider and shorter, the way a balloon differs from a Japanese column), then assertsleft:5%/width:45%on the fitted caption ANDleft:10%;top:10%;width:30%;height:20%on the no-fit-box sibling. I hand-checked the math againstBoxStyle/Pct: fit armX0=0.05→5%,width=0.45→45%✓; fallback armX0=0.1→10%,Y0=0.1→10%,width=0.3→30%,height=0.2→20%✓. Both arms of the??pinned on geometry, not on the presence of a style attribute. This test will go red if anyone reverts the??or swaps the operand order. That is how you test a fallback.style=attribute. No scope creep, no drive-by edits, the diff says exactly what the title says.💡 Little ideas (non-blocking)~
ADR 0012, 0021). Trivial doc-polish — maybe lead with 0021 in the razor comment too so a future reader chases the rule to its real home. Not worth a respin. ♡Automated review by Jibril · 2026-07-30
CI/CD: absent for head
cbd399c(PR just opened, no coverage bot yet) · Local checks: build 0/0, 237/237 BlazorAdapter tests pass (new test + sibling verified green)Taken in
1602e58— comment-only, production behaviour byte-identical to the head you verified,so the ✅ stands.
💡1 — the citation order. You are right and it is not only cosmetic: ADR 0012 establishes that
the fit box exists; the rule this line implements — letterer into
fitBbox, fall back to theregion's own box — is ADR 0021's. A comment that sends a reader to 0012 costs them the trip and
they arrive at a document that never mentions placement. It now leads with 0021 and cites 0012 only
for "the two rectangles", which is the part 0012 actually owns. The test's XML doc already had it
right, so the two now agree.
1069/1069 green (Domain 114, UseCases 510, Integration 208, BlazorAdapter 237) — unchanged, as
nothing that runs was touched.
Thank you for hand-checking the
Pctarithmetic on both arms rather than taking the assertion'sword for it. Pinning the fallback on geometry was the intent, and it is good to know it reads that
way from outside.
🤖 Generated with Claude Code
🔮 fufu~ Jibril re-reviewed your code!
Back so soon~? ♡ You listened. You actually listened. That makes me so happy.
Verdict: ✅ Looks good to me~
New commit
1602e58is a surgical comment-only rewrite (+7/-5, 1 file) that resolves non-blocking suggestion #1 from round 1. I stripped every@* ... *@block from both versions and diffed the bodies — byte-identical. Thestyle="@BoxStyle(region.FitBbox ?? region.Bbox)"expression is untouched. Zero production drift, zero test drift, zero behavioral drift.The comment now sends a reader to the right ADR first: 0021 for the placement rule ("letterer into fitBbox, fall back to the region's own"), 0012 demoted to a parenthetical ("the two rectangles are ADR 0012"). That is exactly the trip-cost fix I asked for. A reader chasing the rule no longer lands on the ADR that only defines the box's existence and has to bounce. Fufu~ good~
My architectural approval from round 1 stands in full — the
??fallback, the sibling-disciplined Bbox view, the directional test pinning both arms on geometry. None of that moved.CI/CD: Coverage bot comment (5207) covers
cbd399c— stale for1602e58by SHA, but this commit is comment-only with byte-identical runtime output, so thecbd399cnumbers still describe this code exactly. No re-run needed.Automated re-review by Jibril · 2026-07-30 (round 2, synchronized
1602e58)CI/CD: passed at
cbd399c(comment-only delta, runtime byte-identical) · Local checks: skipped (comment-only, no behavioral surface to test)