Skip to content

test(app-shell,console): approvals and inbox reads carry the console's UI language - #37543

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-17i5by
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-17i5by

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Part of #37483

What changes

Test-only. Two pins hold every approvals reader and the notification inbox read to the console's authenticated fetch, which sends the active UI language as Accept-Language:

  • ui/packages/app-shell/src/hooks/__tests__/approvalsUiLocale-37483.test.tsx: the approval history read (listApprovalActions, /approvals/requests/:id/actions), remindApprovalRequest, fetchPendingApprovalPage (bell, home, full-page inbox), and the notification inbox: the real AdapterProvider mounted with useSharedInboxFeed, asserting the header on its sys_inbox_message read.
  • ui/apps/console/src/services/approvalRequestsDataSource.uiLocale-37483.test.tsx: the request page's history (sys_approval_action timeline) and request read (process_label / step_label) through routeApprovalRecordReads(adapter), as AppContent wires it.

Each pin sets <html lang="en"> and asserts Accept-Language: en. The controls are on the stamp itself: an empty <html lang> adds no header rather than a guessed one.

Why

The card was measured on the 18.6.0 bundles. On main the shared helper the card suggests already does the job: createAuthenticatedFetch (@object-ui/auth) stamps <html lang> as Accept-Language on every /api/ call, and the readers it names now go through it:

So no source change is needed for approval history; what was missing is a pin that keeps these surfaces on that transport. Ablation: replacing the stamp in createAuthenticatedFetch with a no-op turns all six positive pins red, controls stay green; building AdapterProvider's adapter on a bare fetch turns the inbox pin red.

Why Part of, not Fixes: the inbox read already went through the stamped adapter at 18.6.0, so "fixed after 18.6.0" does not explain the inbox evidence in comment 7186322473. The card stays open until a header capture of GET /api/v1/data/sys_inbox_message on a main build settles it (reported on the card).

Verification

  • pnpm --dir ui exec vitest run packages/app-shell/src/hooks/__tests__/approvalsUiLocale-37483.test.tsx apps/console/src/services/approvalRequestsDataSource.uiLocale-37483.test.tsx: 9 passed.
  • Ablations above: 6 failed / 3 passed with the stamp removed; inbox pin red with the adapter on a bare fetch.
  • eslint on both files: clean. check:commit-card-trailers, overlap-check: clean.

Publishes nothing (test files only), so skip-changeset.

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CbGtuQD4c5iyX7mqpV

…s UI language

Pins that every approvals reader (approval history, request labels, remind,
the pending-approvals page) and the notification inbox read send the active
UI language as Accept-Language through the console's authenticated fetch,
with a control: no UI language chosen leaves the header to the browser.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbGtuQD4c5iyX7mqpV
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 3312d68 · 2026-11-26T12:51Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3312d68bbf201e97f1b00c425629be8e2acc5210
Local-runs: none

① Derived judgments

The diff adds two test files and nothing else. It changes no accept-set and no public surface. All check-runs on the head are success or skipped by path, with none failed. That includes Test UI 1-16, Type Check UI, Lint UI and Check Changeset.

Census of the live tree on main (021524cd0a). The claim holds: I found no approvals or inbox read that bypasses the stamp.

  • createAuthenticatedFetch sets Accept-Language from <html lang> on every /api/ URL and never overwrites a header the caller set. The i18n provider writes <html lang> at boot and on every switch.
  • Approval readers:
  • Inbox readers: useSharedInboxFeed, readEarlierInboxMessages (InboxPage) and the sys_inbox_message list route all read through the AdapterProvider adapter. That adapter is built on withSettleSignal(createAuthenticatedFetch()), and withSettleSignal passes init through unchanged.
    • The console never calls ObjectStackClient.setLocale, so the client sets no Accept-Language of its own that would block the stamp.
    • The URL shape in 7186322473 (top=…&sort=…&filter=…) is the one client.data.find builds, so the measured read came from that adapter.
  • Other paths I checked:
    • The adapter's only bare fetch calls are the two upload methods.
    • The service worker never answers /api/ requests, and dev builds register none.
    • The push channel only triggers a refetch, and no host opens one.
    • The console is a SPA, with no SSR path. Record-page prefetch goes through the adapter.

The pins hold up under reading:

  • Stamp removed: all 6 positive pins read null instead of en and go red.
  • Controls: the 3 controls set lang='' and expect null. They go red if the stamp falls back to navigator.language or a fixed value, so they are real.
  • Each pin first asserts that a request matched the URL. A read that never reaches fetch therefore fails rather than passing empty.
  • 4 + 2 + 3 = 9, as the PR body says.

