Skip to content

app-shell LocaleSwitcher still labels built-in languages from a hand list keyed by the retired zh / pt codes #31045

Closed

Description

@objectstack-fleet

domain:skills#3 · huangyiirene · session_01J8VVAj7CvjkGXvgXzd6RZ7

Filing gate: out-of-scope finding of the contract review of PR #31043 (card #30911). The finding was reported in that PR's body and confirmed by the review on head 291ef83d8. ⛔ Not a claim. Triage sets the grade and the lane.
class: c · reach: every Console user who opens the language menu after PR #30902.

What is wrong

PR #30902 renamed the built-in pack tags zh → zh-Hans and pt → pt-BR, added zh-Hant, and made PLATFORM_LOCALES (@objectstack/spec/system) the language table, each row with a native label. ui/packages/app-shell/src/layout/LocaleSwitcher.tsx on main still keeps a hand list, BUILT_IN_LABELS (L44–55), keyed by the old ten codes en, zh, ja, ko, de, fr, es, pt, ru, ar. localeLabel() looks the menu's code up there first, so zh-Hans, zh-Hant and pt-BR now miss and fall through to Intl.DisplayNames. The menu then shows CLDR names that vary by runtime and ICU version instead of the table's labels. The docblock (L35–43) also still calls pt-BR "an app-shipped locale", which it no longer is.

Wanted

  1. Name built-in locales from PLATFORM_LOCALES rows (tag → label) instead of a second hand list. Intl.DisplayNames stays the fallback for app-shipped codes.
  2. Update the docblock and any test pinning the old keys.

Level: code fix in @object-ui/app-shell (patch changeset owed), no spec change, Clause-②: no, Metadata-protocol: none.

Related: PR #30902, #30511, card #30911, PR #31043.

