Skip to content

Refine Sheet hit-test ordering and expand Sheet screenshot test#4505

Open
shai-almog wants to merge 2 commits intomasterfrom
codex/add-special-case-for-sheet-component-events
Open

Refine Sheet hit-test ordering and expand Sheet screenshot test#4505
shai-almog wants to merge 2 commits intomasterfrom
codex/add-special-case-for-sheet-component-events

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Ensure native peer touch passthrough checks only consult Sheet visibility when a native PeerComponent is involved to minimize overhead and avoid unnecessary EDT interactions.
  • Provide a thread-safe, native-friendly way to determine visible Sheet bounds so native event paths can safely decide whether to deliver touches to peer components.
  • Improve the HelloCodenameOne screenshot test to exercise nested sheets and title-bar commands for better coverage of show/dismiss behavior.

Description

  • Added thread-safe sheet bounds tracking to Sheet with a private SheetBounds type, a volatile sheetBounds array, and helpers updateSheetBounds, removeSheetBounds, startTrackingBounds, stopTrackingBounds, and updateTrackedBounds to maintain a lightweight cache usable off the EDT, and exposed the query Sheet.isSheetVisibleAt(int x, int y).
  • Hooked tracking into the sheet lifecycle by calling startTrackingBounds() during show() and stopTrackingBounds() when a sheet is hidden, and by overriding setX, setY, setWidth, and setHeight to refresh tracked bounds when the sheet moves or resizes.
  • Changed native hit-test ordering to first detect whether the component at the touch location is a PeerComponent and only then consult Sheet.isSheetVisibleAt(...): updated touch logic in Ports/Android/src/com/codename1/impl/android/CodenameOneView.java and Ports/iOSPort/src/com/codename1/impl/ios/IOSImplementation.java to defer sheet checks until a peer is present.
  • Expanded the screenshot test SheetScreenshotTest (added under scripts/hellocodenameone) to create a parent and nested child sheet, add an extra command to the sheet title bar, and register the test in Cn1ssDeviceRunner so the device runner exercises nested sheet behavior.

Testing

  • No automated tests were executed as part of this change in this environment (no CI/build run was requested).

Codex Task

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 9, 2026

Android screenshot updates

Compared 31 screenshots: 30 matched, 1 missing reference.

  • Sheet — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/android/screenshots/Sheet.png.

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

Native Android coverage

  • 📊 Line coverage: 7.18% (3643/50732 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.60% (17907/319512), branch 2.71% (841/31069), complexity 3.33% (988/29695), method 5.86% (811/13829), class 9.58% (175/1826)
    • 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 9, 2026

iOS screenshot updates

Compared 31 screenshots: 30 matched, 1 missing reference.

  • Sheet — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/Sheet.png.

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

Benchmark Results

  • VM Translation Time: 401 seconds
  • Compilation Time: 373 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 40526 ms
Extract Extensions 34 ms
Google Services Setup 9 ms
Scan Classes 955 ms
Extract Libs 1922 ms
Inject Build Hints 73 ms
Generate Unit Tests 8 ms
Generate Stubs 1756 ms
Compile Stubs 3750 ms
Generate Icons 2272 ms
Prepare ParparVM 927 ms
ParparVM Execution 216454 ms
Post-VM Setup 290 ms
CocoaPods 8276 ms
Finalize 126 ms
Total Time 277381 msMaven Overhead : 124000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot 317000 ms
Simulator Boot (Run) 5000 ms
App Install 18000 ms
App Launch 13000 ms
Test Execution 208000 ms

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

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