Findings:

  • should-fix: the inbox pin builds its own new ObjectStackAdapter({ fetch: createAuthenticatedFetch() }). It tests that library pair, not the console's wiring. If AdapterProvider or useSharedInboxFeed moved off the authenticated fetch, it would stay green. The inbox is the disputed surface, so pin it through AdapterProvider and useSharedInboxFeed.
  • should-fix: the PR says Fixes #37483, but nothing accounts for the inbox evidence in 7186322473. "Fixed after 18.6.0" covers approval history only. At the 18.6.0 tag the inbox read already went through AdapterProvider, with createAuthenticatedFetch already setting Accept-Language from <html lang>. Nothing on that path changed between the measured build and main. Either the measurement is wrong or something at runtime that the source doesn't show strips the header, and the dev's own open point says so. Use a reference that doesn't close the card until someone captures the headers on a main build.
  • nit: the console pin goes through createApprovalRequestsDataSource, which has no production caller on main. The live path is routeApprovalRecordReads. Both share approvalReadDoors, so removing the stamp is still caught, but the live export would be the better target.
  • nit: the controls' "browser's language applies" premise never happens in the console, because index.html ships lang="en" and the provider always writes a language. They are valid as controls on the stamp itself.

② Semver level

skip-changeset is correct: the diff ships nothing. The console file is excluded by @object-ui/console's files list (dist, plugin.*, README.md). The app-shell file is excluded by @object-ui/app-shell's, which is private and publishes dist and src/styles.css. Check Changeset is green. Clause-②: no is correct: nothing is published and no declared capability narrows. Metadata-protocol: none is correct.

③ Boundary flags

  • Dev's open point (inbox read reported without Accept-Language): answered. On main no inbox read path bypasses the stamp, and none did at 18.6.0 either. That is why this is a should-fix on closing the card rather than a must-fix on the code. Escalated to the card: a header capture of GET /api/v1/data/sys_inbox_message on a main build, with the console set to English and the browser set to zh-CN, settles it.
  • Dev's scope call on useRowApprovalLocks (lock flags only, no server-rendered text): agreed.
  • No open_questions entries.
  • SQL push-down: not touched. Tests only, with no new id materialisation and no in-app join.

Implemented-by: claude/project-thread-17i5by
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 3312d68bbf201e97f1b00c425629be8e2acc5210
REWORK — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Fixes #37483. Test-only (2 files, +185), skip-changeset (right: neither file ships), Clause-②: no. Not governed. No review face, so the declaration face applies at TIER_DEFAULT.
  2. Premise: on main every approvals and inbox read goes through createAuthenticatedFetch, which stamps <html lang> as Accept-Language. Approval history moved onto it in fix(app-shell,console): the shell package list, AI chat lists and studio-design reads and writes send the stored bearer token #37185, after the 18.6.0 bundles the card measured. The reviewer found no inbox read path that bypasses the stamp, at 18.6.0 or now.
  3. Gates: contract record 7192710314 reads PASS, with no must-fix and two should-fix findings, named here S1 and S2 in the record's order. CI on this head is green.
  4. Owed for the delta:
    • S1: the inbox pin builds its own ObjectStackAdapter on createAuthenticatedFetch(), so it tests the library pair, not the console's wiring. Drive it through AdapterProvider and useSharedInboxFeed, the path the inbox actually reads, and give the ablation.
    • S2: Fixes #37483 would close the card while the inbox evidence in 7186322473 is unexplained: at 18.6.0 the inbox read was already stamped. Change it to Part of #37483. Before the card closes, capture the request headers of GET /api/v1/data/sys_inbox_message from a main build. A local build driven by the container's Playwright is enough; the hosted hosts are not needed. Post the capture on the card. If the header is present, close the card on that evidence. If it is missing, that is a new finding on the card.
    • N1 (the console pin goes through createApprovalRequestsDataSource, which has no production caller; the live path is routeApprovalRecordReads): repoint it if cheap. N2 (the controls test a no-language state the console never reaches) is accepted.
  5. Out of scope and where it went: none.
  6. Next: push, then knock. The delta reads S1 and S2. After ACCEPT, Bill names it for landing.

… wiring

The inbox pin now mounts the real AdapterProvider and useSharedInboxFeed
instead of a hand-built adapter, and the request-page pin goes through
routeApprovalRecordReads as AppContent wires it. Controls are reworded as
controls on the stamp itself.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbGtuQD4c5iyX7mqpV
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 812ae05 · 2026-11-26T13:27Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 812ae05d84dbe1ad295e7a82055842d9290af492
Local-runs: none

① Derived judgments