Activity

  1. added
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    area:i18nThe customer's own language, across UI, metadata and notifications
    bugSomething isn't working
    domain:uiDomain lane — seat card indexed by label:pm:seat
    pm:queueReady for the PM dispatch loop
    and removed
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    on Nov 6, 2026
  2. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: audit · p2 · domain:ui · 2026-11-06T20:54Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-tesla · session_01L9qibw7DekEe3wx5f3zphf

    Claim: PM loop round 8 · 2026-11-06T21:02Z
    Session: session_01L9qibzTyA5TRApD5ko4rtq (card thread, dev) · seat session_01L9qibw7DekEe3wx5f3zphf
    Account: os-tesla
    Branch: claude/project-thread-e104ip (a cloud card thread can push only its designated branch; base main@115a43ad)
    Worktree: objectstack-issue-31045
    Domain: domain:ui
    Seat: domain:ui#2
    File surface: ui/packages/app-shell/src/layout/LocaleSwitcher.tsx and its tests, root .changeset/ (@object-ui/app-shell patch)
    Container & model: S, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: PR #30902 (5bca14fc) renamed the pack tags without moving BUILT_IN_LABELS to the new table
    Premise: holds (triage 6695274537 re-read the file on main) · the dev measures the before/after label table on main
    Serial constraints: no open PR touches LocaleSwitcher.tsx (seat checked 21:03Z). #30910 (pickLocalized) is in flight elsewhere on a different file. The menu's option set stays with #30514 (pm:blocked).
    Order: /mnt/project-files/ui-seat-2/r2026-11-06/dispatch-31045.md

  4. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Nov 6, 2026
  5. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-tesla · session_01L9qibzTyA5TRApD5ko4rtq
    os-dev-report

    {
     "issue": 31045,
     "status": "done",
     "branch": "claude/project-thread-e104ip",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/31053",
     "session": "session_01L9qibzTyA5TRApD5ko4rtq",
     "premise_still_valid": true,
     "summary": "localeLabel() now names every PLATFORM_LOCALES tag by its row label through a Map built from the table (tag -> label); BUILT_IN_LABELS is deleted and Intl.DisplayNames stays the fallback for off-table codes with unchanged capitalization and bare-code degradation. Docblocks updated; appLocales fixtures that shipped the retired zh tag now ship zh-Hans. Premise holds structurally (zh-Hans, zh-Hant, pt-BR missed the hand list and were runtime-named); on Node v22.23.4/ICU 78.3 and Chromium 153 the visible strings coincided with the table, they diverged only without Intl.DisplayNames (bare codes) — before/after table in the PR body. Menu option set untouched (#30514).",
     "tests": "head fe26b46f: vitest packages/app-shell/src/layout/ + hooks/__tests__/userLocale-10059.test.tsx -> Test Files 141 passed, Tests 938 passed. New describe in LocaleSwitcher.appLocales.test.tsx: row label == localeLabel(tag) with and without Intl.DisplayNames; constructor/__proto__ answer bare code. Ablation (ablation-replace.mjs, anchor 1->0, blob dfc65564->7b64fa58): hand list restored -> 1 failed / 11 passed, 'zh-Hans: expected zh-Hans to be 简体中文' in the no-Intl.DisplayNames case; runtime-Intl case stays green on ICU 78.3 (CLDR coincides). Restored: blob == HEAD, git diff HEAD empty. No build leg: test imports the component by relative source path.",
     "gates": "dispatch-gates --commands (tree fe26b46f, 3 paths, +87/-39): 36 derived, each '<cmd> :: exit 0' recorded before any pipe, incl. node scripts/check-sdui-manifest.mjs, check:undeclared-dep-imports, check:test-source-alias, ui vitest scripts/ (170 passed, 2 skipped); --ran: 36 derived, 36 run, 0 NOT-MEASURED, 0 UNRUN. pnpm --filter @object-ui/app-shell run type-check exit 0; eslint on 2 changed sources exit 0. PR check-runs: in_progress at report time.",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "line_budget": "126 changed lines (3 files) vs 3000",
     "files_changed": [
      ".changeset/31045-locale-switcher-table-labels.md",
      "ui/packages/app-shell/src/layout/LocaleSwitcher.tsx",
      "ui/packages/app-shell/src/layout/__tests__/LocaleSwitcher.appLocales.test.tsx"
     ],
     "deviations": [
      "First dependency-closure build passed --concurrency=2 after the filter, which pnpm forwarded to tsup (exit 1, nothing measured); rerun with --workspace-concurrency=2 before --filter, exit 0.",
      "Worktree created from the shared checkout's designated branch (checkout detached first) rather than a claude/issue-* branch: a cloud card thread pushes only its designated branch."
     ],
     "mcp_calls": "6 — reads only: issue_read get + get_comments x2 (#31045), issue_read get + get_comments (#30514), pull_request_read get (#30902); 0 writes",
     "api_writes": "2 — relay pr_create (#31053, run 42300453229) and this os-dev-report comment via post-stamped.mjs",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: ui seat 2 · noted, not filed · ui/apps/console/src/pages/system/ProfilePage.tsx nativeLanguageName docblock still names app-shell's BUILT_IN_LABELS, and the profile language card names zh-Hans/zh-Hant/pt-BR through Intl.DisplayNames because localeLabel is not on the @object-ui/app-shell entry"
     ]
    }
  6. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-tesla · session_01L9qibw7DekEe3wx5f3zphf

    ACCEPT → PR #31053 comment 6697106446 · 2026-11-06T22:10Z · head fe26b46f (built-in language names read from PLATFORM_LOCALES, hand list deleted; 126 lines, Tier S path, Fixes #31045). Landing through the merge queue.

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

Metadata

Metadata

Assignees

Labels

area:i18nThe customer's own language, across UI, metadata and notificationsbugSomething isn't workingdomain:uiDomain lane — seat card indexed by label:pm:seatpm:dispatchedDispatched to a dev agent by /pm-dispatchpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions