Skip to content

fix(onboarding): keep consent CTA visible at large text scaling#7207

Merged
mdmohsin7 merged 1 commit intomainfrom
caleb/consent-large-text-overflow
May 8, 2026
Merged

fix(onboarding): keep consent CTA visible at large text scaling#7207
mdmohsin7 merged 1 commit intomainfrom
caleb/consent-large-text-overflow

Conversation

@mdmohsin7
Copy link
Copy Markdown
Member

Summary

  • Data & Privacy consent screen pushed the Agree and continue button off-screen when system text scaling was set to a large accessibility size (heading + body filled the entire viewport, button + footer link clipped below the bottom edge).
  • Cap the bottom card at the available viewport height (screen - safeAreaTop - 16) and wrap the heading/body/footer in a Flexible(SingleChildScrollView) so the body scrolls while the CTA stays pinned at the bottom.

Files

  • app/lib/pages/onboarding/ai_consent_widget.dart

Test plan

  • Default text size (iPhone 15 Pro / Pixel 8a): screen looks identical to before — bottom card with rounded top corners, heading + body fit without scroll, button pinned at bottom.
  • iOS Settings → Display & Brightness → Text Size → max: heading and body remain readable, body is scrollable inside the card, Agree and continue button stays visible and tappable.
  • iOS Settings → Accessibility → Larger Text → max accessibility size: same as above.
  • Android Settings → Display → Font size → largest: same as above.
  • Privacy Policy and Terms of Service link taps still work (recognizers preserved).
  • No regressions on rotation / split-view (iPad).

Cap the bottom card at the available viewport height and make the
heading/body/footer scrollable so the 'Agree and continue' button
stays pinned at the bottom when system text is enlarged.
Previously the inner Column had unbounded height and pushed the
button off-screen for accessibility text sizes.
@mdmohsin7 mdmohsin7 marked this pull request as ready for review May 8, 2026 14:18
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR fixes an accessibility regression where the Agree and continue button on the AiConsentWidget consent screen was pushed off-screen at large system text sizes. The fix wraps the Container in a ConstrainedBox (capping the card at screen_height - safeAreaTop - 16) and encloses the heading/body/footer within a Flexible(SingleChildScrollView) so those sections scroll while the CTA stays pinned below them.

  • Layout behaviour at normal sizes — unchanged: the inner Column(mainAxisSize: MainAxisSize.min) + Flexible(fit: FlexFit.loose) combination shrink-wraps the card to its natural content height, so the card looks identical to before.
  • Layout behaviour at large/max text sizes — the card is capped by ConstrainedBox, the flex allocation (maxHeight − 28 − 56) is handed to the SingleChildScrollView, the content becomes scrollable, and the button always remains visible.

Confidence Score: 4/5

Safe to merge — the layout change correctly preserves the CTA at all text scales without touching any business logic or data paths.

The ConstrainedBox + Flexible(SingleChildScrollView) approach is a well-established Flutter pattern for this use case and works correctly at both default and maximum accessibility text sizes. The only finding is a pre-existing double bottom safe-area accounting that causes the button to float higher than intended on devices with a home-indicator inset; the defect is cosmetic and not introduced by this change.

app/lib/pages/onboarding/ai_consent_widget.dart — specifically the combination of manual bottom padding and SafeArea around the inner column.

Important Files Changed

Filename Overview
app/lib/pages/onboarding/ai_consent_widget.dart Wraps existing bottom-card content in ConstrainedBox + Flexible(SingleChildScrollView) to keep the CTA visible at large text scales; pre-existing SafeArea + manual bottom-padding duplication is preserved but not worsened.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[build context] --> B[MediaQuery.of context]
    B --> C[Outer Column]
    C --> D[Expanded - fills remaining space]
    C --> E[ConstrainedBox\nmaxH = screen - safeTop - 16]
    E --> F[Container\nblack, rounded top corners\npadding bottom = safeBottom + 8]
    F --> G[SafeArea top:false\nadds safeBottom padding]
    G --> H[Inner Column\nmainAxisSize: min]
    H --> I[Flexible - FlexFit.loose\nallocation = maxH - 84px]
    I --> J[SingleChildScrollView]
    J --> K[Heading + Body + Footer link]
    H --> L[SizedBox height 28 - rigid]
    H --> M[ElevatedButton height 56 - rigid]
Loading

Reviews (1): Last reviewed commit: "fix(onboarding): keep consent CTA visibl..." | Re-trigger Greptile

Comment on lines +49 to +55
padding: EdgeInsets.fromLTRB(32, 26, 32, mediaQuery.padding.bottom + 8),
decoration: const BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.only(topLeft: Radius.circular(40), topRight: Radius.circular(40)),
),
child: SafeArea(
top: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Double bottom safe-area padding

The Container already sets padding.bottom = mediaQuery.padding.bottom + 8, and then SafeArea(top: false) adds another mediaQuery.padding.bottom below the inner Column's content. On a device with a 34 pt home-indicator inset (iPhone 15 Pro) the button ends up sitting 76 pt above the card's bottom edge instead of the intended ~42 pt — noticeably floating when viewed at default text size. Removing one of the two accounting mechanisms (either drop SafeArea and keep the manual padding, or zero out the manual bottom padding and rely purely on SafeArea) would fix the over-spacing. This behaviour predated this PR but the refactor is a good opportunity to clean it up.

@mdmohsin7 mdmohsin7 merged commit b3955bb into main May 8, 2026
3 checks passed
@mdmohsin7 mdmohsin7 deleted the caleb/consent-large-text-overflow branch May 8, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant