Skip to content

Regenerate native theme .res files for #5170 CSS changes#5174

Merged
shai-almog merged 1 commit into
masterfrom
regen-native-themes-res
Jun 5, 2026
Merged

Regenerate native theme .res files for #5170 CSS changes#5174
shai-almog merged 1 commit into
masterfrom
regen-native-themes-res

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Manually performs what the Native Themes Sync workflow should have done, so we don't need another release just to run the automation.

Why

Themes/iOSModernTheme.res and Themes/AndroidMaterialTheme.res are committed, generated artifacts of native-themes/{ios-modern,android-material}/theme.css. #5170 changed both CSS sources, but the sync workflow that regenerates+commits the .res was broken (container-pull denied → fixed in #5172; safe.directory → fixed in #5173, still open), so the committed .res never got rebuilt. They were last regenerated back in #5055.

What

Regenerated locally via scripts/build-native-themes.sh (existing css-compiler jar) and committed the two tracked outputs:

  • Themes/AndroidMaterialTheme.res — 109504 → 112112 bytes
  • Themes/iOSModernTheme.res — 113418 → 110026 bytes

The size deltas reflect #5170's CSS edits.

Notes

  • This only re-syncs master's committed .res for future builds / the build server — it does not alter the already-published 7.0.249 Maven artifacts.
  • Once Fix native-themes-sync commit-back: mark workspace safe.directory #5173 merges, the now-fixed sync will run on this path and either confirm these bytes (no-op) or commit a toolchain-identical regen; either way it's idempotent.

🤖 Generated with Claude Code

The Native Themes Sync workflow that normally regenerates and commits
these was broken (container-pull + safe.directory bugs, fixed in #5172
and #5173), so the committed Themes/{iOSModernTheme,AndroidMaterialTheme}.res
were never rebuilt after #5170 changed native-themes/ios-modern/theme.css
and native-themes/android-material/theme.css. Regenerated here manually
via scripts/build-native-themes.sh so master's .res match their CSS
sources again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

✅ 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 merged commit 3688680 into master Jun 5, 2026
12 checks passed
@shai-almog shai-almog deleted the regen-native-themes-res branch June 5, 2026 11:09
shai-almog added a commit that referenced this pull request Jun 5, 2026
…topMode

ChatView_{dark,light} and ToolbarTheme_{dark,light} drifted when #5174
regenerated Themes/iOSModernTheme.res (the Mac Catalyst native theme), changing
the toolbar/chat chrome. The Mac native screenshot goldens were never
regenerated because Themes/*.res changes don't trigger scripts-mac-native
(it keys on native-themes/ios-modern/** and scripts/**). Updated from the
full-resolution Mac Catalyst CI render. Also seeds the missing DesktopMode
baseline (DesktopModeScreenshotTest, added in #5170).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shai-almog added a commit that referenced this pull request Jun 5, 2026
…DesktopMode

Same drift as the Mac goldens: #5174 regenerated Themes/iOSModernTheme.res,
changing ChatView_{dark,light} and ToolbarTheme_{dark,light} chrome, but the
iOS screenshot goldens (both the GL set in scripts/ios/screenshots and the
Metal set in scripts/ios/screenshots-metal) were never regenerated because
Themes/*.res changes don't trigger scripts-ios. Updated from the full-res CI
renders (GL from the build-ios job, Metal from build-ios-metal). Also seeds the
missing DesktopMode baseline for both backends.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shai-almog added a commit that referenced this pull request Jun 5, 2026
…ge (#5177)

* Fix iOS camera native build break + gate new Camera API on actual usage

The new com.codename1.camera native bridge (CN1Camera.m, #5126) failed to
compile in cloud builds: "call to undeclared function 'fromNSData'". Three
related problems:

1. fromNSData() was never defined anywhere. The real NSData->byte[] helper is
   nsDataToByteArr(NSData*) in IOSNative.m (it pulls thread state internally,
   no thread-state arg). Fixed both call sites + added the extern declaration.

2. The new natives were gated on INCLUDE_CAMERA_USAGE, which IPhoneBuilder
   flips whenever an app declares an NSCameraUsageDescription. So any app that
   set a camera permission for the OLD modal Capture API dragged in the new,
   never-compiled AVFoundation natives -- exactly how this surfaced on a
   customer build that doesn't use the new API. Introduce a dedicated
   INCLUDE_CN1_CAMERA define that IPhoneBuilder flips only when the bytecode
   scan sees com.codename1.camera.* (mirrors usesNfc / CN1_INCLUDE_NFC). The
   old Capture natives in IOSNative.m keep INCLUDE_CAMERA_USAGE.

3. CI never compiled this code because no test app referenced the API, so the
   bug shipped unseen. scripts/hellocodenameone now calls
   Camera.isSupported()/getCameras() at startup (no session, no permission
   prompt) and declares the usage description, so the natives compile on every
   iOS/Mac CI run and CameraX is pulled into the Android build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix CN1Camera fromNSString calls: use PASS_ARG (comma) not SINGLE_ARG

The native iOS/Mac CI builds (which now actually compile CN1Camera.m thanks to
the hellocodenameone camera usage) failed with "error: expected ')'" on four
fromNSString(...) calls. fromNSString takes (threadState, NSString*), so it
needs CN1_THREAD_GET_STATE_PASS_ARG (expands to "getThreadLocalData(),") --
the code used CN1_THREAD_GET_STATE_PASS_SINGLE_ARG (no trailing comma), which
is only valid when thread state is the sole argument.

These four were present in the original error.txt alongside the fromNSData
errors; the earlier commit fixed fromNSData but missed the fromNSString calls
because that code path had never been compiled until CI exercised it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Seed missing Android golden for DesktopModeScreenshotTest

DesktopModeScreenshotTest was added in #5170 ("Deepen desktop integration")
but no reference screenshots were committed, so every CI screenshot run
reports DesktopMode as "missing reference" (non-fatal, but it means the test
has no baseline). This seeds the Android baseline from the full-resolution
emulator render produced by the scripts-android CI job, so the Android
instrumentation screenshot suite now has a golden to compare against.

The captured screen is the desktop-mode list (title bar + colored rows),
320x640, matching the other Android goldens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci(cn1ss): fail when stored references produce no screenshot (mid-run hang)

The strict screenshot guard only counted "missing_actual" entries from the
comparison JSON. Those entries exist only for tests the runner *registered* an
actual for. When a suite hangs and the app is killed mid-run (SIGTERM), every
remaining test is never registered at all -- so it is invisible to that check.

That is exactly how the iOS Metal suite reported "72/72 matched" and passed
while 51 of its 123 stored references never produced an image: it hung on
ChartRotatedScreenshotTest, the app was terminated, and the ~51 tests after it
were silently dropped from the comparison set rather than flagged.

Add a reference-coverage guard: every PNG in the reference dir must have a
corresponding produced actual. Uncaptured references beyond CN1SS_ALLOWED_MISSING
fail with exit 17 (the same code/intent the surrounding comment already
described as "fewer screenshots than stored references"). Tolerance reuses
CN1SS_ALLOWED_MISSING; bypass with CN1SS_SKIP_COUNT_CHECK=1 when seeding a new
baseline set. Implemented bash-3.2-safe for the macOS runners.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Refresh Mac native goldens after #5174 native-theme regen + seed DesktopMode

ChatView_{dark,light} and ToolbarTheme_{dark,light} drifted when #5174
regenerated Themes/iOSModernTheme.res (the Mac Catalyst native theme), changing
the toolbar/chat chrome. The Mac native screenshot goldens were never
regenerated because Themes/*.res changes don't trigger scripts-mac-native
(it keys on native-themes/ios-modern/** and scripts/**). Updated from the
full-resolution Mac Catalyst CI render. Also seeds the missing DesktopMode
baseline (DesktopModeScreenshotTest, added in #5170).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Refresh iOS GL + Metal goldens after #5174 native-theme regen + seed DesktopMode

Same drift as the Mac goldens: #5174 regenerated Themes/iOSModernTheme.res,
changing ChatView_{dark,light} and ToolbarTheme_{dark,light} chrome, but the
iOS screenshot goldens (both the GL set in scripts/ios/screenshots and the
Metal set in scripts/ios/screenshots-metal) were never regenerated because
Themes/*.res changes don't trigger scripts-ios. Updated from the full-res CI
renders (GL from the build-ios job, Metal from build-ios-metal). Also seeds the
missing DesktopMode baseline for both backends.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Seed missing JavaScript DesktopMode golden (DesktopModeScreenshotTest #5170)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Harden Metal screenshot readback against an unbounded command-buffer wait

The iOS Metal screenshot suite intermittently hung during readback (observed
on ChartRotatedScreenshotTest): the app stalls with no crash and no Metal
validation error, the runner SIGTERMs it, and every test after the stall is
silently dropped (the suite reported 72/123 "matched" and still passed before
the cn1ss reference-coverage guard was added).

Root cause class: [cb waitUntilCompleted] in the mutable-image readback path
blocks the calling thread forever when the command buffer was created (a
mutable image's Begin) but never committed (readback racing ahead of End), and
blocks indefinitely on a genuinely stuck GPU buffer. Either mode is an
unrecoverable hang.

Replace the three unbounded waits (CN1MetalFlushMutableImageSync + the two
blit-to-shared readbacks) with cn1MetalWaitCommandBufferBounded():
  - returns immediately for an uncommitted buffer (NotEnqueued/Enqueued) --
    it will never be submitted, so there is nothing to await;
  - polls status with an 8s deadline for committed/scheduled buffers as a
    backstop against a stuck GPU.
On a non-completed buffer the caller reads back whatever is in the texture, so
the affected screenshot fails visibly against its golden instead of hanging the
whole suite. Verified the file compiles clean (clang -fsyntax-only, modules,
iphonesimulator26.2 SDK).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Remove orphan golden graphics-inscribed-triangle-grid.png from javase suite

The reference-coverage guard flagged scripts/javase/screenshots as having 12
references but the JavaSE simulator-integration suite only produces 11 (window
modes, inspector, network monitor, test recorder, 4 native themes).

graphics-inscribed-triangle-grid.png is a device-runner graphics-test golden
(it lives in every platform's screenshots dir) that was accidentally committed
into the javase simulator-integration dir in #4939. That suite never emits a
graphics-* screenshot and is the only consumer of scripts/javase/screenshots,
so the file is a true orphan. Removing it makes the dir match what the suite
produces. (This is exactly the kind of silent cruft the new guard surfaces.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Remove 4 orphan CamelCase Graphics goldens from iOS GL screenshot set

The reference-coverage guard failed build-ios: scripts/ios/screenshots had 128
references but the suite produces 124. The 4 extras are stale CamelCase goldens
-- GraphicsPipeline, GraphicsShapesAndGradients, GraphicsStateAndText,
GraphicsTransformations -- left over from before the graphics tests were renamed
to kebab-case (graphics-*). They exist only in the iOS GL dir (no other
platform), no test produces them, and the current kebab-case graphics-* goldens
are produced and matched. The old missing_actual check never saw these (no
test registers an actual for them), so they shipped silently; the new guard
surfaces them. Removing makes the GL dir match what the suite emits.

The TimeApiTest / LocalNotificationOverrideTest CN1SS:ERR failures visible in
the same job are pre-existing on master (master's build-ios is green with them)
and unrelated to this branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Revert the cn1ss reference-coverage guard (false-fails platform-skipped tests)

The reference-coverage guard added earlier compares every stored golden against
the produced actuals and fails when any golden has no actual. That conflates two
different things: a hung/killed suite (the metal case it was meant to catch) AND
tests that a platform intentionally skips but still keeps goldens for. The latter
false-failed the JavaScript suite -- HTML5 parks ~14 tests (ChatView, ChatInput,
Sheet, chart-rotated-pie, chart-transform, css-gradients, ...) via
Cn1ssDeviceRunner.shouldForceTimeoutInHtml5 yet keeps their goldens, so the guard
reported them as "uncaptured" even though the JS comparison itself was green
(95/95 matched).

Reverting it. The metal screenshot hang it was meant to backstop is already
prevented at the source by the bounded command-buffer wait in CN1Metalcompat.m
(this PR). A precise, skip-safe hang detector (require CN1SS:SUITE:FINISHED in the
device log) is the correct replacement and can be added separately rather than
blocking this fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <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