Skip to content

Ensure Sheets render above native peers by enabling lightweight mode and adding blocker#4504

Open
shai-almog wants to merge 1 commit intomasterfrom
codex/add-background-component-to-block-events-9yr76w
Open

Ensure Sheets render above native peers by enabling lightweight mode and adding blocker#4504
shai-almog wants to merge 1 commit intomasterfrom
codex/add-background-component-to-block-events-9yr76w

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Fix an iOS rendering bug where a Sheet could appear behind native peers (e.g. BrowserComponent) by making the form render in lightweight mode while the sheet is visible.
  • Prevent native peers from receiving pointer events and visually overlapping the sheet by inserting a full-screen blocker into the sheet layer when peers are present.
  • Keep existing sheet animation/layout behavior while isolating sheet content into a dedicated sheet layer so replacement/animation works reliably.

Description

  • Enable lightweight rendering on the current Form when showing a sheet if Form.activePeerCount > 0 by calling f.setLightweightMode(true) before showing and restoring it after the sheet is hidden.
  • Create and use a dedicated sheet layer retrieved via the new getSheetLayer(Container) helper that stores the layer in a client property cn1$sheetLayer and centralizes layout/animation work.
  • Add ensureSheetBlocker(Container, Container) which manages a SheetBlocker component stored under client property cn1$sheetBlocker to block pointer events and cover the display when native peers exist, and remove it when no peers are active.
  • Add inner class SheetBlocker that grabs pointer events and reports full-screen preferred size via calcPreferredSize(); switch container layout to LayeredLayout and update add/replace/animate calls to operate on the sheet layer.
  • Update imports to include Dimension and modify BrowserComponentScreenshotTest to show a Sheet during the test to exercise the native-peer/sheet interaction scenario.

Testing

  • No automated tests were executed for this change.
  • The BrowserComponentScreenshotTest was adjusted to present a Sheet to reproduce the issue, but the test was not run in this PR.

Codex Task

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 8, 2026

Android screenshot updates

Compared 30 screenshots: 29 matched, 1 updated.

  • BrowserComponent — updated screenshot. Screenshot differs (320x640 px, bit depth 8).

    BrowserComponent
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 7.16% (3632/50711 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.58% (17826/319385), branch 2.72% (845/31063), complexity 3.32% (986/29687), method 5.84% (807/13824), class 9.53% (174/1825)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 8, 2026

iOS screenshot updates

Compared 30 screenshots: 29 matched, 1 updated.

  • BrowserComponent — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    BrowserComponent
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 330 seconds
  • Compilation Time: 362 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 31853 ms
Extract Extensions 35 ms
Google Services Setup 2 ms
Scan Classes 665 ms
Extract Libs 817 ms
Inject Build Hints 56 ms
Generate Unit Tests 14 ms
Generate Stubs 1216 ms
Compile Stubs 2578 ms
Generate Icons 1117 ms
Prepare ParparVM 186 ms
ParparVM Execution 181940 ms
Post-VM Setup 145 ms
CocoaPods 4982 ms
Finalize 38 ms
Total Time 225645 msMaven Overhead : 105000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot 169000 ms
Simulator Boot (Run) 2000 ms
App Install 13000 ms
App Launch 8000 ms
Test Execution 137000 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant