Skip to content

Simulate->Larger Text: refresh the simulator instantly (#4963)#4964

Merged
shai-almog merged 1 commit into
masterfrom
fix-4963-larger-text-instant-refresh
May 16, 2026
Merged

Simulate->Larger Text: refresh the simulator instantly (#4963)#4964
shai-almog merged 1 commit into
masterfrom
fix-4963-larger-text-instant-refresh

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

@shai-almog shai-almog commented May 16, 2026

Summary

  • JavaSEPort.refreshThemeOnly now also calls Form.refreshTheme(true) so components on screen pick up the rebuilt styles. Without this step UIManager.refreshTheme() only rebuilt the theme cache; the form kept its pre-refresh Style refs and the user saw no change until restart.
  • UIManager.applyLargerTextScaleToThemeFonts tracks the original/derived Font pair it wrote and rolls back before each pass, so every scale change derives from the unscaled installed font instead of compounding on the previously-scaled one (XL -> XXL no longer over-scales; going back to Large actually shrinks).
  • Extracted applyThemeOnlyRefresh(Form) as a package-private seam so the menu action and the regression tests share the exact same sequence.

Fixes #4963.

Test plan

  • mvn test -Plocal-dev-javase in maven/core-unittests -- new testRepeatedScaleChangesDoNotCompound walks scale 1.0 -> 1.5 -> 2.0 -> 1.25 -> 1.0 and asserts the pixel size matches each step.
  • mvn test -Plocal-dev-javase -- new testFormRefreshThemePropagatesScaleChange adds a Label to a Form, resolves its style, then asserts label.getStyle().getFont().getPixelSize() tracks the scale across full up-and-back-down cycle.
  • Full core-unittests suite (2431 tests) still passes.
  • maven/javase tests (20 tests) still pass.
  • Manual: launch simulator, Simulate -> Larger Text -> step through all sizes and confirm the form re-lays out immediately; step back to "Large (default)" and confirm fonts shrink back.

Generated with Claude Code

The menu action rebuilt the UIManager theme but never pushed the new
styles into the live form, so components kept their pre-refresh Style
references and the user saw no change until restart. The scale itself
also compounded across refreshes because applyLargerTextScaleToThemeFonts
derived from the already-scaled Font in themeProps -- XL->XXL over-scaled
and going back to default never shrank fonts.

JavaSEPort.refreshThemeOnly now calls Form.refreshTheme(true) so the
component tree picks up the rebuilt styles. UIManager tracks the
original/derived Font pair it wrote and rolls back before each scale
pass, so every refresh derives from the unscaled installed font.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 16, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 16, 2026

Compared 107 screenshots: 107 matched.

Native Android coverage

  • 📊 Line coverage: 11.51% (6374/55367 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.18% (31670/344940), branch 3.95% (1296/32776), complexity 5.07% (1593/31431), method 8.85% (1301/14708), class 14.85% (296/1993)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 11.51% (6374/55367 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 9.18% (31670/344940), branch 3.95% (1296/32776), complexity 5.07% (1593/31431), method 8.85% (1301/14708), class 14.85% (296/1993)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1238.000 ms
Base64 CN1 encode 252.000 ms
Base64 encode ratio (CN1/native) 0.204x (79.6% faster)
Base64 native decode 1014.000 ms
Base64 CN1 decode 327.000 ms
Base64 decode ratio (CN1/native) 0.322x (67.8% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 16, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 61000 ms
Simulator Boot (Run) 0 ms
App Install 12000 ms
App Launch 66000 ms
Test Execution 275000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 2781.000 ms
Base64 CN1 encode 3184.000 ms
Base64 encode ratio (CN1/native) 1.145x (14.5% slower)
Base64 native decode 1412.000 ms
Base64 CN1 decode 1759.000 ms
Base64 decode ratio (CN1/native) 1.246x (24.6% slower)
Base64 SIMD encode 769.000 ms
Base64 encode ratio (SIMD/native) 0.277x (72.3% faster)
Base64 encode ratio (SIMD/CN1) 0.242x (75.8% faster)
Base64 SIMD decode 795.000 ms
Base64 decode ratio (SIMD/native) 0.563x (43.7% faster)
Base64 decode ratio (SIMD/CN1) 0.452x (54.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 65.000 ms
Image createMask (SIMD on) 17.000 ms
Image createMask ratio (SIMD on/off) 0.262x (73.8% faster)
Image applyMask (SIMD off) 173.000 ms
Image applyMask (SIMD on) 80.000 ms
Image applyMask ratio (SIMD on/off) 0.462x (53.8% faster)
Image modifyAlpha (SIMD off) 187.000 ms
Image modifyAlpha (SIMD on) 88.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.471x (52.9% faster)
Image modifyAlpha removeColor (SIMD off) 3376.000 ms
Image modifyAlpha removeColor (SIMD on) 97.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.029x (97.1% faster)
Image PNG encode (SIMD off) 1627.000 ms
Image PNG encode (SIMD on) 1419.000 ms
Image PNG encode ratio (SIMD on/off) 0.872x (12.8% faster)
Image JPEG encode 1129.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 16, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 106000 ms
Simulator Boot (Run) 2000 ms
App Install 24000 ms
App Launch 16000 ms
Test Execution 325000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 2048.000 ms
Base64 CN1 encode 2778.000 ms
Base64 encode ratio (CN1/native) 1.356x (35.6% slower)
Base64 native decode 1424.000 ms
Base64 CN1 decode 1601.000 ms
Base64 decode ratio (CN1/native) 1.124x (12.4% slower)
Base64 SIMD encode 1269.000 ms
Base64 encode ratio (SIMD/native) 0.620x (38.0% faster)
Base64 encode ratio (SIMD/CN1) 0.457x (54.3% faster)
Base64 SIMD decode 678.000 ms
Base64 decode ratio (SIMD/native) 0.476x (52.4% faster)
Base64 decode ratio (SIMD/CN1) 0.423x (57.7% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 86.000 ms
Image createMask (SIMD on) 23.000 ms
Image createMask ratio (SIMD on/off) 0.267x (73.3% faster)
Image applyMask (SIMD off) 294.000 ms
Image applyMask (SIMD on) 180.000 ms
Image applyMask ratio (SIMD on/off) 0.612x (38.8% faster)
Image modifyAlpha (SIMD off) 285.000 ms
Image modifyAlpha (SIMD on) 181.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.635x (36.5% faster)
Image modifyAlpha removeColor (SIMD off) 461.000 ms
Image modifyAlpha removeColor (SIMD on) 125.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.271x (72.9% faster)
Image PNG encode (SIMD off) 1411.000 ms
Image PNG encode (SIMD on) 1160.000 ms
Image PNG encode ratio (SIMD on/off) 0.822x (17.8% faster)
Image JPEG encode 4970.000 ms

@shai-almog shai-almog merged commit 679594c into master May 16, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Simulator does not refresh when changing font size using Simulate->Larger Text

1 participant