Skip to content

Fix #4912 form remains shaded after closing Toolbar side menu#4913

Merged
shai-almog merged 1 commit intomasterfrom
fix-4912-sidemenu-shaded-backdrop
May 10, 2026
Merged

Fix #4912 form remains shaded after closing Toolbar side menu#4913
shai-almog merged 1 commit intomasterfrom
fix-4912-sidemenu-shaded-backdrop

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • Toolbar.detachToolbarLayeredPane now queues a Form.revalidateLater() after detaching the dim backdrop pane, so the previous frame's shaded pixels are overdrawn on the next paint cycle (issue [BUG] Toolbar side menu leaves the underlying Form shaded after close in the Simulator #4912).
  • Without this, cnt.remove() cleared the bgTransparency style and severed the pane from the form tree but never told the form to repaint, so the simulator and JS port kept rendering the prior shaded frame until the user touched something that forced a redraw. The user-side workaround in the issue (a manual form.revalidateLater()) is now baked into the framework.
  • Regression test added in ToolbarTest. The dispose animation is disabled via reflection so the detach runs synchronously, and the test asserts the form is queued for revalidate after closeLeftSideMenu returns.

Test plan

  • mvn test -Dtest=ToolbarTest — all 7 tests pass (including the new closeLeftSideMenuClearsShadedBackdropAfterAnimation).
  • mvn test -Dtest='ToolbarTest,SideMenuBarTest,SideMenuBarMenuTransitionTest,SideMenuBarTransitionTest,MenuBarDialogSideMenuTest,InteractionDialogTest,SideMenuTest3086Test,LandscapeToolbarHiddenSampleTest,ToolbarRTLSampleTest' — 24 tests, 0 failures.
  • New test fails on master (no fix) and passes after the change.
  • Manual verification in the simulator with the reproduction from [BUG] Toolbar side menu leaves the underlying Form shaded after close in the Simulator #4912 (open the hamburger menu, close it, confirm the underlying Form is no longer shaded without the user's installSideMenuCloseHook workaround).

Fixes #4912

🤖 Generated with Claude Code

closeLeftSideMenu zeroed the Toolbar layered pane's bgTransparency
and detached it once the dispose animation completed, but cnt.remove()
does not by itself trigger a form-level repaint. The previous frame's
shaded pixels (the dim backdrop painted while the menu was open) then
lingered in the simulator and JS port render buffer until something
else forced a redraw, so the underlying Form appeared darker than it
should after the menu closed. The user's confirmed workaround was a
manual form.revalidateLater() in response to the close.

The fix moves that revalidateLater into detachToolbarLayeredPane: the
host Form is captured before cnt.remove() severs its parent link, and
revalidateLater is queued once the pane is gone so the next paint
cycle overdraws any stale shaded pixels.

Regression test added: ToolbarTest disables the dispose animation via
reflection so the detach runs synchronously, then asserts the form is
queued for revalidate after closeLeftSideMenu returns.

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 10, 2026

Compared 90 screenshots: 90 matched.

Native Android coverage

  • 📊 Line coverage: 10.22% (5583/54613 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.04% (27393/340806), branch 3.68% (1202/32660), complexity 4.70% (1470/31285), method 8.26% (1208/14620), class 13.68% (269/1966)
    • 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/730 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)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 10.22% (5583/54613 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.04% (27393/340806), branch 3.68% (1202/32660), complexity 4.70% (1470/31285), method 8.26% (1208/14620), class 13.68% (269/1966)
    • 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/730 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)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1190.000 ms
Base64 CN1 encode 223.000 ms
Base64 encode ratio (CN1/native) 0.187x (81.3% faster)
Base64 native decode 1046.000 ms
Base64 CN1 decode 246.000 ms
Base64 decode ratio (CN1/native) 0.235x (76.5% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 64000 ms
Simulator Boot (Run) 1000 ms
App Install 10000 ms
App Launch 5000 ms
Test Execution 249000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1088.000 ms
Base64 CN1 encode 1625.000 ms
Base64 encode ratio (CN1/native) 1.494x (49.4% slower)
Base64 native decode 690.000 ms
Base64 CN1 decode 1549.000 ms
Base64 decode ratio (CN1/native) 2.245x (124.5% slower)
Base64 SIMD encode 537.000 ms
Base64 encode ratio (SIMD/native) 0.494x (50.6% faster)
Base64 encode ratio (SIMD/CN1) 0.330x (67.0% faster)
Base64 SIMD decode 966.000 ms
Base64 decode ratio (SIMD/native) 1.400x (40.0% slower)
Base64 decode ratio (SIMD/CN1) 0.624x (37.6% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 92.000 ms
Image createMask (SIMD on) 11.000 ms
Image createMask ratio (SIMD on/off) 0.120x (88.0% faster)
Image applyMask (SIMD off) 330.000 ms
Image applyMask (SIMD on) 201.000 ms
Image applyMask ratio (SIMD on/off) 0.609x (39.1% faster)
Image modifyAlpha (SIMD off) 456.000 ms
Image modifyAlpha (SIMD on) 159.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.349x (65.1% faster)
Image modifyAlpha removeColor (SIMD off) 172.000 ms
Image modifyAlpha removeColor (SIMD on) 117.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.680x (32.0% faster)
Image PNG encode (SIMD off) 1268.000 ms
Image PNG encode (SIMD on) 1533.000 ms
Image PNG encode ratio (SIMD on/off) 1.209x (20.9% slower)
Image JPEG encode 1106.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 103000 ms
Simulator Boot (Run) 4000 ms
App Install 53000 ms
App Launch 9000 ms
Test Execution 284000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 3169.000 ms
Base64 CN1 encode 4107.000 ms
Base64 encode ratio (CN1/native) 1.296x (29.6% slower)
Base64 native decode 1666.000 ms
Base64 CN1 decode 1648.000 ms
Base64 decode ratio (CN1/native) 0.989x (1.1% faster)
Base64 SIMD encode 957.000 ms
Base64 encode ratio (SIMD/native) 0.302x (69.8% faster)
Base64 encode ratio (SIMD/CN1) 0.233x (76.7% faster)
Base64 SIMD decode 1142.000 ms
Base64 decode ratio (SIMD/native) 0.685x (31.5% faster)
Base64 decode ratio (SIMD/CN1) 0.693x (30.7% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 207.000 ms
Image createMask (SIMD on) 37.000 ms
Image createMask ratio (SIMD on/off) 0.179x (82.1% faster)
Image applyMask (SIMD off) 396.000 ms
Image applyMask (SIMD on) 237.000 ms
Image applyMask ratio (SIMD on/off) 0.598x (40.2% faster)
Image modifyAlpha (SIMD off) 590.000 ms
Image modifyAlpha (SIMD on) 107.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.181x (81.9% faster)
Image modifyAlpha removeColor (SIMD off) 805.000 ms
Image modifyAlpha removeColor (SIMD on) 474.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.589x (41.1% faster)
Image PNG encode (SIMD off) 2181.000 ms
Image PNG encode (SIMD on) 1405.000 ms
Image PNG encode ratio (SIMD on/off) 0.644x (35.6% faster)
Image JPEG encode 1097.000 ms

@shai-almog shai-almog merged commit d042971 into master May 10, 2026
18 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.

[BUG] Toolbar side menu leaves the underlying Form shaded after close in the Simulator

1 participant