Repository navigation
Localized hero captures, logical crops, and fewer lone headline words - #5
Merged
Merged
Conversation
… with their neighbours
A hero's source may now contain {locale}, so each listing locale's hero shows Windows and the app
in that language. A locale whose capture is missing draws the en-US capture instead; a plain run
and --check both warn and name it, and --check still passes so captures can be localised one
locale at a time. The en-US capture is required, a capture without its sidecar is still an error,
and the text-free image always uses the en-US capture, since it serves an English page.
hero.crop is now in logical pixels. That is unchanged at 100% display scale, and lets one crop
serve 200% captures and locales captured at different scales. 200% captures were already drawn at
their logical size, so the layout is the same and the UI sharper.
When balancing leaves a word alone, each paragraph is now broken again into as many lines wherever
keeps fewer words alone, without running one sentence into the next on a line. The 10 percent
shrink also accepts a smaller size that leaves as many lone words in fewer lines. Persistent's
en-US "Your / reminders, one / click from the / Windows tray." becomes "Your reminders, / one
click / from the / Windows tray." Its de-DE "Deine" stays alone: "Deine Erinnerungen" measures
475 units at 48 against a 472-unit column, so no break fixes it, and 46, the first size that
fits it, is 11.5 percent below the largest fitting size (52).
Fourteen committed heroes across seven apps draw differently and need re-rendering after the
bump; the committed examples do not change.
…ink to 15 percent
With {locale} in a hero's source, devkit-store-hero --check now fails and names each listing
locale without its own capture, as winui-app-kit's screenshot check does. A plain run still draws
such a locale from the en-US capture, as a preview, and warns that --check will fail.
The lone-word search may now go up to 15 percent below the largest size that fits, still taking
the largest size that leaves no word alone. Persistent's de-DE headline now draws at 46 as
"Deine Erinnerungen / direkt im Windows- / Infobereich." instead of leaving "Deine" alone at 48.
With both commits, 16 committed heroes across seven apps draw differently and need re-rendering
(the previous commit's count of fourteen heroes across seven apps was wrong: it was six apps
before this change, and ImmichDrive ja-JP joins with it). The committed examples do not change.
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.
What changes for apps
sourcemay contain{locale}(raw/microsoft/{locale}/00-flyout-dark.png), so each listing locale's hero shows Windows and the app in that language. Every listing locale with its own record then needs its own capture:--checkfails and names each missing one, as winui-app-kit's screenshot check does. A plain run draws a missing locale from the en-US capture as a preview and warns. A capture without its sidecar is an error, and the text-free image always uses the en-US capture (the website is English). Asourcewithout{locale}behaves exactly as before.hero.cropis now in logical pixels too, which is identical at 100% (every app's captures today), and lets one crop serve 100% and 200% captures, including locales captured at different scales.Headline finding (Persistent de-DE "Deine")
No break fixes it: the headline fits at 52 at the largest, and "Deine Erinnerungen" measures 475 units at 48 against a 472-unit column. It first fits on one line at 46, 11.5 percent below 52, so the shrink limit is raised to 15 percent, and it now draws as "Deine Erinnerungen / direkt im Windows- / Infobereich." at 46.
Persistent's en-US also had a fixable lone word: "Your / reminders, one / click from the / Windows tray." now draws as "Your reminders, / one click / from the / Windows tray." at 58.
Re-render needed after the bump
Rendering every app's committed inputs with main and with this branch, 16 heroes in seven apps differ: DisplaySwitchr de-DE; ImmichDrive ja-JP; ChatMixr es-ES, pt-BR; Persistent en-US, es-ES, de-DE, pt-BR; Little Launcher es-ES, pt-BR; Tray Control for WSL es-ES, fr-FR, pt-BR; Repilot fr-FR, de-DE, pt-BR. PrintStream is unchanged, and so are the committed examples. Each loses a lone word or a line. Two (ChatMixr pt-BR, Repilot pt-BR) were clean three-line headlines that v0.29 reached by shrinking and now draw one size larger in four lines; that follows the rule and is kept. Use "16 heroes across seven apps" in the squash message; the first commit's count was wrong.
Tests
npm run validatepasses locally. New tests cover per-locale capture resolution, the preview fallback and--checkfailing on it, the 15 percent limit, logical crops on a 200% capture, the re-break that keeps "Your" with its line, refusing a sentence-straddling line, and preferring fewer lines at equal lone words.AI disclosure: this comment and the related code were written with the assistance of AI.