Repository navigation
Commit 198da49
fix(app-shell): the permission set's Add user picker shows each person's email beside their name (#27808)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgDFH4S5pR1C8YvYCWWsZfXx)_
## 维护者速读
- 改了什么:设置 › 权限集 › 已分配用户 › 添加用户 的选人框,原来只有姓名一列,现在多一列邮箱。
- 为什么改:同名的两个人在选人框里分不出来,授予权限集前也没法确认账号;同页已分配的列表本来就显示邮箱。
- 风险与回滚:只改选人框的列与表头,授予写法、成员过滤、AI 席位上限提示都不变;回滚即 revert 本 PR。
- 先看:`AssignedUsersSection.tsx` 里 `RecordPickerDialog` 新增的
`objectSchema` 与 `columns` 两个属性;新测试
`AssignedUsersSection.pickerColumns-27433.test.tsx`。
- 两分钟验证:打开任一权限集 › 已分配用户 › 添加用户,预期选人框出现「姓名」「邮箱」两列;无权读 `sys_user.email`
的角色只看到姓名列。
- 需要你做的:无,席位落地。
Fixes #27433
Clause-②: no
Metadata-protocol: none
## What changes
On a Setup permission-set page, **Assigned users › Add user** opened
`RecordPickerDialog` on `sys_user` with no `columns`, so the picker drew
the name alone. It now passes, in the same shape as Position › Add
holder (#27427):
- `columns` for `name` and `email`, headed from the section's own en/zh
copy (`Name`/`Email`, `姓名`/`邮箱`) — no new `@object-ui/i18n` key, so
`Clause-②: no`;
- `objectSchema` set to `sys_user` from the `useMetadata()` objects the
section already holds — no new fetch;
- no permission check of its own: the picker's own `readableColumns`
rule decides what is drawn.
Files:
`ui/packages/app-shell/src/views/metadata-admin/AssignedUsersSection.tsx`,
one new test beside it,
`.changeset/27433-permission-set-user-picker-email.md`
(`@object-ui/app-shell` + `@object-ui/console` patch, as #27427's).
## Tests
`AssignedUsersSection.pickerColumns-27433.test.tsx`, against the real
`RecordPickerDialog` (not a stub) and a real `PermissionProvider`:
- the picker draws a Name column and an Email column (cells read by
`data-lookup-cell`);
- CONTROL: the picker offers the active organization's members only (a
`sys_user` in another organization is not drawn);
- CONTROL: choosing a person still writes `sys_user_permission_set` `{
user_id, permission_set }` by name;
- CONTROL: an AI-seat cap refusal from the grant write still shows
inline;
- CONTROL: under a policy that denies `sys_user.email` (grant writes
allowed), only the name column is drawn and no email text appears in the
dialog.
Ablation (one-shot, not kept): `scripts/ablation-replace.mjs` deleted
the `columns` prop (anchor 1 → 0, blob `6e003bf1` → `495a0d0e`) → the
column test went red (1 failed / 4 passed), the four CONTROLs stayed
green; restored to blob == HEAD, `git diff HEAD` empty. The later commit
`3b0005b0` only changes the schema cast's type.
## Acceptance notes
- Every acceptance line of #27433 is pinned by a test above.
- The seat-cap test asserts the inline sentence by a regex on its
leading words only (the card names the inline refusal as the CONTROL;
the copy is the section's own).
- No out-of-scope findings.
## Verification
All on head `3b0005b0` (base `968cacfd`), locally:
<details><summary>Tests</summary>
- `pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/AssignedUsersSection.pickerColumns-27433.test.tsx`
— Test Files 1 passed, Tests 5 passed (verify lock VERDICT command-exit
0).
- Every test file naming `AssignedUsersSection` (44 files: the section's
own six, the PermissionMatrixEditor family, `setupHoldersGrant-12082`,
`trailDoorsGate-12475`, `openPathObjectReaders-12811`,
`affordanceGrantMap-12082` and others) — Test Files 44 passed, Tests 332
passed (VERDICT command-exit 0).
- `pnpm --filter @object-ui/app-shell run type-check` — VERDICT
command-exit 0.
- Ablation as above: deleting `columns` → 1 failed / 4 passed; restored,
`git diff HEAD` empty.
</details>
<details><summary>Derived gates (34)</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`, each run with its exit code recorded before
any pipe; reconciled with `--ran`: 34 derived, 34 run, 0 NOT-MEASURED, 0
UNRUN.
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
```
</details>
`origin/main` moved 13 commits since the base; none touches the three
changed files or `RecordPickerDialog`, so the branch is not merged with
it (no overlap). Every CI family (Test UI, Type Check UI, Lint & Repo
Gates, …) is the PR's own check-runs.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CazvDXxebLfghuZZ7t)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 07585bf commit 198da49
3 files changed
Lines changed: 206 additions & 0 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 | + | |
| 13 | + | |
| 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 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| 173 | + | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| |||
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
225 | 241 | | |
226 | 242 | | |
227 | 243 | | |
| |||
321 | 337 | | |
322 | 338 | | |
323 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
324 | 343 | | |
325 | 344 | | |
326 | 345 | | |
| |||
615 | 634 | | |
616 | 635 | | |
617 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
618 | 642 | | |
619 | 643 | | |
620 | 644 | | |
| |||
0 commit comments