Repository navigation
Commit e24d4eb
fix(setup): permission set field rows leave out the platform's bookkeeping columns (#27439)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8611re6sGxojaV3xm86DkjY)_
Fixes #27404
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Setup
权限集展开对象后的字段行,不再列出平台记账列(`__search`、`organization_id`、`owning_business_unit_id`),判据沿用
Studio 数据栏的 `isStudioHiddenSystemField`(system 且 hidden)。
- 为什么改:原来字段行列出合并定义里的全部字段并按名排序,“Search Index (`__search`)”
排在第一,管理员看到的是平台内部列而不是对象自己的字段。
- 风险与回滚:只改显示与批量按钮的作用范围,保存写法不变;已存有条目的记账列照旧显示;回滚即还原
`PermissionMatrixEditor.tsx` 一个文件。
- 先看:`PermissionMatrixEditor.tsx` 里 `FieldsSubTable` 的 `offered` 过滤;同文件
`ensureFields` 带上
system/hidden;`PermissionMatrixEditor.systemFields-27404.test.tsx`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.systemFields-27404.test.tsx`,预期
5 passed。
- 需要你做的:无,席位落地。
## What changes
- `FieldSummary` keeps the served definition's `system` and `hidden`
marks; `ensureFields` reads them as booleans (`=== true`, the spec
declares both `z.boolean()`).
- `FieldsSubTable` draws the **offered** rows: every field except one
`isStudioHiddenSystemField` holds for, imported from
`views/studio-design/studioHiddenSystemField.ts` (untouched). No second
predicate, no name list.
- A bookkeeping column the set already carries an entry for still draws
as written: an entry in the draft, or in the last loaded/saved set
(`baselineFieldKeys`, set where the dirty baseline is re-anchored). So a
Clear on such a row keeps the row on screen until that save lands.
- The count, the filter threshold, the empty state and the three bulk
shortcuts read the offered rows, so Read-only all / Write all / Clear
never write an entry for a column the admin cannot see.
- The row-condition editor's `fieldNames` stays the full field list, so
a `when` naming a left-out column is not linted as unknown.
`loadObjectFields` (the RLS CEL editor) is untouched: it feeds lint and
autocomplete only and offers no picker.
## Why
The ruling on the card: the platform's bookkeeping columns are the
fields where `system` AND `hidden` hold together
(`isStudioHiddenSystemField`, objectui#11780); they are dropped from
offered field lists, and a value already stored against one still draws
as written (objectui#13152 CONTROL). This editor was the one field list
that did not apply it.
## Tests
New `PermissionMatrixEditor.systemFields-27404.test.tsx` (package door,
served definition with `__search` and `organization_id` marked system +
hidden, `owner_id` system only, `internal_notes` hidden only):
- `__search` and `organization_id` are not offered; the count reads `4 /
4`.
- CONTROL: the author-hidden field and the system `owner_id` still draw,
rows in name order.
- CONTROL: a stored `__search` entry draws as written (Read off, a rule,
not inherited).
- CONTROL: Clear on that stored row keeps it until the autosave lands;
the saved body has no `__search` entry, after which the column is no
longer offered.
- Read-only all writes entries for the four offered fields only.
Ablation (fix committed first, `scripts/ablation-replace.mjs` on the
predicate term of the `offered` filter, replaced by `true ||`): anchor 1
→ 0, all 5 tests red, restore verified blob == HEAD and `git diff HEAD`
empty. The three CONTROL cases go red too, because each pins the exact
row list, which the ablation widens.
## Acceptance notes
- Once a save drops the last stored entry for a bookkeeping column, the
row leaves the list (on the package door, at autosave). That is the
ruling read literally: nothing is stored any more, so nothing is drawn
as written.
- The predicate is imported from `studio-design/`, as
`FlowReferenceField` in this same `metadata-admin/` tree already does.
- os-dev exception: the PR template's headings are folded into the
os-dev section order.
## Verification
<details><summary>Local gates on the final head</summary>
Head `59c93806` (origin/main c5d4634 merged in), derived by `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`; `--ran` reconciliation: 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
pnpm --filter @object-ui/app-shell run type-check :: exit 0
pnpm --dir ui exec eslint (both touched files) :: exit 0 (0 errors)
pnpm --dir ui run check:new-line-citations :: exit 0 (0 new citations)
pnpm --dir ui exec vitest run (52 files naming PermissionMatrixEdit) :: exit 0 (Test Files 52 passed, Tests 362 passed)
```
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(no spec change)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (eslint on both touched
files: 0 errors)
- [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. (not touched)
- [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 os-dev Chinese summary)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbWHPvxeSBbvjBYKZ8x)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7af2145 commit e24d4eb
3 files changed
Lines changed: 219 additions & 6 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
334 | 342 | | |
335 | 343 | | |
336 | 344 | | |
| |||
751 | 759 | | |
752 | 760 | | |
753 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
754 | 766 | | |
755 | 767 | | |
756 | 768 | | |
757 | 769 | | |
758 | 770 | | |
759 | 771 | | |
760 | 772 | | |
| 773 | + | |
761 | 774 | | |
762 | 775 | | |
763 | 776 | | |
| |||
1028 | 1041 | | |
1029 | 1042 | | |
1030 | 1043 | | |
1031 | | - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1032 | 1050 | | |
1033 | 1051 | | |
1034 | 1052 | | |
1035 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
1036 | 1056 | | |
1037 | 1057 | | |
1038 | 1058 | | |
| |||
2192 | 2212 | | |
2193 | 2213 | | |
2194 | 2214 | | |
| 2215 | + | |
2195 | 2216 | | |
2196 | 2217 | | |
2197 | 2218 | | |
| |||
2382 | 2403 | | |
2383 | 2404 | | |
2384 | 2405 | | |
| 2406 | + | |
2385 | 2407 | | |
2386 | 2408 | | |
2387 | 2409 | | |
| |||
2440 | 2462 | | |
2441 | 2463 | | |
2442 | 2464 | | |
| 2465 | + | |
| 2466 | + | |
2443 | 2467 | | |
2444 | 2468 | | |
2445 | 2469 | | |
| |||
2464 | 2488 | | |
2465 | 2489 | | |
2466 | 2490 | | |
| 2491 | + | |
2467 | 2492 | | |
2468 | 2493 | | |
2469 | 2494 | | |
| |||
2654 | 2679 | | |
2655 | 2680 | | |
2656 | 2681 | | |
| 2682 | + | |
2657 | 2683 | | |
2658 | 2684 | | |
2659 | 2685 | | |
| |||
2762 | 2788 | | |
2763 | 2789 | | |
2764 | 2790 | | |
| 2791 | + | |
2765 | 2792 | | |
2766 | 2793 | | |
2767 | 2794 | | |
| |||
2814 | 2841 | | |
2815 | 2842 | | |
2816 | 2843 | | |
| 2844 | + | |
2817 | 2845 | | |
2818 | 2846 | | |
2819 | 2847 | | |
| |||
2840 | 2868 | | |
2841 | 2869 | | |
2842 | 2870 | | |
| 2871 | + | |
2843 | 2872 | | |
2844 | 2873 | | |
2845 | 2874 | | |
| |||
2860 | 2889 | | |
2861 | 2890 | | |
2862 | 2891 | | |
| 2892 | + | |
2863 | 2893 | | |
2864 | 2894 | | |
2865 | 2895 | | |
| |||
3013 | 3043 | | |
3014 | 3044 | | |
3015 | 3045 | | |
| 3046 | + | |
3016 | 3047 | | |
3017 | 3048 | | |
3018 | 3049 | | |
| |||
3138 | 3169 | | |
3139 | 3170 | | |
3140 | 3171 | | |
| 3172 | + | |
3141 | 3173 | | |
3142 | 3174 | | |
3143 | 3175 | | |
| |||
3150 | 3182 | | |
3151 | 3183 | | |
3152 | 3184 | | |
| 3185 | + | |
| 3186 | + | |
3153 | 3187 | | |
3154 | 3188 | | |
3155 | 3189 | | |
| |||
3179 | 3213 | | |
3180 | 3214 | | |
3181 | 3215 | | |
3182 | | - | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
3183 | 3230 | | |
3184 | 3231 | | |
3185 | 3232 | | |
3186 | 3233 | | |
3187 | | - | |
3188 | | - | |
| 3234 | + | |
| 3235 | + | |
3189 | 3236 | | |
3190 | 3237 | | |
3191 | 3238 | | |
| |||
3196 | 3243 | | |
3197 | 3244 | | |
3198 | 3245 | | |
3199 | | - | |
| 3246 | + | |
3200 | 3247 | | |
3201 | 3248 | | |
3202 | 3249 | | |
| |||
3209 | 3256 | | |
3210 | 3257 | | |
3211 | 3258 | | |
3212 | | - | |
| 3259 | + | |
3213 | 3260 | | |
3214 | 3261 | | |
3215 | 3262 | | |
| |||
3341 | 3388 | | |
3342 | 3389 | | |
3343 | 3390 | | |
| 3391 | + | |
| 3392 | + | |
3344 | 3393 | | |
3345 | 3394 | | |
3346 | 3395 | | |
| |||
0 commit comments