Skip to content

fix(ios): localize native app and watch surfaces - #105372

Merged
vincentkoc merged 98 commits into
mainfrom
fix/apple-watch-runtime-localization
Jul 12, 2026
Merged

vincentkoc merged 98 commits into
mainfrom
fix/apple-watch-runtime-localization

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Part of #104979.

Android runtime wiring landed separately in #105049.

What Problem This Solves

Fixes an issue where iOS and watchOS users selecting a supported non-English locale would still see English across setup, gateway, settings, chat, voice, notifications, Live Activities, Watch inbox, approval, and direct-connection surfaces.

Why This Change Was Made

Routes app-owned presentation copy through native localization, preserves backend/user/technical values verbatim, and generates deterministic runtime catalogs from the checked-in 21-locale translation inventory. Semantic Watch status payloads keep shipped text fields for staggered iPhone/watchOS updates, while generator checks reject new runtime interpolation and catalog drift.

AI-assisted: yes. The branch was reviewed in bounded semantic, Watch protocol, Watch UI, and generator slices, with every accepted finding addressed before publication.

User Impact

iOS and watchOS surfaces now resolve translated app copy at runtime across all supported locales. Locale changes also re-render persisted Watch status and approval state instead of retaining sender-language strings.

Evidence

  • node --import tsx scripts/apple-app-i18n.ts check
    • 1,193 iOS keys
    • 4 macOS keys
    • 84 InfoPlist localization files
    • 21 locales
  • node --import tsx scripts/native-app-i18n.ts check
    • 4,191 native inventory entries
    • 21 locale artifacts
  • node --import tsx scripts/android-app-i18n.ts check
    • 1,408 Android keys
    • 21 locale artifacts
  • Blacksmith Testbox tbx_01kxbh9tq40qnx99hn4h4s90gg
    • corepack pnpm test:serial test/scripts/android-app-i18n.test.ts test/scripts/apple-app-i18n.test.ts test/scripts/native-app-i18n.test.ts
    • 3 files passed, 43 tests passed
    • Android, Apple, and native inventory checks passed
    • pnpm check:changed -- <touched paths> passed after restoring sparse-checkout omissions
  • ./scripts/lint-swift.sh ios: 0 violations across 288 files
  • ./scripts/format-swift.sh ios: 0 of 288 files require formatting
  • xcodegen generate --spec apps/ios/project.yml --project /tmp/openclaw-xcodegen-final
  • git diff --check origin/main...HEAD
  • Fresh autoreview: no accepted/actionable findings; best bounded fix on the exact tree.
  • Reviewed head: 4aa9adde55767d9aef9dde1b2f01e2d90af3150d
  • Exact-head GitHub CI: all 11 required checks passed on 4aa9adde55767d9aef9dde1b2f01e2d90af3150d in CI run 29200015823 and Periphery run 29200015834.

The Linux Testbox cannot compile apps/shared/OpenClawKit because its SwiftMath dependency imports Apple-only CoreGraphics; exact-head macOS CI covers the Swift package and Apple application builds.

@vincentkoc vincentkoc self-assigned this Jul 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 12, 2026, 10:04 AM ET / 14:04 UTC.

Summary
The branch routes iOS, watchOS, Live Activity, shared chat, gateway, voice, notification, setup, and direct-connection copy through generated 21-locale catalogs while adding semantic, mixed-version-compatible Watch status and approval state.

Reproducibility: yes. The Apple runtime-localization gap is clear from current-main source and catalogs, while exact-head CI directly reproduces this branch's compile, lint, and generated-catalog failures.

Review metrics: 3 noteworthy metrics.

  • Generated Android drift: 21 locale catalogs stale. The shared inventory update changes every Android locale output although those generated resources are absent from this branch.
  • Watch upgrade bridges: 3 legacy status fields retained. Gateway, Talk, and chat status payloads must interoperate across staggered iPhone and watchOS upgrades.
  • Persisted Watch migration: 1 tombstone representation changed. Stored approval outcomes must decode correctly from the previous text representation after upgrade.

