Repository navigation
Commit 0f1045b
fix(app-shell): permission-set editor header shows the served (translated) label (#27019)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8GKuALbng1TQyrFASUX9Lyy)_
Fixes #26884
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:权限集详情页(Setup 与 Studio 访问支柱)的标题改用服务端按语言下发的标签,zh-CN
下显示「销售代表」而不是「Sales Representative」。
- **为什么改**:列表页已经显示翻译后的名称,点进去标题却是英文原文;编辑器的草稿来自未翻译的 layered
读取,而它已经读到的已发布列表是翻译过的。
-
**风险与回滚**:只改显示,草稿与保存内容不变(保存仍发作者原文);标签被编辑或有不同标签的待发布草稿时显示草稿标签。回滚即还原这一个提交。
- **先看**:`PermissionMatrixEditor.tsx` 的 `headerLabel` 与加载末尾读取 served
行那段;新测试 `PermissionMatrixEditor.servedLabel-26884.test.tsx`。
- **两分钟验证**:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.servedLabel-26884.test.tsx`,预期
4 个用例全绿。
- **需要你做的**:无,席位落地。
## What changes
- `PermissionMatrixEditPage` keeps the label of the row `GET
/meta/permission` serves for this set (that read is localized at the
REST boundary by the server's permission-set translator, and the editor
already makes it for the published-set check). The header shows it while
the draft's label equals the published authored label; otherwise it
shows the draft's label, as before.
- Both header sites read it: the Setup page's identity strip and the
Studio Access pillar's `StudioItemHeader` title.
- Display only: the served label is never written into `draft`, so a
save sends the authored label unchanged. A set the published list does
not hold (never published) keeps its draft label.
- Scope cut, per the dispatch order: the card's second symptom (the
metadata list chrome staying English under ja-JP / es-ES) is the ruled
en fallback, not a defect (Ruling-ref 6431032267, verbatim: "the other
eight locales fall back to en (no invented translations)"), so it is not
touched here.
- Changeset: `@object-ui/app-shell` patch.
## Tests
New `PermissionMatrixEditor.servedLabel-26884.test.tsx` (4 cases): zh-CN
served 销售代表 over layered "Sales Representative", and the autosave sends
"Sales Representative" unchanged; ja-JP served label; a set the list
does not hold keeps its draft label; an edit to the label shows the
edit.
Ablation (one-off, `scripts/ablation-replace.mjs`, restored blob equals
HEAD): putting `draft.label` back in the Setup header turns 3 of the 4
cases red (the never-published case stays green, as expected); restored,
4/4 green.
## Acceptance notes
- The served label comes from the same list request the editor already
sends; no new request.
## Verification
<details><summary>Local gates on 53382fa</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 34 families derived, 34 run, every one exit
0; `--ran` reconciliation: 34 run, 0 NOT-MEASURED, 0 UNRUN. `node
scripts/check-sdui-manifest.mjs` is among them (exit 0).
- `pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/`: Test Files 624 passed,
Tests 6809 passed, 1 skipped (exit 0).
- `pnpm --filter @object-ui/app-shell type-check`: exit 0.
- Closure build `pnpm --workspace-concurrency=2 --filter
'@object-ui/app-shell^...' build`: exit 0.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (CI)
- [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: n/a.
- [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 (the 维护者速读 block is the
dispatch-ordered Chinese summary).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbZMgz2QbrsLJv3RD41
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbZMgz2QbrsLJv3RD41)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ff648d7 commit 0f1045b
3 files changed
Lines changed: 178 additions & 4 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views/metadata-admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 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 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
783 | 790 | | |
784 | 791 | | |
785 | 792 | | |
| |||
833 | 840 | | |
834 | 841 | | |
835 | 842 | | |
836 | | - | |
| 843 | + | |
837 | 844 | | |
838 | 845 | | |
839 | | - | |
| 846 | + | |
840 | 847 | | |
841 | 848 | | |
842 | 849 | | |
| |||
869 | 876 | | |
870 | 877 | | |
871 | 878 | | |
| 879 | + | |
872 | 880 | | |
873 | 881 | | |
874 | 882 | | |
| |||
984 | 992 | | |
985 | 993 | | |
986 | 994 | | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
987 | 1004 | | |
988 | 1005 | | |
989 | 1006 | | |
| |||
1084 | 1101 | | |
1085 | 1102 | | |
1086 | 1103 | | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1087 | 1107 | | |
1088 | 1108 | | |
1089 | 1109 | | |
| |||
2061 | 2081 | | |
2062 | 2082 | | |
2063 | 2083 | | |
2064 | | - | |
| 2084 | + | |
2065 | 2085 | | |
2066 | 2086 | | |
2067 | 2087 | | |
| |||
2304 | 2324 | | |
2305 | 2325 | | |
2306 | 2326 | | |
2307 | | - | |
| 2327 | + | |
2308 | 2328 | | |
2309 | 2329 | | |
2310 | 2330 | | |
| |||
0 commit comments