Skip to content

iOS: size status-bar tap proxy to real safe-area inset (#4978)#4981

Merged
liannacasper merged 1 commit into
masterfrom
fix-4978-ios-statusbar-proxy-frame
May 19, 2026
Merged

iOS: size status-bar tap proxy to real safe-area inset (#4978)#4981
liannacasper merged 1 commit into
masterfrom
fix-4978-ios-statusbar-proxy-frame

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

iPhone X+ behaviour is unchanged (safeAreaInsets.top ≈ 47/59 pt already
matched the proxy).

Test plan

  • Reporter (ios toolbar buttons very hard to hit #4978) confirms the Dtest.java reproducer: tapping the
    buttons in the custom toolbar at the visually rendered position now
    registers on a no-notch iPhone (e.g. iPhone SE / 8).
  • On a notched iPhone, status-bar tap-to-scroll-to-top (the Tapping a button in the StatusBar does not work on iOS device (iPhone Xr) #3589
    gesture) still triggers cn1FireStatusBarTap and scrolls the form.
  • Rotation portrait↔landscape keeps the proxy aligned with the
    status-bar strip (no spurious taps lost or intercepted after rotation).
  • Screenshot tests in hellocodenameone / Metal CI remain
    byte-identical (proxy lives at window level, outside self.view).

🤖 Generated with Claude Code

The previous fix for #3589 mounted CN1StatusBarTapProxyView at the
UIWindow level with frame height clamped to max(safeAreaInsets.top, 44)
in [20, 80]pt. On iPhones without a notch (safeAreaInsets.top = 20pt)
the proxy ended up 44pt tall while CN1's Toolbar StatusBar Container
sits at ~20pt, so a 20-44pt window-level touch sink swallowed taps on
toolbar content positioned right below the StatusBar -- buttons were
only reachable at the very bottom of the toolbar.

Use safeAreaInsets.top directly (falling back to UIApplication
statusBarFrame.size.height pre-iOS 11). Keep a 1pt floor so iOS still
routes UIStatusBarTapAction when the bar is hidden, and the existing
80pt cap for unusual device modes. Refresh the frame from
viewSafeAreaInsetsDidChange so rotations / split view / show-hide
status-bar transitions stay aligned.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 19, 2026

Compared 110 screenshots: 110 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 129 seconds

Build and Run Timing

Metric Duration
Simulator Boot 64000 ms
Simulator Boot (Run) 0 ms
App Install 13000 ms
App Launch 12000 ms
Test Execution 259000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1053.000 ms
Base64 CN1 encode 1228.000 ms
Base64 encode ratio (CN1/native) 1.166x (16.6% slower)
Base64 native decode 674.000 ms
Base64 CN1 decode 966.000 ms
Base64 decode ratio (CN1/native) 1.433x (43.3% slower)
Base64 SIMD encode 355.000 ms
Base64 encode ratio (SIMD/native) 0.337x (66.3% faster)
Base64 encode ratio (SIMD/CN1) 0.289x (71.1% faster)
Base64 SIMD decode 402.000 ms
Base64 decode ratio (SIMD/native) 0.596x (40.4% faster)
Base64 decode ratio (SIMD/CN1) 0.416x (58.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 58.000 ms
Image createMask (SIMD on) 8.000 ms
Image createMask ratio (SIMD on/off) 0.138x (86.2% faster)
Image applyMask (SIMD off) 119.000 ms
Image applyMask (SIMD on) 70.000 ms
Image applyMask ratio (SIMD on/off) 0.588x (41.2% faster)
Image modifyAlpha (SIMD off) 115.000 ms
Image modifyAlpha (SIMD on) 54.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.470x (53.0% faster)
Image modifyAlpha removeColor (SIMD off) 157.000 ms
Image modifyAlpha removeColor (SIMD on) 62.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.395x (60.5% faster)
Image PNG encode (SIMD off) 987.000 ms
Image PNG encode (SIMD on) 794.000 ms
Image PNG encode ratio (SIMD on/off) 0.804x (19.6% faster)
Image JPEG encode 634.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 19, 2026

Compared 110 screenshots: 110 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 272 seconds

Build and Run Timing

Metric Duration
Simulator Boot 119000 ms
Simulator Boot (Run) 1000 ms
App Install 14000 ms
App Launch 6000 ms
Test Execution 343000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1875.000 ms
Base64 CN1 encode 1585.000 ms
Base64 encode ratio (CN1/native) 0.845x (15.5% faster)
Base64 native decode 1084.000 ms
Base64 CN1 decode 1540.000 ms
Base64 decode ratio (CN1/native) 1.421x (42.1% slower)
Base64 SIMD encode 497.000 ms
Base64 encode ratio (SIMD/native) 0.265x (73.5% faster)
Base64 encode ratio (SIMD/CN1) 0.314x (68.6% faster)
Base64 SIMD decode 408.000 ms
Base64 decode ratio (SIMD/native) 0.376x (62.4% faster)
Base64 decode ratio (SIMD/CN1) 0.265x (73.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 71.000 ms
Image createMask (SIMD on) 18.000 ms
Image createMask ratio (SIMD on/off) 0.254x (74.6% faster)
Image applyMask (SIMD off) 182.000 ms
Image applyMask (SIMD on) 84.000 ms
Image applyMask ratio (SIMD on/off) 0.462x (53.8% faster)
Image modifyAlpha (SIMD off) 142.000 ms
Image modifyAlpha (SIMD on) 74.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.521x (47.9% faster)
Image modifyAlpha removeColor (SIMD off) 199.000 ms
Image modifyAlpha removeColor (SIMD on) 73.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.367x (63.3% faster)
Image PNG encode (SIMD off) 1052.000 ms
Image PNG encode (SIMD on) 1040.000 ms
Image PNG encode ratio (SIMD on/off) 0.989x (1.1% faster)
Image JPEG encode 626.000 ms

@liannacasper liannacasper merged commit a790f45 into master May 19, 2026
16 checks passed
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.

ios toolbar buttons very hard to hit

2 participants