Stored data model
Persistent data-model change detected: persistent cache schema: apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatContextUsage.swift, serialized state: scripts/apple-app-i18n.ts, serialized state: test/scripts/native-app-i18n.test.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #104979
Summary: This PR is the Apple implementation candidate for the canonical native runtime-localization issue; the merged Android slice shares the translation inventory and exposes the current cross-platform drift.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🐚 platinum hermit
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Fix the exact-head Swift compile and lint failures.
  • Regenerate or isolate the 21 stale Android locale catalogs.
  • Remove the root changelog entry.

Risk before merge

  • [P1] The shared translation source affects Android runtime output, so final generated parity across platforms remains merge-critical.
  • [P1] The Watch wire-format and persisted approval-tombstone changes need exact-head mixed-version and upgrade proof after the mechanical blockers are fixed.

Maintainer options:

  1. Repair the exact head (recommended)
    Fix the compile and changed-file lint errors, restore Android catalog parity, remove the changelog line, and rerun all Apple and generator gates.
  2. Split the upgrade-sensitive slice
    Separate Watch protocol and persisted-state compatibility from catalog and UI localization if the combined branch remains difficult to prove safely.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Fix the Swift optional type and branch-caused Swift lint violations, regenerate all affected Android locale catalogs from the final shared native inventory, remove the root changelog entry, preserve mixed-version Watch compatibility, and rerun the focused Apple/native/Android checks.

Next step before merge

  • [P2] The branch has concrete, bounded repair work: correct Swift compilation and lint, restore generated catalog parity, and remove release-owned changelog content.

Security
Cleared: No concrete security or supply-chain regression was found; the branch adds no dependency source, permission, secret-access, package-resolution, publishing, or downloaded-code execution change.

Review findings

  • [P1] Give the inferred Watch status an optional type — apps/shared/OpenClawKit/Sources/OpenClawKit/WatchCommands.swift:598
  • [P1] Regenerate the Android locale catalogs — apps/.i18n/native-source.json:1
  • [P2] Bring the changed Swift files back within lint gates — apps/ios/WatchApp/Sources/WatchInboxMessages.swift:256
Review details

Best possible solution:

Fix the Swift compile and scoped lint blockers, regenerate every platform catalog affected by the final shared inventory, remove the root changelog entry, and land only after exact-head Apple builds and native, Apple, and Android generator checks are clean.

Do we have a high-confidence way to reproduce the issue?

Yes. The Apple runtime-localization gap is clear from current-main source and catalogs, while exact-head CI directly reproduces this branch's compile, lint, and generated-catalog failures.

Is this the best way to solve the issue?

The semantic boundary—localize app-owned presentation while preserving backend, user, and technical values verbatim—is the right design, but this implementation is incomplete because it does not compile and breaks the shared generator contract.

Full review comments:

  • [P1] Give the inferred Watch status an optional type — apps/shared/OpenClawKit/Sources/OpenClawKit/WatchCommands.swift:598
    This switch returns enum values in some branches and bare nil in the default branch, but the local has no declared optional type, so Swift cannot infer it. Exact-head iOS/macOS compilation fails here; declare statusCode as OpenClawWatchAppStatusCode? or otherwise provide optional context.
    Confidence: 1
  • [P1] Regenerate the Android locale catalogs — apps/.i18n/native-source.json:1
    This branch changes the shared native source and locale artifacts, so the Android generator now produces different output. Exact-head verification reports drift in all 21 checked-in Android catalogs; commit the regenerated outputs or isolate the inputs so this Apple change does not invalidate Android runtime resources.
    Confidence: 0.99
  • [P2] Bring the changed Swift files back within lint gates — apps/ios/WatchApp/Sources/WatchInboxMessages.swift:256
    The exact-head iOS lint run reports branch violations in touched files, including implicit optional initialization here, oversized Watch files, long localization lines, and excess complexity in the new Watch compatibility mapper. Refactor or format the changed code so the repository's Swift lint gate passes before merge.
    Confidence: 0.99
  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:9
    The latest head still includes the same root changelog addition raised in the previous review. CHANGELOG.md is release-owned for normal PRs, so remove this line and leave final release wording to release preparation.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against de5e15efc336.

Label changes

