Repository navigation
Commit 9f762cf
test(app-shell,console): approvals and inbox reads carry the console's UI language (#37543)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgTACWfLyuZEQ4gVESvk5YRQ)_
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:
- `useRecordApprovals` (`fetchJson`: request, actions, remind) and
`sharedUserFeeds` (`fetchPendingApprovalPage`) moved from a bare `fetch`
+ `bearerAuthHeaders()` to it in #37185 (merged 2026-11-25, after
18.6.0).
- `approvalsApi.ts` and `approvalRequestsDataSource.ts` have used it
since #27040 / #28619.
- The inbox (`sys_inbox_message`, `sys_notification_receipt`) reads
through the console adapter, which `AdapterProvider` builds on the same
fetch.
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
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CbGtuQD4c5iyX7mqpV
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CbGtuQD4c5iyX7mqpV -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4116465 commit 9f762cf
2 files changed
Lines changed: 214 additions & 0 deletions
File tree
- ui
- apps/console/src/services
- packages/app-shell/src/hooks/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
0 commit comments