Make text-zone auto-fit respect every language#78
Merged
Conversation
The zone auto-fit shrank each language independently, so a longer translation could overflow the box even when the edited language fit. Add a "Same size for all languages" mode (on by default): the font is reduced to the size that fits the most-constrained project language and applied uniformly, so the text stays inside the zone — entirely and without breaking a word — in every language, with consistent sizing. - app.js: split computeZoneFit into per-language zoneFitForText + a uniform pass over state.projectLanguages (min scale); textZone.uniform flag + normalization; toggle wiring/sync - index.html / styles.css: "Same size for all languages" toggle Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5pzx2vkZB8DN2dDy4YRNH
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.
Summary
Follow-up to #77. The text-zone auto-fit shrank each language independently, so a longer translation (e.g. German/French) could overflow the zone even when the edited language fit perfectly — the zone wasn't respected across languages.
Fix
Adds a "Same size for all languages" mode to the Text zone (on by default):
Implementation
app.js: splitcomputeZoneFitinto a per-languagezoneFitForText+ a uniform pass that takes the minimum scale overstate.projectLanguages;textZone.uniformflag added to defaults + normalization; toggle wiring and UI sync.index.html/styles.css: "Same size for all languages" toggle.Verification
node --check app.jspasses.🤖 Generated with Claude Code
Generated by Claude Code