Skip to content

feat: detect screen SafeArea ownership for Flutter guidance - #53

Open
PacteraSunChao wants to merge 1 commit into
mhmzdev:mainfrom
minefocus:feat/screen-safe-area-evidence
Open

PacteraSunChao wants to merge 1 commit into
mhmzdev:mainfrom
minefocus:feat/screen-safe-area-evidence

Conversation

@PacteraSunChao

@PacteraSunChao PacteraSunChao commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Detect when a screen must own the runtime top safe-area inset (no App Bar present to absorb it).
  • Expose ScreenSafeAreaInfo on screen layout analysis output.
  • Generate Flutter Scaffold guidance that wraps the body in SafeArea only for unhandled edges, and routes footer sections to bottomNavigationBar.

Motivation

Design frames often omit system insets. Without explicit safe-area ownership, agents either hardcode design insets into component heights or wrap the whole screen blindly. This change records whether the screen itself must handle the top inset, and emits matching Flutter guidance.

Changes

  • Types: add ScreenSafeAreaInfo and attach optional safeArea to ScreenLayoutInfo.
  • Extractor: detectScreenSafeArea() returns { top: { required: true, reason: 'no-app-bar' } } when no App Bar is detected.
  • Reports / guidance: print Top Safe Area evidence; clarify that insets belong to screen composition; wrap body in SafeArea with top/bottom disabled when AppBar/footer already occupy those edges.

Test plan

  • npm run build succeeds
  • Analyze a screen without App Bar → report includes Top Safe Area: Required at runtime
  • Analyze a screen with App Bar → no top SafeArea requirement; guidance uses SafeArea(top: false, ...) when only bottom needs protection
  • Footer section appears under bottomNavigationBar, not inside body children
  • Spot-check that Logger-only changes are not included

Co-authored-by: Cursor <cursoragent@cursor.com>
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