This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 5698ec7
fix(app-shell): show a position's label in a permission set's Assigned users (objectui#13477) (#13493)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D2bmCsjnmZkrozUjaCZ8Xgr)_
- [x] Adds no product-specific widget, dialog, hook or string (see
AGENTS.md › Product-neutral renderer)
Fixes #13477
Clause-②: no
Metadata-protocol: none
## What changed
`AssignedUsersSection` (a permission set's Assigned users list) drew
each "via position" chip from the holder's `sys_user_position.position`,
the position's machine name, through `c.viaPosition(v.position)`. The
same `load` already lists the registry's position definitions through
`ensureType('position')` to find the positions that distribute the set,
and that list carries each definition's `label` as `/meta/position`
serves it in the caller's language (objectstack#25701).
- A module-private `positionLabels(positions)` reads `name` to `label`
from that one list (a blank or non-string label is skipped).
- Each position entry of a row's `via` now carries `label` beside
`position`.
- The chip text is `c.viaPosition(label ?? name)`, and the chip's
`title` is the machine name whenever the text is not the name, the same
rule `CitedItemChip` in `AccessExplainPanel` applies. With no label the
chip reads by its name and has no `title`, as before.
- No new read: the label comes from the list the section already
fetched.
- `.changeset/13477-assigned-users-position-label.md`:
`@object-ui/app-shell` patch.
Files:
`packages/app-shell/src/views/metadata-admin/AssignedUsersSection.tsx`,
its existing test `AssignedUsersSection.test.tsx` (the fixture's
`contributor` definition has the label `Contributor`, so the chip
assertion now reads `via position Contributor`), the new pin
`AssignedUsersSection.positionLabel-13477.test.tsx`, and the changeset.
## Tests
The new pin mounts the real `AssignedUsersSection` inside the real
`MetadataProvider`, over a real `ObjectStackAdapter` whose `fetch` is
the only stub, so the label reaches the chip through the store's own
`GET /api/v1/meta/position`:
- `shows the label from /meta/position, with the machine name on title`:
chip `via position Sales Manager`, `title="sales_manager"`, and no `via
position sales_manager`.
- `a definition with no label reads by its name, with no title`: chip
`via position field_rep` with no `title`, beside the labelled one.
Readings, taken locally on the branch head:
- `pnpm exec vitest run
packages/app-shell/src/views/metadata-admin/AssignedUsersSection`: Test
Files 5 passed (5), Tests 29 passed (29).
- Nearby: the same plus `PositionHoldersSection` and
`AccessExplainPanel` prefixes: Test Files 14 passed (14), Tests 84
passed (84).
- Reverse check (fix committed, then only `AssignedUsersSection.tsx` put
back to the base commit): both new tests and the updated chip assertion
in `AssignedUsersSection.test.tsx` fail (3 failed, 11 passed across the
two files); with the fix restored they pass.
- `pnpm --filter @object-ui/app-shell type-check` (both `tsc --noEmit`
and `tsc -p tsconfig.test.json`): exit 0.
- `pnpm exec eslint` on the three touched source/test files: 0 errors,
15 warnings. Each warning is a rule on a line this branch did not write
(`no-explicit-any`, `react-hooks/refs`,
`react-hooks/set-state-in-effect`, and `only-export-components` on the
existing `positionsDistributing` export). The new helper stays
unexported so it adds none.
- `node scripts/check-changeset-presence.mjs`: pass, 1 changeset
declared for the 1 released package.
- `pnpm check:new-line-citations`: 0 new citations.
## Acceptance notes
The sweep looked for any other site that draws a raw position or
permission-set machine name from a payload other than the
`/meta/position` or `/meta/permission` list. The brief allowed a fix in
the same diff only where the fix is the same one-line label lookup from
a list that component already loads. None of the sites below qualified,
so this diff touches none of them.
Already labelled, nothing to do:
- `PositionHoldersSection` (a position's holders) lists people only. It
draws no position or permission-set name.
- Approver `type: 'position'` (the `decision_output_defs` entry in
`apps/console/src/services/approvalsApi.ts`): the decide dialog's picker
is built by `registryOptions` in `decisionOutputParams.ts` from
`ensureType('position')`, using `label` and falling back to the name.
Approver display goes through `useApproverDirectory`, whose registry leg
labels `position:` references from the same store read.
- `AccessExplainPanel` Principal card and "Contributed by" chips already
label through `CitedItemChip`.
Raw names that remain, each needing more than a one-line lookup (none of
these components loads the list):
- Sharing-rule `sharedWith`: the catalog's "Shared with" list column
(the `render` on the `sharedWith` column in `anchors.ts`) and the
summary row in `SharingRuleCloneDialog` both print `TYPE: VALUE`, e.g.
`position: sales_manager`. Neither loads `/meta/position`, and the
recipient type itself is a raw token.
- `PositionGrantCells` (the position list's "Permission sets" column)
draws `_grantedPermissionSets[].name` from the list's served
`listInclude` column. The component loads no `/meta/permission` list.
- `PositionPreview` lists the draft definition's `permissionSets` as
code-formatted machine names. It loads no permission list.
- Suggested bindings (`SuggestedBindingsPanel`, its Studio copy in
`StudioDesignSurface`, and `MarketplacePackagePage` toasts) interpolate
the suggestion payload's `permission_set_name` into their sentences.
None of them loads `/meta/permission`.
Locale of the metadata store's reads: `MetadataProvider.ensureType`
reads through `adapter.getClient().meta.getItems(type)`. The console's
adapter is built in `AdapterProvider` with `createAuthenticatedFetch()`,
which sets `Accept-Language` from `document.documentElement.lang` on
every API call that does not already carry one. `ConnectedShellInner`
keys `MetadataProvider` on the UI language (`key={language}`) and clears
the adapter cache on a switch, so `/meta/position` and
`/meta/permission` are read again in the new language. Nothing on this
branch re-checks that wiring; it was read from the source and the new
pin does not assert the header.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01XWGTsmqrtrt1Zqh1ioWqsT
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d0c9650 commit 5698ec7
4 files changed
Lines changed: 170 additions & 12 deletions
File tree
- .changeset
- 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 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
235 | 239 | | |
236 | 240 | | |
237 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
238 | 258 | | |
239 | 259 | | |
240 | 260 | | |
| |||
315 | 335 | | |
316 | 336 | | |
317 | 337 | | |
| 338 | + | |
318 | 339 | | |
319 | 340 | | |
320 | 341 | | |
| 342 | + | |
321 | 343 | | |
322 | 344 | | |
323 | 345 | | |
| |||
345 | 367 | | |
346 | 368 | | |
347 | 369 | | |
348 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
349 | 375 | | |
350 | 376 | | |
351 | 377 | | |
| |||
535 | 561 | | |
536 | 562 | | |
537 | 563 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
546 | 578 | | |
547 | 579 | | |
548 | 580 | | |
| |||
0 commit comments