Skip to content

Pure Codename One editors and lightweight playground#5386

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

Pure Codename One editors and lightweight playground#5386
shai-almog wants to merge 29 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: 20221 ms

  • Hotspots (Top 20 sampled methods):

    • 17.85% java.util.ArrayList.indexOf (328 samples)
    • 10.23% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (188 samples)
    • 3.86% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (71 samples)
    • 3.16% java.lang.StringBuilder.append (58 samples)
    • 2.83% org.objectweb.asm.tree.analysis.Analyzer.analyze (52 samples)
    • 2.72% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (50 samples)
    • 2.61% java.lang.System.identityHashCode (48 samples)
    • 2.50% java.util.HashMap.hash (46 samples)
    • 2.45% com.codename1.tools.translator.Parser.cn1EnsureSubclassIndex (45 samples)
    • 2.12% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (39 samples)
    • 1.85% org.objectweb.asm.tree.analysis.Analyzer.findSubroutine (34 samples)
    • 1.52% com.codename1.tools.translator.BytecodeMethod.equals (28 samples)
    • 1.41% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (26 samples)
    • 1.25% java.lang.Object.hashCode (23 samples)
    • 1.20% com.codename1.tools.translator.BytecodeMethod.optimize (22 samples)
    • 1.09% com.codename1.tools.translator.ByteCodeClass.markDependent (20 samples)
    • 1.03% java.lang.String.equals (19 samples)
    • 0.98% com.codename1.tools.translator.BytecodeMethod.addInstruction (18 samples)
    • 0.98% java.lang.StringCoding.encode (18 samples)
    • 0.92% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (17 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 94ms / native 7ms = 13.4x speedup
SIMD float-mul (64K x300) java 64ms / native 4ms = 16.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 263.000 ms
Base64 CN1 decode 154.000 ms
Base64 SIMD encode 104.000 ms
Base64 encode ratio (SIMD/CN1) 0.395x (60.5% faster)
Base64 SIMD decode 84.000 ms
Base64 decode ratio (SIMD/CN1) 0.545x (45.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 31.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 3ms = 20.0x speedup
SIMD float-mul (64K x300) java 61ms / native 4ms = 15.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 190.000 ms
Base64 CN1 decode 121.000 ms
Base64 SIMD encode 100.000 ms
Base64 encode ratio (SIMD/CN1) 0.526x (47.4% faster)
Base64 SIMD decode 83.000 ms
Base64 decode ratio (SIMD/CN1) 0.686x (31.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 21.000 ms
Image createMask (SIMD on) 19.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 56ms / native 4ms = 14.0x 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 58.000 ms
Base64 decode ratio (SIMD/CN1) 0.457x (54.3% 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.22% (11755/104810 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.99% (57974/580103), branch 5.08% (2695/53064), complexity 4.89% (2719/55635), method 7.37% (2110/28622), class 11.58% (472/4075)
    • 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.22% (11755/104810 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.99% (57974/580103), branch 5.08% (2695/53064), complexity 4.89% (2719/55635), method 7.37% (2110/28622), class 11.58% (472/4075)
    • 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 244ms / native 253ms = 0.9x speedup
SIMD float-mul (64K x300) java 122ms / native 88ms = 1.3x 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 289.000 ms
Base64 CN1 decode 229.000 ms
Base64 native encode 992.000 ms
Base64 encode ratio (CN1/native) 0.291x (70.9% faster)
Base64 native decode 750.000 ms
Base64 decode ratio (CN1/native) 0.305x (69.5% 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: 173 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 52ms / native 3ms = 17.3x speedup
SIMD float-mul (64K x300) java 51ms / native 3ms = 17.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 155.000 ms
Base64 CN1 decode 118.000 ms
Base64 native encode 789.000 ms
Base64 encode ratio (CN1/native) 0.196x (80.4% faster)
Base64 native decode 635.000 ms
Base64 decode ratio (CN1/native) 0.186x (81.4% faster)
Base64 SIMD encode 48.000 ms
Base64 encode ratio (SIMD/CN1) 0.310x (69.0% faster)
Base64 SIMD decode 44.000 ms
Base64 decode ratio (SIMD/CN1) 0.373x (62.7% faster)
Base64 encode ratio (SIMD/native) 0.061x (93.9% faster)
Base64 decode ratio (SIMD/native) 0.069x (93.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 29.000 ms
Image createMask (SIMD on) 28.000 ms
Image createMask ratio (SIMD on/off) 0.966x (3.4% faster)
Image applyMask (SIMD off) 231.000 ms
Image applyMask (SIMD on) 189.000 ms
Image applyMask ratio (SIMD on/off) 0.818x (18.2% faster)
Image modifyAlpha (SIMD off) 198.000 ms
Image modifyAlpha (SIMD on) 144.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.727x (27.3% faster)
Image modifyAlpha removeColor (SIMD off) 217.000 ms
Image modifyAlpha removeColor (SIMD on) 222.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.023x (2.3% slower)

@shai-almog

shai-almog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 110000 ms
Simulator Boot (Run) 2000 ms
App Install 15000 ms
App Launch 4000 ms
Test Execution 481000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 79ms / native 3ms = 26.3x speedup
SIMD float-mul (64K x300) java 227ms / native 2ms = 113.5x 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 572.000 ms
Base64 CN1 decode 389.000 ms
Base64 native encode 669.000 ms
Base64 encode ratio (CN1/native) 0.855x (14.5% faster)
Base64 native decode 5594.000 ms
Base64 decode ratio (CN1/native) 0.070x (93.0% faster)
Base64 SIMD encode 51.000 ms
Base64 encode ratio (SIMD/CN1) 0.089x (91.1% faster)
Base64 SIMD decode 45.000 ms
Base64 decode ratio (SIMD/CN1) 0.116x (88.4% faster)
Base64 encode ratio (SIMD/native) 0.076x (92.4% faster)
Base64 decode ratio (SIMD/native) 0.008x (99.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.286x (71.4% faster)
Image applyMask (SIMD off) 132.000 ms
Image applyMask (SIMD on) 115.000 ms
Image applyMask ratio (SIMD on/off) 0.871x (12.9% faster)
Image modifyAlpha (SIMD off) 79.000 ms
Image modifyAlpha (SIMD on) 142.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.797x (79.7% slower)
Image modifyAlpha removeColor (SIMD off) 75.000 ms
Image modifyAlpha removeColor (SIMD on) 114.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.520x (52.0% 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: 292 seconds

Build and Run Timing

Metric Duration
Simulator Boot 61000 ms
Simulator Boot (Run) 1000 ms
App Install 10000 ms
App Launch 4000 ms
Test Execution 375000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 78ms / native 3ms = 26.0x speedup
SIMD float-mul (64K x300) java 78ms / native 3ms = 26.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 194.000 ms
Base64 CN1 decode 234.000 ms
Base64 native encode 546.000 ms
Base64 encode ratio (CN1/native) 0.355x (64.5% faster)
Base64 native decode 317.000 ms
Base64 decode ratio (CN1/native) 0.738x (26.2% faster)
Base64 SIMD encode 103.000 ms
Base64 encode ratio (SIMD/CN1) 0.531x (46.9% faster)
Base64 SIMD decode 111.000 ms
Base64 decode ratio (SIMD/CN1) 0.474x (52.6% faster)
Base64 encode ratio (SIMD/native) 0.189x (81.1% faster)
Base64 decode ratio (SIMD/native) 0.350x (65.0% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.286x (71.4% faster)
Image applyMask (SIMD off) 51.000 ms
Image applyMask (SIMD on) 41.000 ms
Image applyMask ratio (SIMD on/off) 0.804x (19.6% faster)
Image modifyAlpha (SIMD off) 41.000 ms
Image modifyAlpha (SIMD on) 30.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.732x (26.8% faster)
Image modifyAlpha removeColor (SIMD off) 48.000 ms
Image modifyAlpha removeColor (SIMD on) 37.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.771x (22.9% faster)

@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.

shai-almog and others added 10 commits July 16, 2026 09:55
… casts

Three verified root causes of the "typing goes dead until you click another
component and back" behavior in the lightweight editors:

1. Core session lifecycle: removing a focused EditorView (playground layout
   rebuilds, TextArea overlay teardown) clears form focus via
   setFocusedInternal WITHOUT firing focusLost, so the platform text-input
   session stayed bound and the stale handle blocked startInput on the next
   focus gain. EditorView now releases the session in deinitialize() and
   startInput rebinds over a leftover handle. Covered by the new
   EditorViewSessionTest.

2. JS port focus steal: the canvas mousedown default action blurs the hidden
   lightweight textarea (the worker-side preventDefault lands after the
   browser dispatch window) and the window key pipeline defers to the bound
   session, killing every key. The bridge now cancels the focus change
   synchronously while the lightweight input owns focus, and
   updateTextInputState re-asserts DOM focus so clicking back into the
   editor heals a lost binding.

3. ParparVM-JS array covariance: casting int[][] to Object[] (what
   List.toArray(new int[n][]) compiles to inside EditorView.bidiRuns) threw
   ClassCastException, breaking caret placement and typing on every line
   containing RTL text. The runtime checkcast/instanceof now resolve array
   covariance structurally.

Also: IME composition now finalizes as a single undo unit against the
pre-composition snapshot (undo previously corrupted offsets); composition
updates invalidate layout; read-only editors no longer summon the keyboard
and setEditable(false) ends an active session; RichView paints bidi lines
in the same visual-atom order its geometry uses; CodeView tolerates null
SyntaxHighlighter results; TextArea.setText reaches a live lightweight
overlay; HtmlImporter preserves whitespace inside pre; the RTF serializer
emits signed unicode values.

Port consistency: stale-handle guards in Android/iOS stop/update SPI
methods; Android maps constraint and action type into EditorInfo and
delivers real editor actions plus hardware Ctrl shortcuts and a
setComposingRegion bridge; iOS maps constraint/action to keyboard traits,
routes single-line Return to the editor action, deletes whole composed
character sequences, resets stale marked ranges across sessions, fixes a
tvOS availability guard and a clipboard NSString leak; the JS port delivers
Ctrl-modified navigation keys, no longer double-fires Enter actions,
guards keydown/input against IME composition phases, and a stale drain no
longer wipes the successor session's queued input.

Playground/CI: restore CSS UIID completions through a CodeEditor completion
provider; collapse the hidden messages strip with setHidden; editor
screenshot tests drop the browser-era guards and capture on the editor
ready event; the input verify harness now covers the caret-reposition
click; scope the removed-editor tripwire to playground+core; extend the
apt IPv4/retry hardening to all installs in the linux workflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…test

int[][] instanceof/checkcast Object[] and List.toArray(new int[n][]) are what
EditorView.bidiRuns relies on; the fixture previously only exercised object
array covariance so the runtime gap shipped unnoticed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…irror, rich-format undo

iOS (verified on the iOS Simulator via a self-driven probe app: session start,
programmatic edits, blur/refocus rebind, and interactively: tap-to-focus shows
the caret, soft keyboard and selection accessory):
- Every native-originated edit now carries a generation number that the Java
  side echoes back with each state push; the shadow drops stale echoes so a
  slow round trip can never regress the text or caret under fast typing.
- setMarkedText/unmarkText forward through the client's composing contract
  (tiSetComposing/tiFinishComposing) like Android and JS, so IME composition
  reaches the editor's marked range, undo grouping and editing state.
- insertText delivers as a commit (tiCommit) like the other ports, so
  typed-text hooks (auto indent, bracket pairing) and composition
  finalization behave identically across ports.
- UIKit's synchronous text/selection queries answer from an immutable
  snapshot and layout geometry marshals onto the EDT; they previously read
  the EDT-owned document from the UIKit main thread mid-edit.

Android (verified on the API 34 emulator: focus shows the keyboard, Gboard
composition renders with candidates and the composing region round-trips
through updateSelection; the pre-fix binary reproduced the IME desync where
input goes dead after the first composed character):
- The input connection keeps a synchronously updated mirror of in-flight
  edits so the IME's immediate surrounding-text re-reads (Gboard does this
  after every commit) see post-edit text; the mirror retires only once the
  EDT state push has caught up with every posted edit.

Core:
- Formatting commands (inline styles, block formats, links) now record undo
  units carrying rich-model snapshots: undo restores the pre-command styling
  without touching text, redo reapplies it, and undoing an earlier text edit
  no longer wipes formatting applied afterwards (RichViewFormatUndoTest).
- Monospace (inline code) runs render with a subtle text-color tint so the
  semantic is visible; no monospace family ships with the framework fonts.
- Removed the never-released deprecated backend-selection API
  (setDefaultBackend/getDefaultBackend/BACKEND_*) and regenerated the
  playground access registry without it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sion

Hardware (Bluetooth / Chromebook) keys bypass the IME entirely, and the pure
editor's raw key path is disabled while a platform session is bound, so
physical typing was silently dropped. Route view-level key events through the
same translation the IME-synthesized keys use (commands, editor action,
unicode commit); unhandled keys (BACK, game keys) stay with the regular
pipeline.

Tapping an already-focused editor now re-requests the soft keyboard, matching
EditText: a keyboard dismissed with the back gesture returns on the next tap
instead of leaving the editor focused but keyboardless.

Verified on the API 34 emulator: sustained Gboard composition (two
consecutive composed keystrokes flow where the pre-mirror binary went deaf
after one) with the composing region round-tripping through updateSelection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The header check compared the first line against "/*" without stripping the
carriage return, so touching any historically CRLF source (parts of the
Android port) failed the gate on a line-ending artifact rather than a
copyright problem; the checker now normalizes CRLF before matching. Also add
the standard header to the JsArrayCovarianceApp test fixture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The scoping comment added alongside the narrowed grep spelled out the
forbidden editor name, so the tripwire matched the script itself and failed
the playground smoke job. Reword the comment; the name stays split in the
pattern for the same reason.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…Bugs

The editor screenshot tests captured on the backend ready event, which fires
before the first paint flushes on the slower ports - Android and JS delivered
frames without the editor content. Ready-event capture now chains into a
FirstPaintGate that runs the capture only after the editor subtree actually
painted: deterministic on every port, no fixed settle timers.

The JS PureEditors golden still depicts the pre-covariance-fix render (blank
lines after the first RTL line, from the int[][]-to-Object[] cast crash) and
is adopted from CI artifacts in a follow-up once this run produces the
correct frame.

Also feed the keep-alive block's ti* query results into a consumed sink: the
snapshot refactor made them provably side-effect-free, so their previously
ignored returns started tripping the RV_RETURN_VALUE_IGNORED gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The FirstPaintGate addition put this previously header-less file in front of
the copyright gate for the first time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
shai-almog and others added 8 commits July 16, 2026 22:29
A paint can run before layout assigned the editor its size (observed on the
slower Android JDK matrix runners), and firing the capture there ships a
frame without the content. The gate now requests another cycle from a
pre-layout paint and fires on the first paint where the content has bounds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PixelCopy reads the window's last presented frame with no ordering
guarantee against Codename One paints that were only just enqueued on
the EDT; the async view renders them on a later UI-thread frame. The
pure editor screenshot tests capture on the editor's ready event, which
lost that race on the CI emulator and uploaded an empty content area
while the same frame rendered correctly on screen. Invalidate the view
and defer the PixelCopy by two vsyncs so the captured surface contains
every paint enqueued before the capture request.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
setNativeFont handed every graphics context the Font object's own
CodenameOneTextPaint, so all contexts drawing the same font aliased one
Paint whose color each of them mutates. Async ops execute on the UI
thread while the EDT paints mutable images, so a drawString on a mutable
image could pick up another context's color mid-draw - observed on the
CI emulator as the status-bar tap diagnostic composing its glass pane
label in the wrong color. Each graphics context now keeps a private
copy of the text paint, re-copied only when the font changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The file carries the original Android port's Pader-Sync GPL2 +
Classpath-exception header, which its notice forbids altering; the
checker only recognizes the Codename One and Oracle header forms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
api.github.com returns transient 5xx during incidents (observed: a 503
failing javase-simulator-tests twice and the website build once in one
evening) and 429 under load. The release lookup in the simulator test
runner now retries those with backoff like the download below it, and
the OTA skin fetch passes --retry-all-errors so curl -f retries HTTP
5xx responses instead of failing on the first one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
During tonight's GitHub incident authenticated api.github.com requests
returned 503 continuously while the same endpoint answered anonymous
requests normally, so retrying with the token could never succeed. The
token only exists to raise the rate limit; when the authenticated
lookup exhausts its retries both skin resolutions now retry without it
before giving up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copying the text paint in every graphics context washed out live text
rendering across the whole screenshot suite - the async screen
pipeline's enqueue-time caches rely on the shared paint identity. Only
mutable-image contexts (the EDT side of the cross-thread color race)
keep a private copy now; screen contexts alias the shared paint exactly
as before. The editor screenshot tests additionally wait out any
animation still in flight before capturing so a slow emulator cannot
catch the form show transition mid-fade.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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