Refine genre title typography and layout logic in the search screen t…#1684
Merged
Conversation
…o improve readability and visual consistency across different card sizes.
### Typography & Layout Engine
- **GenreTypography**: Replaced the basic randomized style generator with a sophisticated `resolveTitlePresentation` engine.
- **Dynamic Line Breaking**: Implemented `findBestBreak` and a scoring algorithm to intelligently split genre names into two lines based on word count, character density, and orphan prevention.
- **Variable Font Optimization**: Fine-tuned `Google Sans Flex` variable font axes (Weight, Width, Slant, Grade, Roundness) using a jittered hashing strategy for deterministic yet expressive text styles.
- **Constraint-Aware Styling**: Added `TextMeasurer` integration to select the best-fitting style candidate (from Expressive to Compact) based on the available pixel width of the card.
- **Genre Profiling**: Introduced `GenreTitleProfile` to categorize titles (Compact, Dense, Very Dense) and apply specialized font scaling and width constraints.
### UI Components
- **GenreCategoriesGrid**: Updated `GenreCard` to use `BoxWithConstraints` and `rememberTextMeasurer` for responsive text rendering.
- **Layout Refinement**: Replaced the single `Text` element with a `Column` layout to support the new multi-line presentation logic, ensuring titles respect card boundaries while maintaining high visual impact.
- **Density Awareness**: Integrated `LocalDensity` to ensure typography scales correctly across different screen densities and font scale settings.
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.
…o improve readability and visual consistency across different card sizes.
Typography & Layout Engine
resolveTitlePresentationengine.findBestBreakand a scoring algorithm to intelligently split genre names into two lines based on word count, character density, and orphan prevention.Google Sans Flexvariable font axes (Weight, Width, Slant, Grade, Roundness) using a jittered hashing strategy for deterministic yet expressive text styles.TextMeasurerintegration to select the best-fitting style candidate (from Expressive to Compact) based on the available pixel width of the card.GenreTitleProfileto categorize titles (Compact, Dense, Very Dense) and apply specialized font scaling and width constraints.UI Components
GenreCardto useBoxWithConstraintsandrememberTextMeasurerfor responsive text rendering.Textelement with aColumnlayout to support the new multi-line presentation logic, ensuring titles respect card boundaries while maintaining high visual impact.LocalDensityto ensure typography scales correctly across different screen densities and font scale settings.