Skip to content

Pure Codename One editors and lightweight playground#5386

Open
shai-almog wants to merge 9 commits into
masterfrom
pure-cn1-editors-v2
Open

Pure Codename One editors and lightweight playground#5386
shai-almog wants to merge 9 commits into
masterfrom
pure-cn1-editors-v2

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

What changed

  • Restores the pure Codename One rich-text and code editor implementation on top of current master after the revert in Revert "Pure Codename One rich text and code editors (remove BrowserComponent)" #5385.
  • Adds the cross-platform lightweight text-input bridge, editor document/rendering models, rich-text interchange, undo/redo, bidi/IME handling, touch selection, and optional lightweight editing for TextArea and TextField.
  • Moves the expanded editor documentation into its own developer-guide chapter and refreshes the editor screenshots and platform goldens.
  • Reworks the Playground source panes to use TextArea.setLightweightEditingEnabled(true) through PlaygroundLightweightEditor.
  • Removes the embedded browser editor implementation and its bundled assets from the repository. There are zero tracked matches for the removed editor engine name.

Why

PR #5378 was merged before the final CI result and then reverted. This replacement reapplies the final reviewed feature diff as one clean commit on the post-revert master, while preserving the centered-dialog test registrations added afterward.

The Playground now dogfoods the same lightweight editing API exposed to applications instead of maintaining a separate browser-based editor stack.

Validation

  • Full Playground smoke suite:
    • generated API registry checks passed
    • lightweight editor opt-in check passed
    • desktop and mobile layout harnesses found the lightweight TextArea source editor
    • syntax matrix: 325/325 passed
    • UI paint matrix: 312/312 clean
    • all 15 bundled samples evaluated cleanly
  • Java 8 core smoke: 9 tests passed, 0 failures/errors
  • Developer-guide snippets: 614 blocks validated
  • Copyright-header gate passed
  • Zero tracked matches for the removed browser editor engine

This replaces #5378.

@github-actions

github-actions Bot commented Jul 15, 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)

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

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

@github-actions

Copy link
Copy Markdown
Contributor

Blog prose gate

✅ No net-new prose findings introduced by this PR.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 395 total, 0 failed, 14 skipped

Benchmark Results

  • Execution Time: 18633 ms

  • Hotspots (Top 20 sampled methods):

    • 22.80% java.util.ArrayList.indexOf (378 samples)
    • 8.14% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (135 samples)
    • 3.56% com.codename1.tools.translator.Parser.cn1EnsureSubclassIndex (59 samples)
    • 3.02% java.lang.StringBuilder.append (50 samples)
    • 2.59% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (43 samples)
    • 2.35% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (39 samples)
    • 2.05% com.codename1.tools.translator.BytecodeMethod.equals (34 samples)
    • 1.87% org.objectweb.asm.tree.analysis.Analyzer.analyze (31 samples)
    • 1.75% java.lang.Object.hashCode (29 samples)
    • 1.75% com.codename1.tools.translator.Parser.addToConstantPool (29 samples)
    • 1.75% com.codename1.tools.translator.BytecodeMethod.optimize (29 samples)
    • 1.57% org.objectweb.asm.tree.analysis.Analyzer.findSubroutine (26 samples)
    • 1.57% java.util.HashMap.hash (26 samples)
    • 1.27% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (21 samples)
    • 1.27% com.codename1.tools.translator.Parser.resolveDupForms (21 samples)
    • 1.15% java.lang.System.identityHashCode (19 samples)
    • 0.97% com.codename1.tools.translator.MethodDependencyGraph.getCallers (16 samples)
    • 0.97% com.codename1.tools.translator.Parser.classIndex (16 samples)
    • 0.97% java.lang.StringCoding.encode (16 samples)
    • 0.90% com.codename1.tools.translator.ByteCodeClass.markDependent (15 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 146 screenshots: 146 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 47ms / native 3ms = 15.6x speedup
SIMD float-mul (64K x300) java 46ms / native 2ms = 23.0x 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 159.000 ms
Base64 CN1 decode 95.000 ms
Base64 SIMD encode 84.000 ms
Base64 encode ratio (SIMD/CN1) 0.528x (47.2% faster)
Base64 SIMD decode 72.000 ms
Base64 decode ratio (SIMD/CN1) 0.758x (24.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 18.000 ms
Image createMask (SIMD on) 14.000 ms

@github-actions

github-actions Bot commented Jul 15, 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)
    • 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

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 146 screenshots: 146 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 60ms / native 4ms = 15.0x speedup
SIMD float-mul (64K x300) java 59ms / native 3ms = 19.6x 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 199.000 ms
Base64 CN1 decode 151.000 ms
Base64 SIMD encode 102.000 ms
Base64 encode ratio (SIMD/CN1) 0.513x (48.7% faster)
Base64 SIMD decode 93.000 ms
Base64 decode ratio (SIMD/CN1) 0.616x (38.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 21.000 ms

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 146 screenshots: 146 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 55ms / native 3ms = 18.3x speedup
SIMD float-mul (64K x300) java 56ms / native 3ms = 18.6x 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 246.000 ms
Base64 CN1 decode 127.000 ms
Base64 SIMD encode 65.000 ms
Base64 encode ratio (SIMD/CN1) 0.264x (73.6% faster)
Base64 SIMD decode 57.000 ms
Base64 decode ratio (SIMD/CN1) 0.449x (55.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 10.000 ms

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 147 screenshots: 147 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.

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 147 screenshots: 147 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.

@shai-almog shai-almog force-pushed the pure-cn1-editors-v2 branch from 5b12217 to fdc26a7 Compare July 15, 2026 16:40
@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 150 screenshots: 150 matched.

Native Android coverage

  • 📊 Line coverage: 11.21% (11731/104686 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.98% (57820/579472), branch 5.08% (2691/52984), complexity 4.87% (2706/55562), method 7.35% (2101/28597), class 11.46% (466/4066)
    • 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)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 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)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 11.21% (11731/104686 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.98% (57820/579472), branch 5.08% (2691/52984), complexity 4.87% (2706/55562), method 7.35% (2101/28597), class 11.46% (466/4066)
    • 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)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 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)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 295ms / native 172ms = 1.7x speedup
SIMD float-mul (64K x300) java 233ms / native 127ms = 1.8x 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 304.000 ms
Base64 CN1 decode 348.000 ms
Base64 native encode 1024.000 ms
Base64 encode ratio (CN1/native) 0.297x (70.3% faster)
Base64 native decode 1011.000 ms
Base64 decode ratio (CN1/native) 0.344x (65.6% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 148 screenshots: 148 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 54ms / native 3ms = 18.0x speedup
SIMD float-mul (64K x300) java 53ms / native 3ms = 17.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 181.000 ms
Base64 CN1 decode 128.000 ms
Base64 native encode 703.000 ms
Base64 encode ratio (CN1/native) 0.257x (74.3% faster)
Base64 native decode 319.000 ms
Base64 decode ratio (CN1/native) 0.401x (59.9% faster)
Base64 SIMD encode 49.000 ms
Base64 encode ratio (SIMD/CN1) 0.271x (72.9% faster)
Base64 SIMD decode 44.000 ms
Base64 decode ratio (SIMD/CN1) 0.344x (65.6% faster)
Base64 encode ratio (SIMD/native) 0.070x (93.0% faster)
Base64 decode ratio (SIMD/native) 0.138x (86.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 10.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.200x (80.0% faster)
Image applyMask (SIMD off) 56.000 ms
Image applyMask (SIMD on) 61.000 ms
Image applyMask ratio (SIMD on/off) 1.089x (8.9% slower)
Image modifyAlpha (SIMD off) 83.000 ms
Image modifyAlpha (SIMD on) 192.000 ms
Image modifyAlpha ratio (SIMD on/off) 2.313x (131.3% slower)
Image modifyAlpha removeColor (SIMD off) 224.000 ms
Image modifyAlpha removeColor (SIMD on) 220.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.982x (1.8% faster)

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

iOS Metal screenshot updates

Compared 149 screenshots: 148 matched, 1 updated.

  • BrowserComponent — updated screenshot. Screenshot differs (1179x2556 px, bit depth 8).

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 66000 ms
Simulator Boot (Run) 2000 ms
App Install 16000 ms
App Launch 3000 ms
Test Execution 409000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 126ms / native 5ms = 25.2x speedup
SIMD float-mul (64K x300) java 281ms / native 3ms = 93.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 742.000 ms
Base64 CN1 decode 188.000 ms
Base64 native encode 1017.000 ms
Base64 encode ratio (CN1/native) 0.730x (27.0% faster)
Base64 native decode 863.000 ms
Base64 decode ratio (CN1/native) 0.218x (78.2% faster)
Base64 SIMD encode 154.000 ms
Base64 encode ratio (SIMD/CN1) 0.208x (79.2% faster)
Base64 SIMD decode 81.000 ms
Base64 decode ratio (SIMD/CN1) 0.431x (56.9% faster)
Base64 encode ratio (SIMD/native) 0.151x (84.9% faster)
Base64 decode ratio (SIMD/native) 0.094x (90.6% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.429x (57.1% faster)
Image applyMask (SIMD off) 58.000 ms
Image applyMask (SIMD on) 65.000 ms
Image applyMask ratio (SIMD on/off) 1.121x (12.1% slower)
Image modifyAlpha (SIMD off) 76.000 ms
Image modifyAlpha (SIMD on) 200.000 ms
Image modifyAlpha ratio (SIMD on/off) 2.632x (163.2% slower)
Image modifyAlpha removeColor (SIMD off) 70.000 ms
Image modifyAlpha removeColor (SIMD on) 237.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 3.386x (238.6% slower)

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 62000 ms
Simulator Boot (Run) 1000 ms
App Install 12000 ms
App Launch 1000 ms
Test Execution 394000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 54ms / native 3ms = 18.0x speedup
SIMD float-mul (64K x300) java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 182.000 ms
Base64 CN1 decode 154.000 ms
Base64 native encode 530.000 ms
Base64 encode ratio (CN1/native) 0.343x (65.7% faster)
Base64 native decode 267.000 ms
Base64 decode ratio (CN1/native) 0.577x (42.3% faster)
Base64 SIMD encode 48.000 ms
Base64 encode ratio (SIMD/CN1) 0.264x (73.6% faster)
Base64 SIMD decode 44.000 ms
Base64 decode ratio (SIMD/CN1) 0.286x (71.4% faster)
Base64 encode ratio (SIMD/native) 0.091x (90.9% faster)
Base64 decode ratio (SIMD/native) 0.165x (83.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 6.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 43.000 ms
Image applyMask (SIMD on) 30.000 ms
Image applyMask ratio (SIMD on/off) 0.698x (30.2% faster)
Image modifyAlpha (SIMD off) 29.000 ms
Image modifyAlpha (SIMD on) 154.000 ms
Image modifyAlpha ratio (SIMD on/off) 5.310x (431.0% slower)
Image modifyAlpha removeColor (SIMD off) 135.000 ms
Image modifyAlpha removeColor (SIMD on) 147.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.089x (8.9% slower)

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests 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.

1 participant