Repository navigation
Commit 6d86b43
fix(studio): offer Customize only on a list view the read-only base ships (#35620)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuRBPAufqjfhippCo9VshjZw)_
Fixes #35600
repo:objectstack#1 · os-sales · session_01L6bhgWTpQUNTBdBhmJtCzk
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- 在 Studio
里打开只读软件包的对象页面时,在应用中新建的列表视图不再出现「定制」按钮,属性面板改为说明它是本部署自建的视图、应在应用的「管理视图」里编辑;安装包自带的视图照旧可以定制。
- 替中文客户解决「控制台新建的视图到 Studio 定制、加一列后保存报 403」的问题,这是「视图按岗位分配」那张需求卡里拆出来的第二项。
- 万一判断有误,管理员只会在 Studio 里看不到某个视图的「定制」按钮,视图只读、不写入任何数据;直接撤回本改动即可恢复原状。
- 无
## What changes
On a read-only base, an `object` leaf's page in Studio lists every list
view of the object: the base's, views created in the app (the console's
New view, a package-less row), and views the pair adds. Customize
declares an override of the BASE's view (ADR-0146 D2), and the server
refuses that declaration for a view the base does not ship
(`NOT_OVERRIDABLE`, 403, "declares an override of …, which ships no view
named …"). Studio offered Customize on every listed view, so the first
saved edit of a console-made view answered 403.
- `useServedOverride` (StudioCustomizeControls.tsx) already reads the
layered read at the base for the item. It now also reports what that
read served (`shipped`): `base` (a code layer: the base ships the item),
`environment` (no code layer, a row stored in this environment: an item
no package ships, ADR-0146 D11 environment metadata), `none`, or `null`
(not read, or failed). No new request.
- The object page's list-view gate (StudioDesignSurface.tsx,
`listViewCustomizable`) offers Customize only when the pair already
declares an override of the view or the base ships it. Otherwise the
view stays read-only and nothing is written.
- The list-view panel (ObjectListViewInspector.tsx) takes a
`readOnlyNote` in place of the package-read-only sentence: for an
`environment` view it says the view was created in this deployment and
is edited in the app (Manage views, then the view's menu, Edit view
config — measured in the console); for `none` it says the base does not
ship the view.
- Two new Studio strings, en and zh
(`engine.studio.inspector.listView.environmentView`, `…notShipped`).
Route taken: the card's second arm ("does not offer Customize on it and
says where it is edited"). The first arm (edit in place at the
package-less address) was measured and not taken: the server's
package-less draft door admits the write (200, env-wide draft), but
Studio's Publish on a read-only base publishes the pair's drafts, so
such a draft would sit unpublishable from Studio, and ADR-0146 records
"No package-less authoring destination survives". The server refusal is
unchanged.
Branch: `claude/project-thread-5bri48` is harness-assigned (the repo
convention would be `claude/issue-35600-…`); noted for the Duplicate Fix
Guard.
## Tests
New
`ui/packages/app-shell/src/views/studio-design/InterfacesPillar.customizePackagelessView-35600.test.tsx`,
through the mounted pillar, the real header controls and the real
ensure-door client; the metadata double's layered read answers as the
server measured for each kind of row, and its draft door refuses an
override of a view the base does not ship (403 `NOT_OVERRIDABLE`):
- a view created in the app: no Customize, nothing asked or sent, the
panel note carries reason `environment` and its sentence;
- a view nothing at the base serves (a pair-added view): no Customize,
nothing sent, reason `none`;
- CONTROL: the base's own view is customized into the pair with
`overrides: { package, basedOn }`, and the save is not refused.
<details><summary>Test and typecheck readings (head 229fe86)</summary>
- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/views/studio-design/InterfacesPillar.customizePackagelessView-35600.test.tsx
packages/i18n/` → Test Files 105 passed (105), Tests 1959 passed, 13
skipped (at 229fe86)
- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/views/studio-design/` → Test Files 350 passed
(350), Tests 2727 passed (2727) (at e0ccaad; the later commits are the
changeset and one module-top import in the new test file)
- `pnpm --filter @object-ui/i18n run type-check && pnpm --filter
@object-ui/app-shell run type-check` → VERDICT command-exit 0; `tsc -p
tsconfig.test.json --listFilesOnly` lists the new test file (1 hit)
- Ablation (committed fix, `scripts/ablation-replace.mjs`, source
imported directly so no dist build): gate replaced by `listViewAsked;`
(anchor 1 → 0, blob 0d83f69 → d407def9) → the `environment` case went
red (1 failed, 2 passed); restored blob == HEAD, `git diff HEAD` empty.
The `none` case and the CONTROL stay green under the ablation: the
pair-added view has no row read at the base, so its header offers no
Customize either way; that case pins the note.
</details>
## Acceptance notes
- Measured on a running server (examples/app-crm, booted code package
`com.example.crm` as the read-only base): the console's New view sends
`PUT /api/v1/meta/view/NAME?mode=draft` with no package; the published
view is served with no `_packageId`; `?package=com.example.crm` lists it
not; the object's merged `listViews` in the console carry no
`_packageId` (the entry is the flattened config), so they cannot answer
the question. The layered read at the base answers it: code layer for
the base's views (also when the pair overrides them), `code: null` plus
the environment row for the console-made view, 404 for a pair-added view
and for a default view the base does not ship.
- The same 403 path held for two more views on the object page, and the
same predicate covers them: a default view the base does not ship
(Customize on it would declare an override of nothing) and a view the
pair adds (its own item, which the rail's "Form and list views" entry
opens and saves in the pair). On the object page both are now read-only
with the `none` note. Whether the object page should edit a pair-added
view in the pair (no declaration): the seat answered A, it stays
read-only on the object page and the rail entry edits it.
- Re-declared (claim correction on #35600, seat-directed): the two new
strings widen the published `@object-ui/i18n` key set, so this PR is
`Clause-②: yes (widening)`; the claim's file surface adds
`ui/packages/i18n/src/namespaces/studio/{en,zh}.ts`. The changeset is
`patch` (`Metadata-protocol: none`).
- Not a regression: a default list view the read-only base does not ship
(the synthesized all-records view) can no longer be customized from the
object page; before this PR its first save answered the same 403, and
making one would be a new pair item, a product choice not taken here.
- Observation, filed as #35624 (measure first): right after the
console's New view, the console's draft preview bar read "no unpublished
changes" while the drafts feed listed the new package-less draft; read
once, not reproduced.
## Verification
- Read first: StudioDesignSurface.tsx `listViewCustomizable` /
`listViewNotShipped` (the gate; risk: a base view the layered read fails
to serve loses Customize, read-only, nothing written);
StudioCustomizeControls.tsx `useServedOverride` (`shipped` from the same
read; the leaf, navigation and page callers ignore it); the new test
file.
- Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/InterfacesPillar.customizePackagelessView-35600.test.tsx`
→ 3 passed.
- Browser, before and after (examples/app-crm, console Vite dev server
on this branch): before, Studio offered Customize on "Verified domestic
accounts" (created through the console's Add new view) and adding a
column answered `PUT …?package=com.example.crm.custom` 403
`NOT_OVERRIDABLE`; after, no Customize, the panel says where the view is
edited; CONTROL "All Opportunities" (the base's) still customizes, `PUT
…?package=com.example.crm.custom` 200.
<details><summary>Local gates (the --commands derivation for this diff,
plus check:changeset-fixed)</summary>
Every command below exited 0, at 8157dc1 (`check:test-source-alias`
first exited 1 on the new test file, which then took the module-top
`import '@objectstack/lint'` it prescribes, and re-ran exit 0):
check-adr-0087-registration (base, self-test), check-changeset-no-major,
check-closing-keyword-parity (scan, self-test),
check-comment-mask-corpus, check-empty-changeset (base, self-test),
check-sdui-manifest (scan, self-test), snapshot-next self-test,
check-governed-queue-guard self-test, release-rehearsal-clone self-test,
release-pending-publish self-test, spec check:duration-unit-keys,
check:adr-anchors, check:changeset-gate-self-tests,
check:closed-ceremony-text, check:cross-package-test-inputs,
check:dispatcher-error-vocabulary, check:driver-memory-census,
check:engine-double-contract, check:gitlink-declared, check:nul-bytes,
check:published-files, check:query-options-erasure,
check:refd-timer-probe, check:registry-log-declared,
check:rest-log-spy-declared, check:skill-identifier-liveness,
check:test-source-alias, check:tier-file-adoption,
check:type-check-coverage, check:type-check-debt,
check:undeclared-dep-imports, check:watch-hint-literal,
check:where-matcher, check:changeset-fixed; and `pnpm --dir ui exec
vitest run --maxWorkers=2 scripts/` → Test Files 171 passed, 2 skipped
(173). `overlap-check.mjs` → VERDICT clean exit 0 (origin/main and the
one open PR sharing StudioDesignSurface.tsx merge cleanly). The
type-check lanes and the wide-population families are CI's.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgWTpQUNTBdBhmJtCzk
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgWTpQUNTBdBhmJtCzk -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3ce6b65 commit 6d86b43
7 files changed
Lines changed: 417 additions & 8 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views/studio-design
- i18n/src/namespaces/studio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 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 | + | |
| 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 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1277 | 1277 | | |
1278 | 1278 | | |
1279 | 1279 | | |
| 1280 | + | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | 1283 | | |
1283 | 1284 | | |
1284 | 1285 | | |
1285 | 1286 | | |
1286 | 1287 | | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
1287 | 1294 | | |
1288 | 1295 | | |
1289 | 1296 | | |
| |||
1440 | 1447 | | |
1441 | 1448 | | |
1442 | 1449 | | |
1443 | | - | |
1444 | | - | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1445 | 1456 | | |
1446 | 1457 | | |
1447 | 1458 | | |
| |||
0 commit comments