Skip to content

fix(frontend): adapt Android screens to constrained layouts - #391

Merged
LUPENGHAN merged 1 commit into
1024XEngineer:mainfrom
Alexander-Noah:codex/fix-android-adaptive-layout
Aug 27, 2026
Merged

LUPENGHAN merged 1 commit into
1024XEngineer:mainfrom
Alexander-Noah:codex/fix-android-adaptive-layout

Conversation

@Alexander-Noah

Copy link
Copy Markdown
Contributor

背景

Android 设备在窄屏、大字体、刘海屏或手势导航场景下存在以下布局问题:

  • 日程页面标题和用户操作区可能互相挤压。
  • 页面内容可能被底部悬浮语音栏遮挡。
  • 权限引导页没有完整避开顶部状态栏和底部手势区域。
  • 较长的权限说明可能压缩右侧操作按钮。

修改内容

  • 为 Android 日程页面显式应用顶部安全区。
  • 为日程列表预留悬浮语音栏占用的可视区域,避免内容被覆盖。
  • 根据屏幕宽度和字体缩放比例计算有效宽度;空间不足时,将日期标题和用户操作区改为上下排列。
  • 为权限引导页增加顶部和底部安全区适配。
  • 让权限列表占用剩余空间并保持可滚动。
  • 调整权限说明和操作按钮的伸缩规则,避免长文本挤压按钮。
  • 补充窄屏、大字体、安全区和悬浮控件布局的回归测试。
  • 为根组件测试补充安全区上下文 mock。

为什么这样修改

仅在滚动内容末尾增加 paddingBottom,不能保证滚动视口始终避开悬浮语音栏。因此改为直接为滚动视口预留底部空间,使内容在整个滚动过程中都不会位于悬浮控件下方。

Android 对自动安全区调整的处理与 iOS 不同,因此在页面容器上显式应用 Android 顶部 inset,同时保留 iOS 的自动调整行为,避免重复留白。

标题区域是否需要换行不能只依据物理屏幕宽度。将屏幕宽度除以字体缩放比例后再判断,可以同时覆盖窄屏和系统大字体场景。

验证

  • Android 手动布局测试
  • npm run typecheck
  • npm run lint:0 errors,1 个未修改文件中的既有 warning
  • Vitest:87 passed
  • Jest:723 passed
  • git diff --check

Closes #389

Respect system insets and floating controls on schedule and permission screens.
Stack dense header actions on narrow or font-scaled viewports.
@Alexander-Noah
Alexander-Noah marked this pull request as ready for review August 26, 2026 10:38
@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
backend 96.64% <ø> (ø)
frontend 89.82% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...minder/presentation/PermissionOnboardingScreen.tsx 100.00% <100.00%> (ø)
...s/schedule/presentation/ScheduleCalendarScreen.tsx 93.65% <100.00%> (+1.19%) ⬆️
frontend/src/shared/ui/floatingVoiceBarLayout.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fennoai fennoai Bot left a comment

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.

审查结论

本次修改将 Android 顶部安全区移到固定页面边界,并按悬浮语音栏的实际位置缩小日历滚动视口;窄屏/大字体下的标题堆叠逻辑与账号操作区约束一致。权限页的可滚动剩余空间、底部手势安全区和长文案伸缩规则也与 #389 的验收契约相符,未发现会导致业务回归或布局目标失效的具体问题。

验证了固定提交范围 21841bc...d567175 的全部 6 个变更文件及其调用关系;git diff --check 通过,GitHub 上的 Frontend (lint, types, build) 检查通过。由于当前工作区未安装可执行的 frontend/node_modules,无法在本地重新运行 Jest/TypeScript/ESLint。

View job run

@LUPENGHAN LUPENGHAN left a comment

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.

ok

@LUPENGHAN
LUPENGHAN merged commit aaa071d into 1024XEngineer:main Aug 27, 2026
9 checks passed
@Alexander-Noah
Alexander-Noah deleted the codex/fix-android-adaptive-layout branch August 27, 2026 03:07
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.

修复 Android 日历与权限页在窄屏、大字体和安全区下的布局问题

2 participants