Label changes:

  • add merge-risk: 🚨 availability: The current head fails to compile shared OpenClawKit Watch code, preventing Apple app builds.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The external-contributor proof gate does not apply to this member-authored PR; exact-head Apple CI and optional simulator or device locale-switch evidence remain useful maintainer proof.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: The broad native localization improvement has concrete compile, lint, and generated-artifact blockers but is not an emergency.
  • merge-risk: 🚨 compatibility: The PR leaves Android generated locale catalogs stale and changes mixed-version Watch payload compatibility.
  • merge-risk: 🚨 session-state: The PR migrates persisted Watch approval tombstones and re-renders stored status state across locale changes.
  • merge-risk: 🚨 availability: The current head fails to compile shared OpenClawKit Watch code, preventing Apple app builds.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The external-contributor proof gate does not apply to this member-authored PR; exact-head Apple CI and optional simulator or device locale-switch evidence remain useful maintainer proof.
Evidence reviewed

Acceptance criteria:

  • [P1] node --import tsx scripts/native-app-i18n.ts check.
  • [P1] node --import tsx scripts/apple-app-i18n.ts check.
  • [P1] node --import tsx scripts/android-app-i18n.ts check.
  • [P1] pnpm test:serial test/scripts/apple-app-i18n.test.ts test/scripts/native-app-i18n.test.ts test/scripts/android-app-i18n.test.ts.
  • [P1] Exact-head iOS build and macOS Swift build/tests.

What I checked:

Likely related people:

  • vincentkoc: Introduced the current-main Watch snapshot surface and authored both the merged Android localization work and this Apple localization branch. (role: introduced behavior and recent area contributor; confidence: high; commits: ea634f7152b1, e04df5a4049d, 52271426717d; files: apps/shared/OpenClawKit/Sources/OpenClawKit/WatchCommands.swift, apps/.i18n/native-source.json, apps/ios)
  • steipete: Git shortlog shows the largest historical contribution count across the sampled Watch app, shared Watch command, and native localization paths. (role: adjacent iOS and Watch owner; confidence: medium; files: apps/ios/WatchApp, apps/shared/OpenClawKit/Sources/OpenClawKit/WatchCommands.swift, scripts/native-app-i18n.ts)
  • mbelinky: Git shortlog shows repeated merged work in the sampled iOS and Watch paths, making this person a useful secondary reviewer for the broad native change. (role: recent adjacent contributor; confidence: medium; files: apps/ios/WatchApp, apps/shared/OpenClawKit/Sources/OpenClawKit/WatchCommands.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-07-12T13:09:10.438Z sha 56ac47b :: needs changes before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-07-12T13:20:11.020Z sha 56ac47b :: found issues before merge. :: [P3] Remove the release-owned changelog entry

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 12, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 12, 2026 13:45
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 12, 2026
@vincentkoc

vincentkoc commented Jul 12, 2026 •

Copy link
Copy Markdown
Member Author

Land-ready proof for exact head 4aa9adde55767d9aef9dde1b2f01e2d90af3150d:

  • Apple catalog check: 1,193 iOS keys, 4 macOS keys, 84 InfoPlist files, and 21 locale catalogs.
  • Native inventory check: 4,191 stable entries and 21 locale artifacts.
  • Android catalog check: 1,408 keys across 21 locales; shared native artifacts remain aligned with the separately landed Android runtime wiring in fix(android): localize native app surfaces #105049.
  • Blacksmith Testbox tbx_01kxbh9tq40qnx99hn4h4s90gg: all 3 localization generator suites passed, 43/43 tests; pnpm check:changed passed for the 212 touched paths.
  • Local Apple static proof: SwiftLint 0 violations across 288 files; SwiftFormat 0/288 files requiring changes; Xcodegen project generation passed; git diff --check passed.
  • Fresh exact-head autoreview found no accepted/actionable findings.
  • Exact-head GitHub CI: all 11 required checks passed in CI run 29200015823 and Periphery run 29200015834, including iOS build, macOS Swift, native i18n, lint/types, Android build/tests, and dead-code scanning.
  • The final tail removes the root changelog entry to comply with the repository's release-owned changelog policy; runtime code and generated artifacts are unchanged from the fully tested predecessor.

The Linux Testbox cannot compile the Apple-only Swift package dependency path because SwiftMath imports CoreGraphics; exact-head macOS CI owns the Swift package and application build proof.

@vincentkoc
vincentkoc merged commit bd76916 into main Jul 12, 2026
101 of 103 checks passed
@vincentkoc
vincentkoc deleted the fix/apple-watch-runtime-localization branch July 12, 2026 16:33
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: ios App: ios feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant