Repository navigation
feat(app-shell): metadata list 修改时间 column and unpublished-changes mark (objectstack#36898) - #36983
Conversation
…k (objectstack#36898) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
… (objectstack#36898) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
…ient (objectstack#36898) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — REWORK · repo:objectstack#3 · head 3671d23 · 2026-11-24T13:52ZL1: REWORK Read
Checklist
FindingsNo must-fix.
Delta read owed: L1 on the new head plus a |
…aListAnswer.changedAt member (objectstack#36898) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 2cd7485 · 2026-11-24T14:16Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract reviewServed-tier: This is the declaration face. The review is owed by the Inputs read:
Nothing was built, run or re-run. ① Derived judgments
② Semver level
③ Boundary flags
F1 has no effect on correctness or the contract, so this is the final round. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — ACCEPT · repo:objectstack#3 · head 2cd7485 · 2026-11-24T14:18ZL1: ACCEPT Delta read
Findings
No must-fix and no should-fix remain open. ux-E2 can land it. It conflicts by design with #36978 (#36897) in |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x Landing: 2026-11-24T14:20Z · head 2cd7485 · delta L1 ACCEPT 7134181690 · TIER_DEFAULT L2 PASS 7134164920 (S1, S2 closed; nit F1 and N1–N5 stay in the review records)
State: ready + auto-merge via the relay; on MERGED, #36898 closes by |
… base lands in its .custom pair (objectstack-ai#36978) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB2BRcLs2zJH6mZWG94VVuew)_ Fixes objectstack-ai#36897 Part of objectstack-ai#36890 Clause-②: yes (widening) Metadata-protocol: none The widening: `ObjectGridComponentProps`, exported from `@object-ui/plugin-grid`'s entry, gains two optional members, `hostCells` and `rowTint`. Nothing existing is narrowed, and no metadata an author writes changes. ## 维护者速读 - 用户能看到什么变化:设置和工作室「全部元数据」里每种元数据的列表都换成同一张表格(排序、分页跟着地址走,「修改时间」列也在其中);在只读的安装应用(如 HotCRM)上点「新建」,对象和流程会建到它配套的定制包里。 - 为什么做:这是「工作室统一列表」专题的列表一侧,让所有类型的列表长一个样,并让只读应用也能直接新建定制内容。 - 出错会怎样:管理员可能看到列表排序或分页不对、或在只读应用上新建失败并看到原因;改动只在界面层,撤回本次合并即可恢复原表格。 - 要你做什么:无。 ## What changes - **`@object-ui/plugin-grid`** — two generic host props on `ObjectGrid`'s table view: `hostCells` (a host draws a column's cells, keyed by the column's field) and `rowTint` (a palette name per row; it wins over `rowColor`, and only palette names tint — `rowTintClass` in `useRowColor.ts`). No product-named component. - **The metadata list is an `ObjectGrid`** (`ResourceListPage.tsx`, adapter `metadataListGrid.ts`): - the grid gets a schema DECLARED from the list's columns (`MetadataListSource` answers it; nothing is guessed from the first row), and each row is only its key plus its column values — the item, its package, lock and diagnostics are looked up by that key, never selected through the grid; - rows reach the grid already filtered and sorted by `applyListState` (the one implementation `orderedListNames` reads), in host mode (`data` + `manualPagination` + `rowCount` + `onPageChange`), so the grid never re-sorts and its visible order IS the detail's ‹ › order (pinned); - header sort → the list's `sort` param (only the API-name/label column sorts; a label-first identity column sorts by label), page → a `page` param, cleared on every list-state write; - diagnostics tint (`rowTint` red/amber), the lock, identity cell, served/console-rendered columns, the Active switch (with its holder confirmation, `CatalogActiveCell` unchanged) and sharing-rule Clone are the page's host cells. Active and Clone share ONE right-pinned controls column, because the grid gives every right-pinned column `sticky right-0`; - the grid's search box, selection, inline edit, column resize/reorder (so no personal column layout) and export are off for this list. - **List 「新建」 on a read-only base lands in the paired `.custom` package** (ADR-0146 D3): - new module `MetadataListCreateDialog.tsx`: object (with the organization-wide sharing default; joins its package's app menu only when NOT in a pair, as the Data pillar does) and flow (starting-point presets, Advanced trigger list, born off). On a read-only base both ask `ensureCustomizationPackage` and write to the answered package/namespace; a quick submit reads the namespace first instead of writing unprefixed; - `StudioMetadataArea`: `AreaCreate` on a read-only base with a customization opens the pair's create (ensure once, then `/studio/PAIR/metadata/TYPE/new`; a refusal is shown in place); the area tells the list `host.pairCreate` exactly where it does that, so the list never offers a dead 「新建」. A walled door offers none, as today; - `StudioDesignSurface.tsx` and the pillar files split out of it are untouched (helpers imported from standalone studio-design modules only). Dashboard/report 「新建」 is not here. - `builtinComponents.tsx`, `anchors.ts`, `servedListColumns.tsx` are read only. ### Since the first version of this body (head `1137895` → `f1f10706`) - **Kernel packages get no list create.** A kernel package (manifest scope `system` or `cloud`) has no pair: the ensure door refuses it (409, ADR-0146 D3). The area now reads that scope from the listed manifests. It sets `host.pairCreate` only for a read-only, non-kernel base whose door is not walled. `AreaCreate` opens the pair's create only under that same flag, so a kernel package's `/new` lands on the list. Pinned in `StudioMetadataArea.routes-28561.test.tsx`; it was CI's red on `Test UI (7/16)`, `StudioDesignSurface.metadataArea-28561`. - **The create-dialog enumeration test.** `CreateItemDialog.oneLabel-11787.test.ts` enumerates every `CreateItemDialog` site from source. An object and a flow are now created from their pillar AND from the list, so its CONTROL now asks that each live title is reached by one site or more, instead of exactly once. This was CI's red on `Test UI (2/16)`. - **Merge of objectstack-ai#36977** (one detail header and tool tabs). It conflicted in `StudioMetadataArea.tsx`; the resolution keeps its `AreaHistoryRedirect` and this PR's `AreaCreate` side by side. - **objectstack-ai#36898 re-hosted on the grid table.** After objectstack-ai#36983 merged, its 「修改时间」 cell (`ListChangedCell`, `listChangedAt`, `listDraftMarks`) is a page column (`__changed`) drawn by a host cell. It sits before Source, keeps the item's change time and its 「有未发布的改动」 mark (person vs AI), and looks up the bundle member by row key. - The page's own columns are now drawn under their place in the column list, not by index arithmetic. - The Modified header sorts by the list's `changed` key. A new pin in `ResourceListPage.changedColumn-36898.test.tsx` checks that a header click orders oldest first with the code-shipped item last. Its existing cases read the grid's DOM, reaching the row by `closest('tr')`. - The ‹ › order pin is unchanged: the rows still come from `applyListState`, which now also sorts by `changed`. - **`metadataAreaHost.customizations-28568`** waited for the "only customizations" filter and then read rows synchronously. The grid draws its rows once its table is ready ("Loading grid…" first), so the test now awaits the row before reading its marks (3 cases). ## Tests Final local run at `00e524f13`. `f1f10706` after it changes only the changeset's `Clause-②` line. <details><summary>Every suite naming ResourceListPage + the objectstack-ai#36898 helpers + adapter + create + area + grid + the enumeration test — 43 files / 508 tests pass; type-check green</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 FILES (the 36 test files `git grep -l ResourceListPage` names, plus listChangedAt-36898, listDraftMarks-36898, metadataListGrid, MetadataListCreateDialog.pairCreate-36897, rowAdornment-13330, CreateItemDialog.oneLabel-11787) Test Files 43 passed (43) Tests 508 passed (508) pnpm --filter @object-ui/app-shell --filter @object-ui/plugin-grid type-check ui/packages/plugin-grid type-check: Done ui/packages/app-shell type-check: Done os-verify-lock: VERDICT command-exit 0 ``` </details> The earlier runs on this branch, kept for the record. Run at `490aad241`: <details><summary>ResourceListPage family + adapter + create + area + grid — 72 files / 544 tests pass</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/ResourceListPage packages/app-shell/src/views/metadata-admin/metadataListGrid packages/app-shell/src/views/metadata-admin/MetadataListCreateDialog packages/app-shell/src/views/metadata-admin/metadataAreaHost packages/app-shell/src/views/studio-design/StudioMetadataArea packages/plugin-grid/src/__tests__/rowAdornment packages/plugin-grid/src/__tests__/ObjectGrid Test Files 72 passed (72) Tests 544 passed (544) os-verify-lock: VERDICT command-exit 0 ``` Earlier on this branch the whole `plugin-grid/src` tree ran green with the metadata-admin suites (329 files). </details> <details><summary>type-check — app-shell + plugin-grid green</summary> ``` pnpm --filter @object-ui/app-shell --filter @object-ui/plugin-grid type-check ui/packages/plugin-grid type-check: Done ui/packages/app-shell type-check: Done os-verify-lock: VERDICT command-exit 0 ``` </details> New pins: - `metadataListGrid.test.ts` — the declared schema (a stray first-row key is not a field), the grid flags off, sortable only where the list sorts, sort round-trip, page clamp. - `ResourceListPage.listStateInUrl-36896.test.tsx` (new describe) — the rows the table draws, in order, equal the detail's ‹ › names; a Label header click writes `sort=label` and the detail follows; `page=2` of 53 rows shows the last 3, a new search returns to page 1. - `MetadataListCreateDialog.pairCreate-36897.test.tsx` — read-only base: ensure asked, pair package + pair namespace written, OWD carried, no menu join; CONTROL writable package: no ensure, menu join; flow preset into the pair, born off; a preset needing an object writes nothing. - `ResourceListPage.pairCreate-36897.test.tsx` — 新建 offered on a read-only base (object/flow dialog, other type → area create), none without `pairCreate`; CONTROL Setup unchanged. - `StudioMetadataArea.routes-28561.test.tsx` (new describe) — the pair's create opens from the ensure answer, a refusal shows in place, a walled door never asks, `pairCreate` set exactly then. - `rowAdornment-13330.test.tsx` (new describe) — a host cell replaces its column only; `rowTint` tints palette names only; CONTROL without either prop. - Changed only where a test pinned the old table's DOM: the row test id now sits on the identity cell (`closest('tr')` reaches the row) in 5 suites; the declared-sharing-rules pins read the one shared controls cell; the nightly live spec `declared-sharing-rules-reach-13091` reads the grid's `data-table-scroll-box` and its seam shadow (measured on the booted app below: Clone and Active inside the 1440 px viewport and box, overflow 1588/1390, shadow drawn). ## Acceptance notes - **Size** (against `origin/main`, at `00e524f13`): 2195 changed lines (1771+, 424-): - src 1509, tests 673, changeset 13, generated 0; - merging objectstack-ai#36898 and re-hosting it on the grid added 68 of them (2127 before); - this is the card's only PR, under the 2500 stop line. - **Largest type under `~all`** (HotCRM booted, `GET /api/v1/meta/TYPE` for all 34 types): `object` **136** rows (then `email_template` 128, `view` 125, `hook` 88, `flow` 54). The grid holds them in memory and pages 50 at a time — `/studio/~all/metadata/object?page=3` shows 36 rows, "Page 3 of 3". - On the booted HotCRM the list showed "Couldn't read customizations: … answered a body its declaration refuses" — the server is the published `@objectstack/cli` 18.6.0 HotCRM pins, the console is this tree's `ui/` (version skew between a released server and `main`'s reader); the create path itself does not read it. - `ObjectGrid` gives every `pinned: 'right'` column `sticky right-0`, so two right-pinned columns overlap; this list pins one. Noted, not filed (no second producer measured). - The live HotCRM run made no approvals/lock API calls (network log of both creates: ensure → PUT draft → POST publish → user-preference PATCH only). **Declared deviations.** - The screenshots live on a no-PR, images-only branch, `claude/issue-36897-list-objectgrid-shots` (`3c488ba2`), and are embedded below by raw URL. The relay has no attachment upload. - HotCRM was verified with its pinned published server (`@objectstack/cli` 18.6.0) and this tree's console on Vite, the dogfood skill's authoritative-console route. The screenshots predate the objectstack-ai#36898 re-host, so they show no 「修改时间」 column. - Most of the 39 locally derived gate families ran at `2c60bdf3a`. The ratchet subset re-ran later (`test-source-alias`, `type-check-debt`, `type-check-coverage`, `undeclared-dep-imports`, `cross-package-test-inputs`, `published-files`, `nul-bytes`), and CI runs the farm on the head. - One push went out while `overlap-check` reported conflicts with the then-open PRs objectstack-ai#36983 and objectstack-ai#36977, not with main. Both have since merged into this branch. ## Verification Booted HotCRM (`objectstack dev --seed-admin -p 4517`, its own DB) with this tree's console on Vite (`VITE_SERVER_URL`), Chromium at deviceScaleFactor 2: | | | |---|---| | Object list on HotCRM (read-only base) — grid, 新建 offered |  | | New object on HotCRM — saved as `crm_custom_site_visit`, OWD picker |  | | Landed: "In app.objectstack.hotcrm.custom" (`POST …/hotcrm/ensure-customization 201`, `PUT /meta/object/crm_custom_site_visit?package=app.objectstack.hotcrm.custom`) |  | | New flow on HotCRM — presets |  | | Landed: flow in `app.objectstack.hotcrm.custom`, switched off, Start = manual |  | | Sharing rules under `~all`: Active switch + Clone in the pinned controls column |  | | `~all` objects, page 3 of 3 (136 rows) |  | | Self-built package `com.acme.fieldops`: object `fops_work_order` and flow `dispatch_tech` written to it (no ensure call) |   | Read first (by risk): `ResourceListPage.tsx` (the host cells + `cellDrawsRef` — the table keeps columns as state, so cells must be stable and read the latest draw through a ref), `ObjectGrid.tsx` (`hostCelledColumns`, `rowClassName`), `MetadataListCreateDialog.tsx` (`createTarget`). Two-minute check: `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/ResourceListPage.listStateInUrl-36896.test.tsx` — expect 11 passed, including "the rows the table draws, in order, are the names the detail steps through". CI on `00e524f13`: 40 success, 13 skipped, mergeable `clean`. Local gates: the 39 families `dispatch-gates --commands` derives all exit 0 (`--ran`: 39 derived, 39 run, 0 NOT-MEASURED, derived zero); `check:test-source-alias` was red once on this branch and fixed by paying the `@objectstack/lint` / `@object-ui/plugin-detail` loads at collection in 6 suites; the vitest `scripts/` family was OOM-killed once beside the booted app and re-ran green (172 files). CI runs the farm. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…I draft gets the designers' notice and discard (objectstack-ai#37026) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBTuMGhLAZx29zwDrayDGZZF)_ Fixes objectstack-ai#36902 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员在 Studio 的通用详情页(钩子、选项集、视图等)改完点「保存」,改动立刻生效;不再有自动保存开关,也不用再点一次「发布」。 - 为什么做:Studio 重构专题里「通用详情保存即生效」这一项,让通用详情和各个设计器的保存方式一致。 - 出错会怎样:发布被拒时,页面上方写明原因,什么都不生效,页面上的修改保留可以再存;AI 留下的草稿保留并有提示,可以一键放弃;本改动可以直接撤回。 - 要你做什么:无 ## What changes Studio's generic item page (`ResourceEditPage`, every type without its own designer: hook, picklist, view, page, app, doc…) now saves the way the designers do (objectstack-ai#36511, epic decisions 1, 12, 14). 1. **Save = draft + this one item's publish.** Save writes the draft (`PUT /meta/:type/:name?mode=draft`, If-Match / If-None-Match pin and conflict dialog unchanged), then publishes that one item (`POST /meta/:type/:name/publish`) at the same `?package=` and bundle `member`. The publish is pinned to the published version the page loaded, through the existing `DraftSaveGuard.publish` (objectstack-ai#36601), so a Save over a row another editor published since opens the same conflict dialog (reload, overwrite, keep editing). The auto-save switch, its 1.5 s debounce and the `metadata-admin:autosave` browser setting are gone; the header's Publish and discard-draft buttons are gone. 2. **Create publishes after its first save** (If-None-Match `*`, then the publish). 3. **AI draft** (`draftChanges[].by` is `copilot` or `mcp`): the page shows the AI's version under the designers' `StudioAiDraftNotice`; a person's Save makes it live together with their edits; "Discard the AI's changes" drops that one item's draft at its package and member, and asks first (in the page's own dialog, objectui#13333) when the page holds unsaved edits. 4. **A person's pending draft** from before this change is marked "This item has unpublished changes" with its own Publish (pinned) and Discard for that one item. 5. **Leave guard**: ×, ‹ ›, the side menu, in-app links, reload and close ask first when the page holds unsaved edits; browser Back is not intercepted (decision 12). The seam was already in place (`chrome/unsavedEdits.ts`); this PR pins it on this page. 6. **A refused publish** shows its reason above the editor in the designers' words (`publishRefusal`, server text under Details). Nothing goes live; the draft the Save wrote is taken back when no draft was pending before, and the edits stay on the page, unsaved. A draft that was pending before (the AI's or a person's) is kept. 7. **`@object-ui/data-objectstack`: `MetadataClient.layered()` now forwards `overlayVersion`.** The client rebuilt its answer field by field and dropped it, so a publish pin read off `layered()` was always `null`. This is why the Save's publish could not be pinned; it also made the object page's objectstack-ai#36601 publish pin a no-op on a server that serves the field. Fixed in place (bounded fix: same defect class as the card's pin, mechanical, the file had no other claim, no new gate surface) and pinned in `metadata-client.layeredDraft-29793.test.ts`. **Clause-② yes (widening):** the published package's exported `MetadataLayered` type gains the optional member `overlayVersion?: string | null` (claim amendment on objectstack-ai#36902, 7137741670; L1-b (3) S1, 7137721696). New shared piece: `detailSaveAtOnce.ts` (`publishDetailSave`, `isAiDraft`). The designers' `publishSavedItem` (`studioSaveBar.tsx`) names no bundle member, so this page carries its own instead of changing that file. `StudioDesignSurface.tsx`, `DraftConflictDialog.tsx` and `studioSaveBar.tsx` are unchanged (reused as they are). ### How this relates to objectstack-ai#36726 and objectstack-ai#36350 - **objectstack-ai#36726** (open PR objectstack-ai#36958 pins the designers' publish): no shared files, either PR can land first. This card pins the generic page's own publish with the same objectstack-ai#36601 `DraftSaveGuard` API, used as it is on main. The `overlayVersion` client fix (item 7) is what makes a pin read off `layered()` effective at all, the object page's included. One sequencing item: objectstack-ai#36958 adds rule 9 to the guard (a reload over a draft that was pending before the Save keeps the conflict's pin until the author re-confirms), answered by a `beforeReload` that returns `'kept'`. On main that callback is typed to resolve to nothing (a void promise) and refuses that answer (tsc TS2345, measured), so it cannot be written here without editing `DraftConflictDialog.tsx`, which this card must not touch. Today this page is at parity with main's guard. Whichever PR lands second adds the one-line `beforeReload` for the `hadDraft` case in `publishDetailSave`. - **objectstack-ai#36350** (view-draft publish takes a draft-version precondition): left to objectstack-ai#36350. That is a change to the publish door (server / protocol), outside this card's boundary (Metadata-protocol: none). This page's publish is pinned on the published version, not on the draft version, so the window objectstack-ai#36350 describes (another writer's draft write between this Save's draft save and its publish, then published by this Save) is still open for views until objectstack-ai#36350 lands. When it does, the Save's publish can send the draft version it just received; the call site is `publishDetailSave`. ### Read first (by risk) 1. `ResourceEditPage.tsx` `doSave`: the draft save → `publishDetailSave` → refresh sequence, and the refused branch (take-back only when `hadDraft` is false). 2. `detailSaveAtOnce.ts`: the take-back on a refused or conflicted publish. 3. `metadata-client.ts` `layered()`: the two `overlayVersion` forwards. ### Two-minute check Open Studio → All metadata → any view, change its label, press Save. Expected: one `PUT …?mode=draft` and one `POST …/publish` in the network panel, the Unsaved chip clears, no "unpublished changes" line, and `GET /api/v1/meta/view/NAME` already serves the new label. ## Tests ### Acceptance run (the card's 验收 scenario, real browser, self-built stack) Backend `examples/app-showcase` (`objectstack dev --seed-admin --fresh`) and the console dev server, both built from this branch, on per-agent ports. The items are my own, authored into the showcase's customization package (`com.example.showcase.custom`): a hook, a shared option set (picklist) and two views. The backend ran with `OS_METADATA_WRITABLE=picklist`: the picklist type is not runtime-creatable by default (`NOT_CREATABLE`, its registry entry), so the option-set leg needs that operator setting. Each leg edits the label and presses Save once; the network log is the page's own requests. | Item | Before Save | Writes after Save | Live read after Save | |---|---|---|---| | hook `s36902_stamp_title` | chip `unsaved`, no request in 2.5 s | `PUT …?mode=draft&package=…custom` then `POST …/publish?package=…custom` (200) | new label served; no unpublished-changes line | | picklist `s36902_priority` | same | same pair (200) | same | | view `showcase_task.s36902_triage` | same | same pair (200) | same | <details><summary>Screenshots: hook, option set, view (unsaved, then saved and live)</summary>       </details> **AI draft.** Written through the real MCP door, not faked: an OAuth client (dynamic registration, PKCE, consent, `metadata:write`) called `save_metadata_draft` on `showcase_task.s36902_ai`; the draft read then carried `draftChanges: [{path: ["label"], by: "mcp", …}]`. - The page shows the AI's version under the notice (4). An edit then "Discard the AI's changes" asks in the page's own dialog (5); confirming sends one `DELETE …?state=draft&package=…custom`, the draft read answers 404 and the live version is back (6). - A second MCP draft, then an edit and Save: `PUT` draft + `POST …/publish` (200), the draft read answers 404, the live label is the AI's change plus the person's edit (7). - Leave guard: with an unsaved edit, × asked "You have unsaved changes. Leave this page anyway?", and Cancel stayed on the item. <details><summary>Screenshots: AI draft notice, discard, save</summary>     </details> Images: orphan branch `claude/issue-36902-screenshots` at `566b916`. ### Live e2e `LIVE_APP_URL=… LIVE_API_URL=… pnpm exec playwright test -c playwright.live.config.ts e2e/live/studio-detail-save-at-once.spec.ts e2e/live/studio-editor.spec.ts`: 3 passed (the new spec: no auto-save in 2.5 s, × asks, Save sends exactly `PUT` + `POST …/publish`, the live page has the added block, the draft read is 404, browser Back is not intercepted; `studio-editor.spec.ts`'s Add-block round trip now reads the published item after Save). ### Unit At head `09693db5c`, under the shared verify lock, one run: every test file under `metadata-admin/` plus every other ui test file that mentions publish, draft, auto-save or the detail page (338 files), then `type-check` (which compiles the test files too) of `@object-ui/data-objectstack`, `@object-ui/i18n` and `@object-ui/app-shell`. <details><summary>Readings</summary> ```text Test Files 338 passed (338) Tests 2918 passed (2918) packages/data-objectstack type-check: Done packages/i18n type-check: Done packages/app-shell type-check: Done os-verify-lock: VERDICT command-exit 0 ``` New: `ResourceEditPage.saveAtOnce-36902.test.tsx` (19 cases over the real `MetadataClient` and an in-memory server that honours If-Match / If-None-Match on the draft door and on the publish door: items 1–6, the leave guard on ×, ‹ ›, links, beforeunload, Back unguarded, create publishes, refused create). `metadata-client.layeredDraft-29793.test.ts` gains the `overlayVersion` forward on both answer shapes (served value, served null, absent). </details> ## Acceptance notes - 'Changes 1' in shots 1–3 is the AI draft of `showcase_task.s36902_ai`, written through MCP before the save leg for shots 4–7; it clears in shot 6 once that draft is discarded (not the hook: its Save sent `PUT ?mode=draft` then `POST /publish` 200). - Existing detail-page suites that waited out the auto-save or clicked the header's Publish / Discard draft now press Save and read the Save's own publish, or use the unpublished-changes line's buttons (14 files). Their doubles gained a publish that drains the draft, as the real door does; assertions that only held because a draft stayed pending after Save were rewritten to the live result. `layersUnsaved-11799`'s SAVE case now expects one `/layers` re-read: a Save publishes, so the item has a layer afterwards. - Leftover `localStorage.setItem('metadata-admin:autosave', '0')` lines in suites this PR does not otherwise touch are now no-ops; left as they are to keep the diff to the card. - The platform checklist step that says the ResourceEditPage draft auto-saves and is then published (`docs/qa/platform-checklist/areas/studio-authoring.json`, the page Add-block item) is now stale. carrier: objectstack-ai#36910 (the epic's checklist-and-docs card). - The designers' own auto-save (Data / Automations / Access pillars) is unchanged: out of this card. ## Verification <details><summary>Local gates (derived for this diff) and reconciliation</summary> - `node scripts/pm/dispatch-gates.mjs --commands`: 39 families. All 39 run locally: 38 exit 0 (`check:*` and the node scripts, re-run after the last code commit), and `pnpm --dir ui exec vitest run scripts/` under the lock at `c8a49c900` (the one later commit changes only a live e2e spec): `Test Files 172 passed | 2 skipped (174)`, VERDICT command-exit 0. - `node scripts/pm/dispatch-gates.mjs --ran FILE` (each line with its exit code): `39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero)`. - `node scripts/check-test-source-alias.mjs`: OK, 34 changed test files judged (the touched suites now load `@objectstack/lint` at collection, as the gate asks). - `node scripts/pm/overlap-check.mjs` before every push: `VERDICT clean exit 0` (shares only the i18n catalogues and `metadata-client.ts` with objectstack-ai#36983, objectstack-ai#36985, objectstack-ai#36784; each merges cleanly). - The rest of the farm (lint, the CI test shards, `test:repo`) is CI's; its check-runs are read on the PR. </details> Changed lines: 1,650 over 24 files (1,317 added, 333 removed), one PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
Fixes #36898
Part of #36890
Clause-②: yes (widening)
Metadata-protocol: none
The widening:
MetadataListAnswer, exported from@object-ui/data-objectstack's entry, gains an optionalchangedAtmember (an addition to that published package's public surface; precedents 36011-restore-factory-view, #36846). No metadata an author writes changes, soMetadata-protocol: noneand the patch level stand. Corrected in round 2 per L1-b (3) S1 (7133485320).repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x
维护者速读
What changes
changedAtsibling (GetMetaItemsResponseSchema.changedAt, served since the list-response change for the card that added it). An item served from a stored row shows its time in the reader's locale (full instant on hover); a code-shipped item shows the empty-value dash, never an error.changedinmetadataListState.ts(the seam the list-state change left): "修改时间(最新在前)" / "(最早在前)", in the address assort=-changed/sort=changed. Items without a time sort last in both directions; ties read A to Z by name.orderedListNamesruns the sameapplyListState, and the detail side (useListOrderedNames) now reads the same times, so ‹ › follow the drawn order (pinned).GET /api/v1/meta/_draftsledger — no protocol change; drafts that existed before this change are marked too (epic decision 14). Measured: Studio'sStudioPendingDraftsContextwraps the area's list but not Setup's, and its rows carry no package or bundle member, so the list reads the ledger through its own metadata client (listDrafts, the read the client's draft reads already ask first; same scope as the list's items), re-read with the list and on the publish pulse (emitMetadataRefresh).getDraft,draftChanges) judged withisAgentDraftSurface— the ruleStudioAiDraftNotice's line uses (copilot or MCP build door ⇒ 「AI 的改动未发布」, violet with a sparkle; anything else or no recorded provenance ⇒ 「有未发布的改动」, amber). Not forked.MetadataClient.listResponsedroppedchangedAt; it now carries it (each entry parsed with the spec's own rule; absence stays absence).listunchanged;listandlistResponseshare one in-flight GET (measured in the browser: one/meta/dashboardrequest per list load).listChangedAt.ts(cell value, comparison, read hook),listDraftMarks.ts(ledger match + AI judgement + hook),ListChangedCell.tsx(the cell). Mounted inResourceListPage.tsxwith one header cell, one body cell and the reader member (15 lines) so the ObjectGrid re-host can move them as they are.StudioDesignSurface.tsxuntouched.Screenshots (real boot, showcase app, deviceScaleFactor 2)
Own backend on a random port, Console from this branch's
ui/via Vite. Data written for real: a live save ofshowcase_revenue_pulseintocom.example.showcase.custom; a person's draft (surface=studio) ofshowcase_ops_dashboard; an AI draft ofshowcase_chart_gallerysaved through the MCP build door (save_metadata_draftwith an OAuth token,draftChanges[].by = mcp).Both mark kinds and a time; code-shipped items empty:
Sorted newest first (
?sort=-changed), items without a time last:After publishing the AI draft: its mark is gone and its time appears at the top:
Tests
Run on head
3671d2304(after merging origin/main):pnpm --dir ui exec vitest run --maxWorkers=2over the four new test files,metadata-client.listRegistrations-12349,metadataListState-36896,useListScrollRestore-36896and everyResourceListPage.*test: Test Files 19 passed (19), Tests 130 passed (130).pnpm --filter @object-ui/data-objectstack --filter @object-ui/i18n --filter @object-ui/app-shell run type-check: exit 0 (all three scripts echoed).Ablations (one-off, through scripts/ablation-replace.mjs, restored and blob-verified)
listChangedAt.tsmissing-last flipped (ta === null ? 1 : -1→-1 : 1): 4 red — both sort-direction cases, the unparseable-time case, and the page's?sort=-changedorder. Restored blob 8212f4df4d0a = before.listDraftMarks.tsAI judgement removed (some(() => false)): 2 red — the copilot/MCP case and the page's AI-vs-person mark. Restored blob 9d8aae37116f = before.Acceptance notes
changedAtis that row's time); the mark shows instead, and the time moves on publish (screenshot 3). A live save moves the time at once (showcase_revenue_pulse).Verification
Two-minute check: open
/studio/PACKAGE/metadata/dashboardfor a package with one stored item and one drafted item — the 修改时间 column shows the stored item's time, the drafted one carries 「有未发布的改动」; pick 「修改时间(最新在前)」 and the stored item moves to the top.Read first (by risk):
listDraftMarks.ts(ledger match across a base and its.custompair),metadataListState.ts(thechangedsort branch),metadata-client.ts(readChangedAt).Overlap:
ResourceListPage.tsxconflicts textually with the ObjectGrid swap's PR (#36978, head 1137895); declared in both claims — whichever lands second merges the other. Its list-row test selector was checked against this branch's new test ids (they do not start withmetadata-row-).🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x