Skip to content

Native menu bars: submenus, separators, check/radio items, icons, enabled state - #6058

Merged
shai-almog merged 13 commits into
masterfrom
native-menu-v2
Oct 21, 2026
Merged

shai-almog merged 13 commits into
masterfrom
native-menu-v2

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Extends the Command-driven native menu bar with:

  • Submenus via a path in setDesktopMenu("File/Open Recent") (// is a literal slash; old single-segment hints are unchanged).
  • Separators via setDesktopMenuGroup(int) (stable sort, separator on group change) or Command.createDesktopSeparator(menu).
  • Check items (setDesktopChecked) and radio groups (setDesktopRadioGroup); state flips before the action runs.
  • Enabled state: disabled commands are greyed out and their shortcuts do nothing.
  • Icons from getIcon() / material icon.
  • Display.refreshNativeMenu(); setEnabled / setDesktopChecked republish automatically (coalesced per EDT cycle).

A shared com.codename1.impl.NativeMenuEncoder builds the rows all ports consume.

Port Support
JavaSE simulator all, incl. icons
JavaScript desktop chrome all (flyout submenus)
macOS all
Mac Catalyst all (separators as inline groups)
Windows all except icons
Linux GTK3 all except icons (deprecated in GTK3)

Testing

  • New NativeMenuEncoderTest (8) plus related core suites (231) pass.
  • DesktopChromeUITest passes, including a new JMenuBar structure test.
  • SpotBugs clean on core-unittests and iOS; C++ linkage / control-character gates clean.
  • Native code syntax-checked only (mingw, GTK gcc, clang ARC/non-ARC, Catalyst); no manual run on the native desktop ports yet.

🤖 Generated with Claude Code

…bled state

Commands gain desktop menu paths ("File/Open Recent"), groups and explicit
separators, check items and radio groups. A shared NativeMenuEncoder turns
the published commands into rows every port reads; dispatch toggles state
before the action runs and skips disabled items. Implemented for the JavaSE
simulator, JavaScript desktop chrome, macOS, Catalyst, Windows and Linux
(icons on JavaSE, JS, macOS and Catalyst).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T11:38:51.637316Z 188baa2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

@github-actions

github-actions Bot commented Oct 20, 2026 •

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)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ project-model: 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

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 170 screenshots: 170 matched.

Native Android coverage

  • 📊 Line coverage: 16.01% (26002/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122147/850229), branch 9.91% (8466/85441), complexity 7.81% (6525/83503), method 11.59% (4648/40094), class 19.78% (960/4853)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 16.01% (26002/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122147/850229), branch 9.91% (8466/85441), complexity 7.81% (6525/83503), method 11.59% (4648/40094), class 19.78% (960/4853)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 247ms / native 177ms = 1.3x speedup
