Skip to content

Safe Area Support for Mobile Devices#15

Open
kksys wants to merge 2 commits intoycanardeau:mainfrom
kksys:feature/support-safe-area
Open

Safe Area Support for Mobile Devices#15
kksys wants to merge 2 commits intoycanardeau:mainfrom
kksys:feature/support-safe-area

Conversation

@kksys
Copy link
Copy Markdown

@kksys kksys commented Oct 2, 2025

Safe Area Support for Mobile Devices

Overview

This PR adds support for safe area insets, improving the UI experience on devices with notches or rounded corners (such as iPhones and some Android devices). The changes ensure that key UI components are not obscured by device-specific display features.

Relevant Issue

This PR fixes #16

Changes

  • index.html

    • Added viewport-fit=cover to the viewport meta tag.
    • Added iOS-specific meta tags for web app capability and status bar style.
  • Global Styles

    • Introduced src/styles.css to define CSS variables for fixed header height and safe area offset.
  • Header, BottomBar, and PlayQueue Components

    • Updated padding for Header, BottomBar, and HydrangeanDiva components to respect safe area insets using env(safe-area-inset-*).
    • Padding values now use theme-managed spacing (euiTheme.size.s and euiTheme.size.l) for consistency.

Motivation

Without these adjustments, UI elements may be partially hidden or difficult to interact with on devices with display cutouts. This update ensures a consistent and accessible user experience across all supported devices.

Points for Review

  • CSS Appropriateness: Check if the use of CSS is appropriate and if any unnecessary or overriding style specifications remain.
  • euiTheme Utilization: Assess if using the padding values from euiTheme for layout adjustments in each component seems consistent with our theme and design system.

Testing

  • Verified on below devices:

    • iPhone X or newer models with a notch or Dynamic Island (e.g., iPhone 16 Plus).
    • less than iPhone X models without a notch or Dynamic Island (e.g., iPhone SE 2nd).
    • PC browser (Safari and Chrome on Apple Silicon Mac)
  • Confirmed that all interactive elements remain fully visible and accessible.

Before and After Screenshots (or Video)

Portrait

Before After
Models with a notch or Dynamic Island IMG_8478 IMG_8477
Models without a notch or Dynamic Island IMG_8419 IMG_8420

Landscape

Before After
Models with a notch or Dynamic Island IMG_8479 IMG_8480
Models without a notch or Dynamic Island IMG_8421 IMG_8422

@kksys kksys changed the title Support for iOS Safe Area Safe Area Support for Mobile Devices Oct 2, 2025
@kksys kksys marked this pull request as ready for review October 2, 2025 16:57
@@ -0,0 +1,6 @@
:root {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do you need this css file? I'd like to stick with the default UI style as much as possible without using custom styles.

Comment on lines +192 to +195
style={{
paddingLeft: `calc(env(safe-area-inset-left) + ${euiTheme.size.l}px)`,
paddingRight: `calc(env(safe-area-inset-right) + ${euiTheme.size.l}px)`,
}}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What's the purpose of this style?

Comment on lines +201 to +205
style={{
paddingLeft: `calc(env(safe-area-inset-left) + ${euiTheme.size.l}px)`,
paddingRight: `calc(env(safe-area-inset-right) + ${euiTheme.size.l}px)`,
}}
>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

this

Comment on lines +574 to +578
style={{
paddingLeft: `calc(env(safe-area-inset-left) + ${euiTheme.size.s}px)`,
paddingRight: `calc(env(safe-area-inset-right) + ${euiTheme.size.s}px)`,
paddingBottom: `calc(env(safe-area-inset-bottom) + ${euiTheme.size.s}px)`,
}}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

this

Comment on lines +95 to +100
style={{
paddingTop: 'env(safe-area-inset-top)',
paddingLeft: `calc(env(safe-area-inset-left) + ${euiTheme.size.s}px)`,
paddingRight: `calc(env(safe-area-inset-right) + ${euiTheme.size.s}px)`,
height: 'var(--euiFixedHeadersOffset)',
}}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

and this

@kksys kksys force-pushed the feature/support-safe-area branch from 94b5db7 to aec07f5 Compare December 23, 2025 17:58
ycanardeau added a commit that referenced this pull request Dec 30, 2025
…tor-13.15.20

Bump validator from 13.9.0 to 13.15.20
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.

UI elements are obscured on devices with display notches or rounded corners

2 participants