fix(web): respect iOS safe areas across mobile chrome#2392
fix(web): respect iOS safe areas across mobile chrome#2392jappyjan wants to merge 2 commits intopingdotgg:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds safe-area inset CSS utility classes and applies them across layout components (header, input bar, sidebar) to properly reserve space for device notches, Dynamic Island, and home indicator regions on iOS. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The viewport already opted into viewport-fit=cover but no element honored env(safe-area-inset-*), so on an iPhone the chat header sat under the Dynamic Island, the composer hid behind the home indicator, and the mobile sidebar drawer ran under the camera in landscape. Add pt-safe / pb-safe / pl-safe / pr-safe @Utility classes for the sidebar drawer (no other padding to combine with) and use inline calc() with env(safe-area-inset-*) on the chat top bar and the composer wrapper, where the existing px/py values must be preserved on devices without safe areas. Insets resolve to 0 on non-iOS, so desktop and Android layouts are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
f9955bb to
62ee822
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/index.css`:
- Around line 65-76: The Stylelint config is flagging Tailwind v4's custom
at-rule "@utility" in apps/web/src/index.css; update .stylelintrc.json to allow
it by adding or merging a rule entry for "at-rule-no-unknown" that supplies an
ignoreAtRules array including "utility" (and any other Tailwind at-rules you
use), e.g. add "rules": { "at-rule-no-unknown": [true, { "ignoreAtRules":
["utility"] }] } so the `@utility` declarations in index.css (padding-safe
utilities) are not treated as unknown at-rules.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9fb2038b-732c-4a48-ac8c-83238e731845
📒 Files selected for processing (3)
apps/web/src/components/ChatView.tsxapps/web/src/components/ui/sidebar.tsxapps/web/src/index.css
ApprovabilityVerdict: Approved Pure CSS changes adding iOS safe-area-inset support for mobile browsers. The utilities use standard env() values that fall back to 0 on non-iOS devices, making this a low-risk styling fix with no runtime logic changes. You can customize Macroscope's approvability policy. Learn more. |
Summary
`viewport-fit=cover` was already in place, but no element in the codebase honored `env(safe-area-inset-*)`. On iPhone the chat header / hamburger sat under the Dynamic Island, the composer hid behind the home indicator, and the mobile sidebar drawer ran under the camera in landscape.
Approach
Test plan
Screenshots / video
Note
Respect iOS safe areas in mobile Chrome for chat header and sidebar
pt-safe,pb-safe,pl-safe, andpr-safeTailwind utilities in index.css that applyenv(safe-area-inset-*)padding with amax(..., 0px)guard, requiringviewport-fit=cover.Macroscope summarized 9d8052b.
Note
Low Risk
Low risk UI-only layout adjustments; main risk is unintended padding/spacing regressions on mobile breakpoints due to new safe-area calculations.
Overview
Fixes iOS notch/Dynamic Island and home-indicator overlap by making top-level mobile chrome respect
env(safe-area-inset-*).Adds Tailwind
pt-safe/pb-safe/pl-safe/pr-safeutilities inindex.css, applies them to the mobile sidebar sheet wrapper insidebar.tsx, and updatesChatView.tsxto use safe-area-aware padding for the chat header and composer area (while keeping the Electron header layout unchanged).Reviewed by Cursor Bugbot for commit 9d8052b. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Release Notes