Skip to content

fix(settings): scale AI app generator suggestion strip height with text size (#19239) - #21341

Merged
kodjima33 merged 4 commits into
BasedHardware:mainfrom
Dragonire9:fix/ai-app-generator-suggestion-text-scale-19239
Oct 13, 2026
Merged

kodjima33 merged 4 commits into
BasedHardware:mainfrom
Dragonire9:fix/ai-app-generator-suggestion-text-scale-19239

Conversation

@Dragonire9

@Dragonire9 Dragonire9 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #19239.

Scales the height of the suggestion strip in AiAppGeneratorPage (app/lib/pages/settings/ai_app_generator_page.dart) dynamically with MediaQuery.textScalerOf(context).

Root Cause

Previously, the horizontal suggestion cards strip ("Try something like") was wrapped in a fixed SizedBox(height: 160). Each _buildSuggestionCard holds up to 3 lines of OmiType.callout text (height: 1.4) plus a compact "Try it" button inside 20 pt padding. At larger text sizes (1.15x, 1.3x, 1.5x), the column inside the card exceeded the 160 pt height and overflowed at the bottom by 6 pt to 30 pt.

Fix Details

  • Scaled the SizedBox height with the active text scale factor while preserving the 160 pt baseline:
    height: 160 * math.max(1.0, MediaQuery.textScalerOf(context).scale(16) / 16),

Verification

  • Added hermetic regression widget test in app/test/widgets/settings/ai_app_generator_large_text_test.dart pumping AiAppGeneratorPage across 1.0x, 1.15x, 1.3x, and 1.5x text scales on a 390 pt viewport and asserting zero overflow exceptions.
  • Added unreleased changelog fragment app/changelog/unreleased/20261012-ai-app-generator-suggestion-text-scaling.json.

View guided diff

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for this clean, well-scoped fix for #19239 — nice first contribution.

Review notes on the changed files:

  • app/lib/pages/settings/ai_app_generator_page.dart — the scaled height 160 * math.max(1.0, MediaQuery.textScalerOf(context).scale(16) / 16) is the right approach: it keeps the 160pt baseline below 1.0x (smaller text does not shrink the strip) and grows linearly with the active text scale. Using textScalerOf rather than the deprecated textScaleFactorOf is good, and the change is layout-safe: the strip's column sits inside an Expanded, so the taller strip at 1.5x stays bounded. The comment explaining the three-lines-plus-"Try it" rationale is helpful.

  • app/test/widgets/settings/ai_app_generator_large_text_test.dart — solid hermetic regression test. _TestEnvFields points apiBaseUrl at an unroutable address, so fetchSamplePrompts() falls into its catch branch and uses the provider's hardcoded fallback prompts — which is exactly what the find.text('A playful gratitude spinner for daily positivity') assertion relies on — so no network is needed. Pumping at 1.0/1.15/1.3/1.5 on a 390pt viewport and asserting takeException() is null directly covers the reported overflow range, and initializeForLocalHarness follows the established repo test-harness pattern.

  • app/changelog/unreleased/20261012-ai-app-generator-suggestion-text-scaling.json — matches the existing unreleased-fragment convention.

One minor, non-blocking observation: with Android 14's non-linear text scaling, scale(16) / 16 is an approximation at a single reference size, so the strip could be a point or two off at extreme settings — a reasonable trade for the simplicity, and the reported cases are covered.

Left a positive signal. No Flutter test workflow appears to have run on this PR yet (only a neutral AI-reviewer check), so from static review this looks ready — the new test will get its first CI exercise when a maintainer merges or triggers a run.

Filed by the automated maintainer-review bot on behalf of the Omi maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added flutter flutter work positive-signal Automation verified a genuine fix/quality contribution labels Oct 12, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile bug fix: suggestion-strip height now scales with MediaQuery.textScalerOf per issue #19239; verified bug still present on main (height: 160 is unscaled), small scoped diff with a new regression widget test across 4 text scales. Confidence 5/5.

@kodjima33
kodjima33 merged commit 8c2909e into BasedHardware:main Oct 13, 2026
1 check passed
@Dragonire9

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging! 🙏

Bounty Payout Details:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI app generator: suggestion cards overflow at larger text sizes

3 participants