SIMD float-mul (64K x300) java 112ms / native 100ms = 1.1x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 71.000 ms
Base64 CN1 decode 83.000 ms
Base64 native encode 411.000 ms
Base64 encode ratio (CN1/native) 0.173x (82.7% faster)
Base64 native decode 265.000 ms
Base64 decode ratio (CN1/native) 0.313x (68.7% faster)
Image encode benchmark status skipped (SIMD unsupported)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef884b6336

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
Comment thread Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java
Comment thread Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java Outdated
Comment thread Ports/JavaScriptPort/src/main/webapp/style.css Outdated
Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java
Comment thread Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java Outdated
Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java Outdated
@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 12 screenshots: 12 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port (x64 / Intel-AMD): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, SSE2 SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 62ms / native 5ms = 12.4x speedup
SIMD float-mul (64K x300) java 56ms / native 5ms = 11.2x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 76.000 ms
Base64 CN1 decode 88.000 ms
Base64 SIMD encode 111.000 ms
Base64 encode ratio (SIMD/CN1) 1.461x (46.1% slower)
Base64 SIMD decode 98.000 ms
Base64 decode ratio (SIMD/CN1) 1.114x (11.4% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 12.000 ms
Image createMask (SIMD on) 7.000 ms
Image createMask ratio (SIMD on/off) 0.583x (41.7% faster)
Image applyMask (SIMD off) 31.000 ms
Image applyMask (SIMD on) 31.000 ms
Image applyMask ratio (SIMD on/off) 1.000x (0.0% slower)
Image modifyAlpha (SIMD off) 36.000 ms
Image modifyAlpha (SIMD on) 64.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.778x (77.8% slower)
Image modifyAlpha removeColor (SIMD off) 31.000 ms
Image modifyAlpha removeColor (SIMD on) 32.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.032x (3.2% slower)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline windows-x64@amd64-family-25-model-1-authenticamd)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.34x (base 1.22x, +9.4%) 0.69x (base 0.94x, -26.3%) ok
translator (self) 4 0.72x (base 0.60x, +19.6%) 0.53x (base 0.54x, -1.4%) ok
intArithmetic 4 1.19x (base 1.10x, +8.4%) 0.06x (base 0.06x, +6.2%) ok
longArithmetic 4 1.08x (base 1.08x, -0.0%) 0.06x (base 0.05x, +2.3%) ok
mathTranscendental 4 0.78x (base 0.79x, -1.8%) 0.06x (base 0.06x, -2.9%) ok
arraySequential 4 1.33x (base 1.36x, -2.3%) 0.39x (base 0.39x, +0.2%) ok
arrayRandom 4 1.09x (base 1.06x, +3.0%) 0.23x (base 0.23x, +0.3%) ok
objectAllocation 4 1.50x (base 1.56x, -3.7%) 0.30x (base 0.39x, -22.5%) ok
valueEscape 4 0.10x (base 0.10x, +0.4%) 0.05x (base 0.04x, +5.5%) ok
hashMapChurn 4 1.71x (base 1.80x, -5.0%) 0.09x (base 0.09x, -6.8%) ok
stringBuilding 4 1.21x (base 1.22x, -0.7%) 0.32x (base 0.32x, +0.2%) ok
recursion 4 1.49x (base 1.49x, -0.2%) 0.06x (base 0.06x, +0.4%) ok
quicksort 4 1.13x (base 1.13x, -0.4%) 0.12x (base 0.12x, +0.3%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port, REAL shipping pipeline: the hellocodenameone screenshot suite rendered by a binary CROSS-COMPILED on Linux (clang-cl + xwin, WebView2 linked) and RUN on a Windows x64 runner. Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 56ms / native 5ms = 11.2x speedup
SIMD float-mul (64K x300) java 62ms / native 6ms = 10.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 72.000 ms
Base64 CN1 decode 89.000 ms
Base64 SIMD encode 105.000 ms
Base64 encode ratio (SIMD/CN1) 1.458x (45.8% slower)
Base64 SIMD decode 99.000 ms
Base64 decode ratio (SIMD/CN1) 1.112x (11.2% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 26.000 ms
Image applyMask (SIMD on) 22.000 ms
Image applyMask ratio (SIMD on/off) 0.846x (15.4% faster)
Image modifyAlpha (SIMD off) 27.000 ms
Image modifyAlpha (SIMD on) 18.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.667x (33.3% faster)
Image modifyAlpha removeColor (SIMD off) 31.000 ms
Image modifyAlpha removeColor (SIMD on) 45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.452x (45.2% slower)

@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port (arm64 / Apple Silicon - Arm): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, NEON SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 48ms / native 2ms = 24.0x speedup
SIMD float-mul (64K x300) java 49ms / native 3ms = 16.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 61.000 ms
Base64 CN1 decode 70.000 ms
Base64 SIMD encode 78.000 ms
Base64 encode ratio (SIMD/CN1) 1.279x (27.9% slower)
Base64 SIMD decode 70.000 ms
Base64 decode ratio (SIMD/CN1) 1.000x (0.0% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 5.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.200x (80.0% faster)
Image applyMask (SIMD off) 17.000 ms
Image applyMask (SIMD on) 19.000 ms
Image applyMask ratio (SIMD on/off) 1.118x (11.8% slower)
Image modifyAlpha (SIMD off) 15.000 ms
Image modifyAlpha (SIMD on) 12.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.800x (20.0% faster)
Image modifyAlpha removeColor (SIMD off) 21.000 ms
Image modifyAlpha removeColor (SIMD on) 10.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.476x (52.4% faster)

ParparVM vs HotSpot (JDK 25): Windows arm64

Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline windows-arm64@armv8-64-bit-family-8-model-d49-microsoft-corporation)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.03x (base 1.11x, -7.3%) 0.75x (base 0.75x, +0.2%) ok
translator (self) 4 0.85x (base 0.84x, +1.9%) 0.52x (base 0.51x, +3.4%) ok
intArithmetic 4 1.04x (base 1.04x, +0.0%) 0.06x (base 0.06x, +1.8%) ok
longArithmetic 4 0.79x (base 0.80x, -0.0%) 0.06x (base 0.06x, +2.1%) ok
mathTranscendental 4 0.72x (base 0.72x, -0.2%) 0.06x (base 0.06x, +0.7%) ok
arraySequential 4 0.38x (base 0.46x, -16.0%) 0.39x (base 0.39x, -0.1%) ok
arrayRandom 4 0.94x (base 0.94x, +0.1%) 0.23x (base 0.23x, -0.1%) ok
objectAllocation 4 1.79x (base 2.81x, -36.1%) 0.42x (base 0.43x, -2.4%) ok
valueEscape 4 0.76x (base 0.76x, +0.0%) 0.05x (base 0.05x, +2.1%) ok
hashMapChurn 4 1.00x (base 0.98x, +1.2%) 0.12x (base 0.12x, -2.2%) ok
stringBuilding 4 1.62x (base 1.43x, +13.2%) 0.27x (base 0.27x, -0.4%) ok
recursion 4 1.56x (base 1.46x, +6.6%) 0.06x (base 0.07x, -0.1%) ok
quicksort 4 1.00x (base 1.00x, -0.2%) 0.12x (base 0.12x, -0.0%) ok

Result: no regression

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 833 total, 0 failed, 57 skipped

Benchmark Results

  • Execution Time: 11001 ms

  • Hotspots (Top 20 sampled methods):

    • 10.14% com.codename1.tools.translator.IteratorEscape.mangle (175 samples)
    • 7.18% com.codename1.tools.translator.BytecodeMethod.equals (124 samples)
    • 5.50% java.lang.Object.hashCode (95 samples)
    • 4.29% java.lang.StringBuilder.append (74 samples)
    • 4.00% java.lang.System.identityHashCode (69 samples)
    • 3.01% com.codename1.tools.translator.bytecodes.Invoke.findMethodUp (52 samples)
    • 2.90% java.util.ArrayList.indexOf (50 samples)
    • 2.84% com.codename1.tools.translator.classfile.analysis.Frame.execute (49 samples)
    • 2.09% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (36 samples)
    • 1.91% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (33 samples)
    • 1.80% java.lang.String.equals (31 samples)
    • 1.74% java.util.AbstractCollection.containsAll (30 samples)
    • 1.68% com.codename1.tools.translator.Parser.cullMethods (29 samples)
    • 1.62% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (28 samples)
    • 1.56% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (27 samples)
    • 1.39% java.io.FileOutputStream.writeBytes (24 samples)
    • 1.33% java.util.HashMap.putVal (23 samples)
    • 1.22% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (21 samples)
    • 1.22% com.codename1.tools.translator.ByteCodeClass.markDependencies (21 samples)
    • 1.04% com.codename1.tools.translator.ReachabilityCull.run (18 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Linux port (x64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub x64 runner. Baseline: scripts/linux/screenshots.

ParparVM vs HotSpot (JDK 25): Linux x64

Runner CPU: AMD EPYC 7763 64-Core Processor (baseline linux-x64@amd-epyc-7763-64-core-processor)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 0.82x (base 0.85x, -3.4%) 0.82x (base 1.02x, -19.3%) ok
translator (self) 4 0.57x (base 0.50x, +14.8%) 0.49x (base 0.52x, -5.6%) ok
intArithmetic 4 1.14x (base 1.12x, +1.7%) 0.04x (base 0.06x, -33.9%) ok
longArithmetic 4 1.08x (base 1.08x, -0.0%) 0.04x (base 0.05x, -34.8%) ok
mathTranscendental 4 1.09x (base 1.08x, +0.4%) 0.04x (base 0.07x, -47.9%) ok
arraySequential 4 2.01x (base 2.00x, +0.1%) 0.36x (base 0.36x, +0.3%) ok
arrayRandom 4 1.00x (base 0.91x, +10.3%) 0.20x (base 0.21x, -3.8%) ok
objectAllocation 4 1.52x (base 1.65x, -7.9%) 0.27x (base 0.37x, -26.7%) ok
valueEscape 4 0.10x (base 0.10x, -0.2%) 0.03x (base 0.04x, -35.4%) ok
hashMapChurn 4 1.51x (base 1.48x, +1.5%) 0.09x (base 0.09x, -3.2%) ok
stringBuilding 4 1.31x (base 1.39x, -5.9%) 0.26x (base 0.26x, +0.6%) ok
recursion 4 1.19x (base 1.25x, -5.3%) 0.04x (base 0.08x, -50.3%) ok
quicksort 4 1.11x (base 1.07x, +3.5%) 0.10x (base 0.11x, -14.7%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Linux port (arm64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub arm64 runner. Baseline: scripts/linux/screenshots-arm.

ParparVM vs HotSpot (JDK 25): Linux arm64

Runner CPU: Neoverse-N2 (baseline linux-arm64@neoverse-n2)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 0.95x (base 1.02x, -6.5%) 0.76x (base 0.93x, -18.6%) ok
translator (self) 4 0.74x (base 0.70x, +5.8%) 0.45x (base 0.51x, -10.3%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.03x (base 0.03x, -1.9%) ok
longArithmetic 4 0.79x (base 0.79x, -0.3%) 0.03x (base 0.03x, -1.1%) ok
mathTranscendental 4 1.10x (base 1.10x, -0.0%) 0.03x (base 0.03x, -0.3%) ok
arraySequential 4 0.39x (base 0.36x, +9.0%) 0.37x (base 0.37x, +0.2%) ok
arrayRandom 4 0.94x (base 0.94x, +0.4%) 0.20x (base 0.20x, -0.3%) ok
objectAllocation 4 1.91x (base 1.77x, +7.9%) 0.36x (base 0.38x, -5.1%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, -1.2%) ok
hashMapChurn 4 0.84x (base 0.84x, +0.1%) 0.13x (base 0.12x, +4.7%) ok
stringBuilding 4 1.52x (base 1.57x, -3.2%) 0.26x (base 0.26x, -0.2%) ok
recursion 4 1.42x (base 1.43x, -1.2%) 0.03x (base 0.04x, -2.7%) ok
quicksort 4 1.00x (base 0.99x, +0.9%) 0.09x (base 0.09x, +0.9%) ok

Result: no regression

- Radio groups settle on every published surface (current form and open
  windows), keeping the most recently checked member; checking a command
  only clears siblings on surfaces that publish it.
- setDesktopRadioGroup(null) makes the command an ordinary item again.
- Explicit separators keep their position in a grouped menu.
- Display.refreshNativeMenu() republishes open windows too.
- JavaSE: icon bytes are part of the menu signature; window menu icons
  are rendered on the Codename One EDT.
- HTML5: submenus are inline details/summary (no clipping, keyboard
  reachable); cache keys use the unit separator.
- Rephrase two developer-guide sentences LanguageTool flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 737e932b8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Ports/MacPort/nativeSources/CN1MacChrome.m Outdated
Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java Outdated
Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java
Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
Comment thread Ports/WindowsPort/nativeSources/cn1_windows_menu.cpp
shai-almog and others added 2 commits October 20, 2026 13:44
- PMD: foreach loops, no fully qualified names with an import in place.
- Refresh only when the changed command is on a published native menu.
- Menu hints are taken literally (no trimming of segments).
- Icons honour a command's own icon font.
- macOS and Catalyst key submenus by the physical menu, so case
  variants of a standard hint share them.
- Windows and Linux drop a row whose path does not fit instead of
  placing it under a truncated path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 026b82a94c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ef14aa2cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java Outdated
Comment thread CodenameOne/src/com/codename1/ui/Form.java
…every publish

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: eb18e13af2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…fied flag

Command.setDesktopRole() marks About, Settings, Quit, Hide, the File and Edit
commands, Full Screen, Minimize, Zoom and Help. A new NativeMenuConventions table
resolves each role per platform (macOS, Windows, GNOME, browser) to its menu,
position, name and shortcut, so the ports only see menu paths:
- Settings is in the app menu on macOS, Options under Tools on Windows,
  Preferences under Edit on Linux.
- Quit is Exit on Windows and absent in a browser.

Command.createDesktopRole() names a command the platform's way, and
setDesktopPlatforms() limits a command to some menu bars. Menus come out in the
standard order, and the legacy About/Preferences/Quit hints are read as roles.
On macOS and Catalyst a role command takes the place of the stock item.

Form/Window.setDocumentModified() shows unsaved changes: documentEdited on
macOS, a leading * in the title elsewhere. Save follows that state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

for (com.codename1.ui.Command c : commands) {
String name = c == null ? null : c.getCommandName();
if (name != null && name.length() > 0) {
// Icon-only commands have nothing to label a menu item with.
named.add(c);

P2 Badge Let the encoder label secondary-window role commands

A secondary JavaSE Window drops new Command(null).setDesktopRole(DESKTOP_ROLE_SAVE) here before NativeMenuEncoder can supply the platform's standard label. The identical command is valid on the main form and encodes as “Save,” so secondary windows silently lose role commands whenever callers use setDesktopRole() directly instead of the convenience factory; pass all non-null commands to the encoder and let it decide which rows are displayable.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m
Comment thread Ports/MacPort/nativeSources/CN1MacChrome.m Outdated
Comment thread CodenameOne/src/com/codename1/ui/Form.java Outdated
Comment thread Ports/JavaSE/src/com/codename1/impl/javase/JavaSEWindowManager.java
Comment thread Ports/MacPort/nativeSources/CN1MacChrome.m
Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java
… stock roles

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

attachImageToElement((NativeImage) rendered.getImage(), into,
scaleCoord(icon.getWidth()) + "px", scaleCoord(icon.getHeight()) + "px");

P2 Badge Constrain HTML menu icons to menu-item dimensions

In the HTML5 desktop chrome, an application-supplied command icon is attached using its original CSS width and height, and the menu CSS imposes no maximum on the canvas. A valid large icon, such as a 128×128 image also used elsewhere in the UI, therefore expands every menu row and can consume most of the menu panel, unlike the JavaSE and macOS paths that normalize icons to menu size. Scale or CSS-constrain these images to a fixed menu-icon box before attaching them.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Ports/LinuxPort/nativeSources/cn1_linux_window.c
Comment thread CodenameOne/src/com/codename1/ui/Command.java
…s a command's document state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fc58f3801

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Ports/MacPort/nativeSources/CN1MacChrome.m
Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
Comment thread CodenameOne/src/com/codename1/impl/NativeMenuEncoder.java
shai-almog and others added 2 commits October 21, 2026 11:43
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0df3343897

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/ui/Form.java Outdated
Comment thread Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m Outdated
Comment thread Ports/iOSPort/src/com/codename1/impl/ios/MacWindowManager.java
…by action, Catalyst edited title

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f548447dc9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/ui/Command.java Outdated
…chrome keys bypass Bootstrap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 188baa2c61

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shai-almog
shai-almog merged commit a3a6705 into master Oct 21, 2026
88 of 95 checks passed
@shai-almog
shai-almog deleted the native-menu-v2 branch October 21, 2026 14:07
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.

1 participant