Repository navigation
Commit d613fdc
fix(app-shell): a position created from Setup is saved live and shows in the list (#26269)
Fixes #26192
Clause-②: no
Metadata-protocol: none
## Premise (answered first, as the card asks)
Setup → Positions → New carried **no** `packageId`. Positions register
no `EditPage`, so New opens the generic `MetadataResourceEditPage`; its
save sends `mode: 'draft'` and adds a package only under `?package=`,
and Setup carries none. By the ruling's own condition ("a draft written
with none is itself the defect"), the fix is the save path, not a drafts
list.
Measured red-first on `origin/main` `df8aac41f2` with the new test
below: the create sent one PUT with `mode: "draft"` and `package: null`.
## What changes
- `ui/packages/app-shell/src/services/builtinComponents.tsx`: the
`position` resource registers `createLive: true`, the key the permission
set already carries (objectui#7611). **Where the key lives:** the
permission set's `createLive` sits in `anchors.ts`
(`registerBuiltinAnchors`, beside its object anchor), but the position
has no anchor entry there; its only registration is the
`registerMetadataResource({ type: 'position', ... })` call in
`builtinComponents.tsx`, so the key goes there. The registry merges per
type, so either home would read the same at runtime; the position's
single home keeps it in one place.
- No change to `ResourceEditPage.tsx`: its existing rule already writes
a `createLive` type live when no package binding is active, and as a
package draft under `?package=`.
- The server admits the live write: the spec's metadata-type registry
row for `position` carries `allowRuntimeCreate: true`.
Result: a position saved from Setup → Positions → New is written live
(one PUT, no `mode`, no `package`, `If-None-Match: *`), shows in the
Positions list right after Save, and its detail page reads it at once.
Under `?package=` the create stays a package draft (ADR-0086 P0/P2).
**Out of scope (stated per the claim):** later edits of an existing
position in Setup still save as drafts, the generic editor's rule for
every type. Changing that is a product choice and is not made here.
## Tests
New
`ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.positionCreateLive-26192.test.tsx`,
after the liveCreate-7611 pattern: the REAL page over a REAL
`MetadataClient`, the position's registration taken from the real
`builtinComponents` module, the transport an in-memory server recording
each PUT's `mode`, `package` and first-write pin.
- outside a package: exactly one PUT `{ name: 'regional_lead', mode:
null, packageId: null, ifNoneMatch: '*' }`, then the editor opens
`/metadata/position/regional_lead`;
- under `?package=com.acme.crm` (control): one PUT `{ mode: 'draft',
packageId: 'com.acme.crm', ifNoneMatch: '*' }`.
Readings (all under `scripts/pm/os-verify-lock.sh`, shared box):
- Red first, test commit `739f7ba6` (no fix): `Tests 1 failed | 3 passed
(4)`; the live case received `"mode": "draft"` against expected `null`.
The 7611 permission control passed in the same run.
- Green at head `41bbd17a`: the new test,
`ResourceEditPage.liveCreate-7611`,
`ResourceListPage.positionGrants-25333`,
`ResourceEditPage.permissionSetsFeed-12126`: `Test Files 4 passed (4)`,
`Tests 14 passed (14)`, VERDICT command-exit 0.
- `@object-ui/app-shell` `type-check` (both `tsconfig.json` and
`tsconfig.test.json`) at `41bbd17a`: VERDICT command-exit 0, 0 `error
TS`.
- NOT MEASURED, reason: lock queue-timeout twice behind a whole-package
app-shell run held by another worktree. The wider set of 41 app-shell
test files that load `builtinComponents` or name `position` is left to
CI (the UI test jobs).
## Gates
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `41bbd17a`: 35 derived commands, each run
with its exit captured before any pipe: 34 exit 0. `pnpm
check:type-check-debt` exit 3 = PREREQUISITE NOT MET (its closure build
never got a turn on the verify lock), NOT MEASURED, left to CI `Lint &
Repo Gates`. `--ran` reconciliation: 35 derived, 35 run, 0 UNRUN.
`scripts/sdui-manifest.*` untouched (`check-sdui-manifest` exit 0).
## Acceptance notes
- Main's Test UI may be red on the MetadataService ObjectSchema 48≠47
guards until #26231 lands; that red is not from this diff.
This PR was authored by session `session_01SMps7wq7rBTk53e8KTSEup`
(`domain:ui` seat 2 dispatch).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 697a307 commit d613fdc
3 files changed
Lines changed: 170 additions & 0 deletions
File tree
- .changeset
- ui/packages/app-shell/src
- services
- 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 | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
220 | 228 | | |
221 | 229 | | |
222 | 230 | | |
| |||
| 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 | + | |
0 commit comments