Repository navigation
Commit e08aad7
fix(console): name permission sets, master objects, audited records and condition subjects by label (#34088)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9Gz6rLAtQusAQi5SbZGeg9y)_
Part of #33864 — items 1, 2, 3 and 5 land here. Item 4 (Setup palette
record hits) stays open on the card: its title is the server search's,
not the Console's (see Acceptance notes).
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- **改了什么**:控制台四处界面改为显示标签:Studio
访问权限页的建议授权横幅、其提示与状态行用权限集标签;记录共享「由父级控制」显示父对象标签;设置 →
审计日志的「记录」列显示记录名称;流程入口条件的字段下拉显示字段标签,路径作为次要文字。
- **为什么改**:这些界面违反「给人看的地方用标签,机器名至多作次要文字」的约定(QA 扫描发现)。
- **风险与回滚**:只改显示层,不改写入或契约。审计日志每页按对象多发一次批量读取(每个对象一次
`find`,与列表网格的指针列同一读取器)。回滚即还原本 PR。
- **先看**:`AuditLogPage.tsx`(记录列改用
`RecordPointerCell`)、`StudioDesignSurface.tsx`(`suggestedSetLabel`)、`PackageOwdOverviewPanel.tsx`(`masterLabelOf`)。
- **两分钟验证**:在 showcase 以管理员打开 设置 → 审计日志,「记录」列应显示记录名称,鼠标悬停显示记录
id;记录已删除的行显示「对象 · record unavailable」。
- **需要你做的**:无,席位落地。
## What changes
Anything shown to a person names the thing by its label; the machine
name appears at most as secondary text
(`ux-conventions.labels-over-machine-names`).
1. **Studio → Access, suggested-binding strip**
(`StudioDesignSurface.tsx`, `AccessPillar`). A suggestion row carries
only `permission_set_name`. The strip lists this package's suggestions,
and those are this package's own sets, which the pillar's rail already
reads with their labels. `suggestedSetLabel` names the set by that label
in the banner, every toast (Grant, Dismiss, Revoke, Reconsider, the
not-in-force warning) and the state line a resolved row keeps. A set the
rail holds no label for is named by its machine name. No server change:
the suggestion payload is unchanged.
2. **Studio → Access → Record sharing, "By parent →"**
(`PackageOwdOverviewPanel.tsx`). `masterLabelOf` names the master object
by this package's own object as the table reads it (pending draft
included), else the served object's label, else its machine name. A
master outside the package is read by name (`readObjectsByName`, the
hook the inbox's object rows use), so the table asks for the few masters
it names, never the whole object registry; the objects-reader census
(`openPathObjectReaders-12811.test.ts`) gains its row as `byName`.
3. **Setup → Audit Log, Record column**
(`ui/apps/console/src/pages/system/AuditLogPage.tsx`).
`sys_audit_log.record_id` is the id half of a `referenceVia` pair typed
by `object_name`. The column now draws it through `RecordPointerCell`,
the batched resolver a list grid's `referenceVia` column already uses
(one `find` per object per tick, the ADR-0079 name ladder, the raw id as
the tooltip). A row with no object or record keeps the dash.
`@object-ui/plugin-grid` exports `RecordPointerCell` (and its two types)
for this; the README's export list names them. No second resolver is
written.
4. **Setup ⌘K palette record hits — not in this PR.** See Acceptance
notes.
5. **Studio flow editor → Entry condition** (`FlowNodeConfigField.tsx`).
The mount passes `labelSubjects`, the existing `ConditionBuilder` option
the Validations panel already uses: a field subject reads by its label
with its CEL spelling beside it, and `previous.FIELD` reads as "FIELD
LABEL (before the change)". The whole-record `previous` has no label and
reads as its spelling.
No new i18n keys: every string here already existed.
## Tests
One pin per item, each in the component's existing harness file as a
top-level `describe`:
- Item 1,
`StudioDesignSurface.accessSuggestionsReadOnly-33158.test.tsx`: the
banner, the Grant toast and accepted line, the Dismiss toast and
dismissed line name "CRM user"; CONTROL: a set with an empty rail label
reads `crm_user`.
- Item 2, `PackageOwdOverviewPanel.test.tsx`: a served master outside
the package reads "Customer Account"; CONTROL: an unlabelled master
reads its name.
- Item 3, `AuditLogPage.objectLabels-28968.test.tsx`: a readable record
reads "Acme Corp" with `acc_1` as the tooltip; CONTROL: an unread record
reads `nightly_widget · record unavailable`, a row with no record the
dash.
- Item 5, `FlowNodeConfigField.entryCondition.test.tsx`: `Status` /
`status`, `Contract term (months)` / `contract_term_months`, the
`previous.status` label; CONTROL: `previous` keeps its spelling.
Forced test edits (the option text now carries label + spelling, or the
master now reads by label):
- `PackageOwdOverviewPanel.test.tsx` › 'shows the master link': asserted
`/crm_account/`, now the label "Account".
- `FlowNodeConfigField.entryCondition.test.tsx`: `subjectOptions` reads
each option's spelling (the hint), and two clicks pick an option by
spelling instead of by accessible name.
- `FlowNodeInspector.entryCondition.test.tsx` › 'its subject dropdown
offers the FLATTENED vocabulary…': reads the spelling (the hint) of each
option.
- `AuditLogPage.objectLabels-28968.test.tsx`: the hoisted adapter double
now answers `crm_account`'s definition and record (the other cases in
the file are unchanged and green).
- `useObjectFields.draftOverlay-11895.test.tsx` (both cases): the wait
finds the option by the label-first accessible name the builder now
renders (`Issue summary issue_summary`, `Industry industry`), and the
assertions read each option's spelling (the hint) with exact
`toContain`, so `previous.*` cannot satisfy them. It also gains the
module-top `import '@objectstack/lint'` that `check:test-source-alias`
asks of an edited suite reaching the flow inspectors.
- `openPathObjectReaders-12811.test.ts`: one new census row,
`PackageOwdOverviewPanel.tsx` → `byName`; no other row changed.
<details><summary>Ablations — one per item, each red, each restored to
HEAD (on c034387's tree, via <code>scripts/ablation-replace.mjs</code>;
ui vitest resolves <code>@object-ui/*</code> to <code>src/</code>, so no
build leg)</summary>
| Item | Mutation (anchor → replacement) | Pin file | Result |
|---|---|---|---|
| 1 | `suggestedSetLabel` body → `s.permission_set_name` |
`StudioDesignSurface.accessSuggestionsReadOnly-33158.test.tsx` | 3
failed / 5 passed (the CONTROL stays green) |
| 2 | `{ master: masterLabelOf(row.master) }` → `{ master: row.master }`
| `PackageOwdOverviewPanel.test.tsx` | 2 failed / 9 passed |
| 3 | Record cell guard → `(false as boolean) &&` (the raw id cell) |
`AuditLogPage.objectLabels-28968.test.tsx` | 2 failed / 5 passed |
| 5 | `labelSubjects` → `labelSubjects={false}` |
`FlowNodeConfigField.entryCondition.test.tsx` | 2 failed / 39 passed
(the CONTROL stays green) |
Each leg: anchor hit x1 → x0, blob changed, then restored with blob ==
HEAD and an empty `git diff HEAD`.
</details>
## Acceptance notes
- **Item 4 left out, as the dispatch order says for a fix outside this
lane's files.** The palette titles a record hit with the server's
`searchAll` hit title when there is one (`useRecordSearch`), and the
server titles a hit with the row's `nameField` value as stored
(`renderTitle` in
`packages/metadata-protocol/src/protocol-record-reads.ts`).
`sys_record_share` declares `nameField: 'recipient_id'`, so a Record
Share hit is titled with the raw principal id. Naming it needs a server
or object-metadata change under `packages/**` (resolve a reference name
field to the referenced record's name, or declare a different title),
not `CommandPalette.tsx` and not this card's file surface. The
Notification Event (`sys_notification`, `nameField: 'topic'`) hit was
NOT MEASURED here: the declared title is `topic`, so why the QA run saw
the id needs a live repro. Both go back to the seat to split.
- **Item 1 has a second host.** The marketplace package page
(`MarketplacePackagePage.tsx`) mounts the same `SuggestedBindingsPanel`
and still names the set by machine name in its prompt and toasts. It is
not on the card. Its fix needs a label source that page does not read
today (the package's permission sets, or a label on the suggestion
payload, which is a server change). Same defect class, reported to the
seat, not fixed here.
- **Item 3 unreadable rows.** The delta asked for the id as the
fallback. The shared resolver draws "OBJECT · record unavailable" with
the id as the tooltip, its one rendering for deleted and not-visible
records. I kept the shared face rather than fork it for one page. The id
is still in the tooltip and in the drawer's "Target record" line. If the
seat wants the bare id on this page, it is a one-prop change to
`RecordPointerCell`.
- **Item 5, other mounts.** `ConditionBuilder` keeps `labelSubjects` off
by default, so the hook, action visible/disabled, page-block and widget
mounts still list spellings. They are not on the card.
- Revoke's missing toast stays with #33865, queued behind this card on
the same banner. This PR only renames the set in the toasts that already
exist.
## Verification
The details below are on `c0343878`, in this card's container.
`319ae3fc` only changes the changeset's `Clause-②:` line to `yes
(widening)` (`@object-ui/plugin-grid` is published, and its entry now
exports `RecordPointerCell` and two types); `pnpm check:changeset-fixed`
re-ran on it, exit 0.
On the head `5f4c47f5` (the CI round: the census row with the by-name
read, and the draft-overlay pin): `os-verify-lock.sh -c 'cd ui && pnpm
exec vitest run --maxWorkers=3
packages/app-shell/src/views/metadata-admin
packages/app-shell/src/console/__tests__
packages/app-shell/src/views/studio-design'`: `Test Files 1153 passed
(1153)`, `Tests 11138 passed | 1 skipped (11139)`, `VERDICT command-exit
0`. `pnpm check:test-source-alias` exit 0; `tsc --noEmit` on app-shell
exit 0; `eslint` on the two touched sources 0 errors.
<details><summary>Tests — 85 files around the four surfaces: 865
passed</summary>
`os-verify-lock.sh -c 'cd ui && pnpm exec vitest run --maxWorkers=2
FILES'` over every `StudioDesignSurface.access*`,
`PackageOwdOverviewPanel*`, `FlowNode*`, `ConditionBuilder*`,
`FlowCanvas*`, `flowSingleBrace-12329`, `flow-node-producers.label`,
`SuggestedBindingsPanel`, `AuditLogPage*` test file and plugin-grid's
pointer and `referenceVia` suites: `Test Files 85 passed (85)`, `Tests
865 passed (865)`, `VERDICT command-exit 0`. The whole app-shell suite
is CI's (Test UI); this narrowing is declared.
</details>
<details><summary>Type-check — app-shell, plugin-grid, console: exit
0</summary>
`pnpm --filter @object-ui/app-shell type-check`,
`@object-ui/plugin-grid`, `@object-ui/console`, each under the lock
after `turbo run build --filter='@object-ui/console^...'` (74/74 tasks):
`VERDICT command-exit 0` three times. `pnpm check:type-check-debt`: exit
0, no entry above its number.
</details>
<details><summary>Derived gates — 37 derived, 37 run, 0 NOT-MEASURED, 0
UNRUN</summary>
`node scripts/pm/dispatch-gates.mjs --commands` (no paths) derived 37
families; every one exited 0, including `pnpm --dir ui exec vitest run
scripts/` (171 files passed, 2 skipped) and `pnpm
check:test-source-alias` (its first round flagged the two edited flow
entry-condition suites; both now load `@objectstack/lint` at module
top). `--ran` reconciliation: `37 derived famil(ies) accounted for — 37
run, 0 NOT-MEASURED`. Run beyond the derivation, both exit 0: `pnpm
check:published-readme-exports` (the README's export list names the new
export), `pnpm check:changeset-fixed`. Also: `pnpm
check:new-line-citations` 0 new; `eslint` on the touched files 0 errors.
Repo-wide lint and the rest of the farm are CI's.
</details>
Dogfood battery: not owed (no `!` in the title, no narrowing arm).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ)_
<!-- signed: domain:ui#1 · os-steve · session_01ADHkmSBi2p2cTsYqd7ScSZ
-->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 499266d commit e08aad7
14 files changed
Lines changed: 346 additions & 26 deletions
File tree
- .changeset
- ui
- apps/console/src/pages/system
- packages
- app-shell/src
- console/__tests__
- views
- metadata-admin
- inspectors
- previews
- studio-design
- plugin-grid
- src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
167 | 176 | | |
168 | 177 | | |
169 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
719 | 720 | | |
720 | 721 | | |
721 | 722 | | |
722 | | - | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
723 | 737 | | |
724 | 738 | | |
725 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
280 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
281 | 295 | | |
282 | 296 | | |
283 | 297 | | |
284 | 298 | | |
285 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
286 | 307 | | |
287 | 308 | | |
288 | 309 | | |
| |||
348 | 369 | | |
349 | 370 | | |
350 | 371 | | |
351 | | - | |
| 372 | + | |
352 | 373 | | |
353 | 374 | | |
354 | 375 | | |
355 | 376 | | |
356 | 377 | | |
357 | 378 | | |
358 | | - | |
| 379 | + | |
359 | 380 | | |
360 | 381 | | |
361 | 382 | | |
| |||
372 | 393 | | |
373 | 394 | | |
374 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
375 | 432 | | |
376 | 433 | | |
377 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
733 | 736 | | |
734 | 737 | | |
735 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
193 | | - | |
194 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
195 | 208 | | |
196 | 209 | | |
197 | 210 | | |
| |||
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
206 | | - | |
207 | | - | |
| 219 | + | |
| 220 | + | |
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
211 | 224 | | |
212 | 225 | | |
213 | | - | |
| 226 | + | |
214 | 227 | | |
215 | 228 | | |
216 | 229 | | |
217 | 230 | | |
218 | 231 | | |
219 | 232 | | |
220 | 233 | | |
221 | | - | |
| 234 | + | |
222 | 235 | | |
223 | 236 | | |
224 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
160 | 210 | | |
161 | 211 | | |
162 | 212 | | |
| |||
0 commit comments