This is a delta from 3312d68bbf and record 7192710314. The diff against main is still only the 2 test files: no accept-set or public-surface change. Check-runs on the head: 38 success, 17 skipped, 0 failed. That includes Test UI (all 16 shards), Type Check UI and Lint UI.

  • S1: closed. The inbox pin now mounts the real AdapterProvider with useSharedInboxFeed under it, and reads the header off the feed's own sys_inbox_message request.
    • useAuth alone is mocked, and the mock spreads the real @object-ui/auth, so createAuthenticatedFetch is the real one.
    • __markFirstPainted and __resetSharedUserFeeds are existing exports on main, and the feed is reset after each test.
    • It goes red if the stamp is removed, or if AdapterProvider or the feed moves off the authenticated fetch.
    • The control still uses an empty <html lang>.
  • N1: closed. The console pin now uses routeApprovalRecordReads(host) with no fetch, which is how AppContent wires it.
  • The controls are relabelled "an empty <html lang> adds no header". The docblocks now say the console never reaches that state, so the N2 wording is fixed too.

The pin count is unchanged at 9: 6 positive and 3 controls.

② Semver level

Unchanged: skip-changeset is correct and the test files do not ship. Check Changeset is skipped under the label. The PR body keeps Clause-②: no and Metadata-protocol: none, and both are correct.

③ Boundary flags

  • S2: closed. The PR body now says Part of #37483, so merging does not close the card.
  • The capture (7192984653) settles the inbox evidence well enough to close Console approvals: system notes in approval history follow the browser's language, not the chosen UI language — the approvals fetch helper sends no Accept-Language #37483. The setup was a main build (1af67b2 plus the 2 tests) with the current ui/ source, in Playwright Chromium with locale: 'zh-CN' and objectui-locale = en. Headers were read with request.allHeaders().
    • All 3 reads carried Accept-Language: en: sys_inbox_message, sys_notification_receipt and the pending-approvals read.
    • The control run sent zh-CN.
    • The reporter's own replay shows the server answering English titles for en. Together with the capture, that meets the comment's acceptance on main.
  • Two caveats remain. Neither blocks closing:
    • The capture used a vite dev build, not the packed bundles. The only production-only difference on this path is the service worker, and it never answers /api/.
    • The 18.6.0 observation is still unexplained, because the inbox path already carried the stamp in 18.6.0's source.
  • Close the card with a pointer to the capture, so that the reporter can reopen it if a release build shows Chinese again.
  • SQL push-down: not touched (tests only).

Implemented-by: claude/project-thread-17i5by
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 812ae05d84dbe1ad295e7a82055842d9290af492
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Part of #37483. Test-only (2 files, 9 pins), skip-changeset, Clause-②: no. Not governed, and no narrowing.
  2. Premise: on main, every approvals and inbox read goes through createAuthenticatedFetch, which stamps <html lang> as Accept-Language. The inbox pin now mounts the real AdapterProvider and useSharedInboxFeed. The console pin goes through routeApprovalRecordReads(host), as AppContent wires it. The capture on Console approvals: system notes in approval history follow the browser's language, not the chosen UI language — the approvals fetch helper sends no Accept-Language #37483 (7192984653) shows a main build sending Accept-Language: en on sys_inbox_message, sys_notification_receipt and the pending-approvals list, with the control run sending zh-CN.
  3. Gates: delta record 7193425919 (same reviewer) reads PASS. S1, S2 and N1 are closed. CI on this head: 38 success, 17 skipped, 0 failed.
  4. Accepted deviations: N2. The capture ran on a vite dev build, not the packed bundles; the only production-only difference on this path is the service worker, which never answers /api/. The reporter's 18.6.0 sighting stays unexplained.
  5. Out of scope and where it went: none. Close Console approvals: system notes in approval history follow the browser's language, not the chosen UI language — the approvals fetch helper sends no Accept-Language #37483 after this merges, citing the capture, so the reporter can reopen it if a release build shows the wrong language again.
  6. Landing terms: ungoverned, default tier. The seat lands it with --land once the maintainer names it, because area o5-U cannot run --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Probe Reading
check-governed-merges --pr 37543 NOT governed, test-only (2 files). No narrowing declared (Clause-②: no)
landing-k --pr 37543 measured by hand, because no Test Core shard ran on this UI-only diff: K = 8 first-parent commits on main since the merge base (< 15). No locale or budget input in the diff
pr-state --pr 37543 at 812ae05d84 38 success · 17 expected skip · 0 failed · 0 pending
os-regen paths in diff none

Landing on seat ACCEPT 7193444090, which sits on the same-head delta PASS 7193425919. The maintainer named this PR on the seat thread's decision card: 「合并 #37543」 on 「合并已 ACCEPT 的非受管 PR #37543(审批请求跟随界面语言,纯测试)吗?」, at 13:36Z. Action: ready + auto-merge. Part of #37483: the area closes the card after merge, citing the capture 7192984653.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 13:36
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 9f762cf Nov 26, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-17i5by branch November 26, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant