Skip to content

fix(native): show usage-limit retry time in the viewer's zone - #182

Merged
rynfar merged 3 commits into
nativefrom
nw/160-limit-zone
Nov 4, 2026
Merged

rynfar merged 3 commits into
nativefrom
nw/160-limit-zone

Conversation

@rynfar

@rynfar rynfar commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Usage-limit retry times now show the viewer's current IANA zone and follow web's timestamp setting, host locale and calendar-day rules. Previously native omitted the zone, used a fixed current offset, and ignored clock/locale preferences in this path.

Core owns day selection, named-zone offsets and clock rendering. The formatter resolves all four hour cycles, matches the base locale before applying hc, renders numeric hours with localized digits, and uses fixed AM/PM instead of flexible day periods while preserving the locale's period width. A small Korean AM/PM compatibility entry follows the Node/ICU 78 oracle where ICU4X's data differs. Transcript timestamps, the recovery banner and Usage reset details share the corrected helpers; only the retry row appends the zone.

The host-locale port mirrors ElectronApp.toSystemLocaleTag: macOS rg replaces the region and Apple 12/24-hour overrides become hc; Linux uses LC_ALL || LC_TIME || LANG, removes encoding and skips C/POSIX as web does. OS preferences are resolved once per UI thread, matching web's cached timestampLocale; clock and macOS numeric-date formatters use that same resolved tag. The en-NL date template preserves Intl's padding, including script-qualified locale tags. The older region getter is retained with a documented allowance because the bundle supports macOS 13 and its replacement requires 14.

Proof includes failing-first clock and host-locale regressions and a committed 900-case Node oracle: twelve locales × five times (midnight, 09:05, noon, 13:45, 23:59) × three settings × default/h11/h12/h23/h24. The fixture records Node v22.22.3 / ICU 78.2 and can be regenerated with node apps/native/scripts/gen-timestamp-oracle.mjs; it is test data, not runtime formatting data. Existing explicit-zone, DST, invalid/missing/past reset and year-boundary cases remain covered.

Validation: all required native gates passed: cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (1,259 tests, including the 900-case oracle), theme generation check, parity sync tests, client-runtime conformance generation check, and snapshot build/capture. Rebased onto 34415059cf (includes #179 and #183). Commit formatting/lint and knip passed. Root check:changed maps Rust paths to repo-wide checks, so the required native gates were used.

Dependency cost: The combined revision/rebase delta in the same debug snapshot profile is +2.58 MiB in the file and +1.86 MiB of code/data segments, compared with pre-review c80b44abc7. This is not an isolated dependency benchmark. The initial ICU probe build took 1m46s; this final incremental snapshot build took 22.27s including queued waits (the first r3 rebuild took 4m39s). No clean-build or release-size benchmark was run; measurements are in costs-final.json and size/build logs. Foundation hour skeletons lose fr-CA's literal h, and existing zone sources cannot consistently resolve the selected IANA name across targets. ICU4X is limited to clocks and chrono-tz provides the named-zone rules. Numeric dates retain Foundation on macOS. No probe example is committed.

Local offscreen evidence (fixture only, copied smoke home, no server writes): /private/tmp/native-160-evidence/before.png and /private/tmp/native-160-evidence/r3/after.png. Failing-first logs, native gate logs, and measurements are under /private/tmp/native-160-evidence/r3/.

ST-GENERAL and TR-WORK remain partial, with Issue cells restored to empty and pre-existing #7, and added Native paths retained. Broader row gaps remain, including English numeric-date fallback outside macOS. Non-macOS execution and actual OS preference/zone changes are unverified.

Closes #160.

Built with GPT-6.1 Sol in Codex

@rynfar

rynfar commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Orchestrator decision on the third review round (reviewer fe407f47 at 247e4da): the host-preference P2 is fixed, and the clock P2 is fixed for every reported case and the 900-case Intl oracle. A wider 42-locale sweep still found divergences in four base locales (es-CO, lt-LT, ug-CN, mr-IN). They come from V8's availableFormats best-pattern matching, which ICU4X does not ship. I accepted them as a documented gap rather than a fourth round, because native previously printed English 12-hour time for every locale. Tracked in #188, along with the non-macOS numeric-date fallback and the unverified platforms.

@rynfar
rynfar merged commit 7a627cf into native Nov 4, 2026
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