Skip to content

fix(console): a shared view's draft save keeps the list on the draft, and a second change builds on the first - #36031

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-35932-draft-save-no-remount
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-35932-draft-save-no-remount

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

Fixes #35932
Clause-②: no
Metadata-protocol: none
Skills-docs: none — console runtime behaviour only; no authorable key, value or published skill text changes

维护者速读

  • 管理员改共享视图(选页脚汇总、改视图设置)保存草稿后,列表不再闪回已发布版本,一直显示草稿,直到发布;其他用户照旧只看已发布版本。
  • 属于列表页重做那一组工作:先前连选两次汇总再发布,只留下第二次,这里两次都保住。
  • 出错时列表又会在保存后闪一下骨架屏、回到已发布版本;改动只在控制台前端,撤回此合并即恢复原样。
  • 无。

What changes

Measured cause (not the one the card first guessed at, one layer further down). persistRuntimeMetadata does emit the metadata-refresh pulse on every draft save, and MetadataProvider does refetch every loaded type on it, as the card says. The remount itself comes from what the route reads while that refetch is on the wire: the type cache sets the view list to loading, and viewsForObjects counted only ready/error as answered, so the route's object scope read settled: false, AppContent's routeReadsSettled went false, the route slot dropped to its skeleton, and ObjectView mounted again. The new mount lost its viewDraft state and read the published view. Measured with a throwaway probe on the real MetadataProvider + AppContent (base ec243639): holding the refetched /meta/view list sent the route to the skeleton and the route element mounted twice; holding the by-name object reads, or holding nothing, did not.

  • MetadataProvider: a type entry carries answered (set when a fetch settles, cleared only when the entry drops its items: whole-type invalidate, an organization switch). A type refetching in place over an answer it still holds counts as answered (typeAnswered), so a scope stays settled on the views in hand. This is what refreshScopes ("Refetch every scope in place: the items stay until the answers replace them") and AppContent's useLazyMetadataSettled ("A bucket that answered once and is now refetching keeps its items while it loads, so it still counts") already said; the view half of the scope did not do it. The pulse's meaning to its subscribers (chat, marketplace, Studio, pending drafts) is unchanged: they are still told, and still refetch. The provider's refresh contract is unchanged; one reader-facing readiness answer during a refresh changed.
  • objectViewViewCrud.tsx / ObjectView.tsx: the list no longer remounts on a draft save, so the local draft copy is no longer dropped by a remount either. The view settings draft bar's Publish and Discard (onAfterChange) now go through handleDraftBarChange, which bumps the refresh counter and drops viewDraft once the saved views have been read again (not before, so the list does not fall back to the pre-publish read). Before this change Discard relied on the remount to clear the discarded draft from the screen. ObjectView.tsx changes two lines (the destructure and the onAfterChange prop).
  • MetadataProvider, the app-bundle path (the one the showcase takes, measured in the browser): the pulse's clearCache() also drops the adapter's app bundle (AppBundleStore.clear()), and the bundle then answers pending until it is downloaded again. On a bundle-first route the view list type is never loaded, so viewsForObjects answered NO_VIEWS, not settled, and the route went to its skeleton all the same. The provider now keeps the items of the last bundle that answered in this world (answeredBundleRef, written on every ready peek), and while a reload is pending viewsForObjects answers from them, settled, when they hold every asked object. An asked object outside them still waits for the reload, as before (no /meta/view list read is started for it). An organization or session switch (dropAdapterWorld) forgets them. The refresh contract is unchanged: clearCache, the pulse, and what peekAppBundle readers see are as they were.
  • Reports: ReportView's draft save takes the same seam and the same pulse; its route reads the report bucket, which was already sticky, so nothing there changes beyond the scope no longer unsettling.

emitMetadataRefresh on a draft save is kept: the pending-drafts surfaces read on it (objectui#13139), and removing it would need a new ledger-only signal.

Tests

  • New console/__tests__/AppContent.draftSaveKeepsList-35932.test.tsx: real AuthProvider, MetadataProvider, AppContent, ObjectView and persistence seam; only the network is stubbed (the provider adapter with the refetched view list held open, the list's data source, the metadata client's save); ListView is a recording stand-in that counts mounts.
    • acceptance 1: an admin's footer pick, while the refresh is on the wire and after it lands: no skeleton, one mount, the pick drawn;
    • acceptance 3: two successive picks (Sum on amount, Latest on closed_at): two draft saves, the second body carries both;
    • acceptance 2: the writes are draft saves; a reader (not an admin) served the published view draws it without the admin's calculation and is offered no pick;
    • CONTROL: a whole-type invalidate('view') still sends the route to the skeleton.
    • The same on an app with a bundle: the provider's adapter has peekAppBundle, the pulse's clearCache() drops the bundle as AppBundleStore.clear() does, and its reload is held on the wire. A footer pick: no skeleton, one mount, the pick drawn, while the reload is held and after it lands. Two picks then Publish (through the seam the draft bar calls): the second draft carries both, and the Publish pulse keeps one mount and no skeleton. CONTROLS: a first entry held on the wire (no bundle has answered yet) does not draw the list until it lands, and a whole-type invalidate('object') on the bundle route still shows the skeleton.
    • Why the first version of this pin missed the bundle path: its adapter had no peekAppBundle, so it only ever exercised the no-bundle path.
  • New views/objectViewViewCrud.draftBarChange-35932.test.tsx: Publish or Discard bumps the counter and drops the draft copy in the commit that installs the next saved-views read, and only that one; CONTROL: a read with no Publish or Discard keeps it.

Acceptance notes

Verification

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.draftSaveKeepsList-35932.test.tsx should print Tests 8 passed (8).

Read first, by risk:

  1. ui/packages/app-shell/src/providers/MetadataProvider.tsx: answeredBundleRef (written in peekBundle, forgotten in dropAdapterWorld) and its use in viewsForObjects; then typeAnswered, the answered lifecycle (set in ensureOwnType's two settle arms and the session seed, cleared in whole-type invalidate), and the three viewsForObjects / whole-registry settled answers.
  2. ui/packages/app-shell/src/views/objectViewViewCrud.tsx: handleDraftBarChange and its [savedViews] effect.
  3. The new AppContent pin.

Readings on final head 7001680d (the bundle-path fix 1a98520d and its changeset, on the merge of origin/main c00be39b, 397893e5), repository objectstack-ai/objectstack. The first round's readings, on 59e9e7c5, are kept below where they still stand.

Ablation, bundle half (the answered-bundle branch removed, the AppContent pin re-run)

With scripts/ablation-replace.mjs on MetadataProvider.tsx: the anchor (the answered && asked.every(...) ? answered : null arm of viewsForObjects) went from 1 hit to 0, the marker from 0 to 1, and the blob from the HEAD blob 00739af7 to de6251bf. The pin then read Tests 2 failed | 6 passed (8): the two new bundle cases (the footer pick, and two picks then Publish) failed, and the no-bundle cases and the controls held. On restore the blob was 00739af7 again, equal to HEAD, and git diff HEAD was empty. A first try was refused by the tool before running anything: its replacement text already occurred in the file, so the marker count could not move. That try ran nothing and counts for nothing.

Ablation, first round (the MetadataProvider half put back to base, the pin's no-bundle cases re-run, on `59e9e7c5`)

MetadataProvider.tsx restored to base ec243639: the pin read Tests 2 failed | 2 passed (4), with the footer-pick case and the two-picks case red and the reader case and the control green. The file was then restored to HEAD.

Affected suites
  • pnpm exec vitest run --root . --maxWorkers=2 packages/app-shell/ (all of app-shell, run from ui/): Test Files 2360 passed | 1 skipped (2361), Tests 22118 passed | 9 skipped (22127), exit 0.
  • pnpm run type-check in app-shell (src and tsconfig.test.json): exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 scripts/ (derived): Test Files 172 passed | 2 skipped (174), Tests 5111 passed | 2 skipped (5113), lock VERDICT command-exit 0.
  • The two 35932 pins: Tests 8 passed (8) and Tests 2 passed (2).
Derived gate families

node scripts/pm/dispatch-gates.mjs --commands on 7001680d: 38 families, each run, each exit 0. check:type-check-debt was first NOT MEASURED (queue-timeout 99 behind this card's own suite run) and then re-run under the lock: VERDICT command-exit 0. --ran with the codes recorded: "38 derived famil(ies) accounted for, 38 run, 0 NOT-MEASURED (a DERIVED zero)". overlap-check.mjs --branch=HEAD: clean with origin/main 96b66ca9, #36026 and #36024; one conflict with #36037 (see Acceptance notes). Every other family is CI's.

Browser reading on the showcase stack (round 2, on the bundle-path fix)

Setup: a showcase backend (objectstack dev --seed-admin, OS_PORT 4617) and the Console Vite dev server (:5617, --strictPort) serving app-shell src at 1a98520d. The view showcase_project.seat_r2 was freshly created and published with no calculations. Every /api/v1/meta/view request and every app-bundle request (/api/v1/meta/app/APP/bundle) was held 1500 ms. The route skeleton and a remount were detected by a DOM probe sampled on every mutation and every animation frame, as the AppContent pin does. Screenshots are at deviceScaleFactor 2 in /mnt/project-files/build-seat1/35932/ (the r2- files).

  • (1) Admin, first footer pick (Sum on budget): no skeleton, 0 remounts, 1 bundle reload and 1 view read on the wire. The footer drew Sum $1,090,000.00; the server draft held budget: sum.
  • (1) Second change (Latest on start_date): no skeleton, 0 remounts. Footers Sum $1,090,000.00 and Latest Dec 5; the server draft held budget: sum, start_date: max, and published nothing yet.
  • (2) Publish from the view-settings draft bar: no skeleton, 0 remounts, 1 bundle reload. The published view held budget: sum, start_date: max, the draft was gone (404), and the footers stayed drawn.
  • (3) CONTROL A: a whole-type invalidate('object') on the mounted provider showed the skeleton once and remounted once.
  • (3) CONTROL B, the bundle path: a fresh open with the bundle held 4000 ms. The list was first drawn 1018 ms after the bundle answer was released (5019 ms after it was asked), so nothing was drawn while no bundle had answered.
  • (4) A second user who is not an admin: before Publish, empty footers, no picker offered, and the published view held no calculation. After Publish, on a fresh open, both footers were drawn (Sum $1,090,000.00, Latest Dec 5).

Round 1 (on 59e9e7c5, before the bundle half) measured the defect this round fixes: the first pick showed the skeleton and remounted, the second draft overwrote the first, and Publish remounted. Its screenshots are the files without the r2- prefix. Its reader case was NOT MEASURED because the reading script had the reader's password wrong.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv

…e draft

A draft save announces itself on the metadata-refresh pulse; every
MetadataProvider refetches its loaded types on it, and while the refetched
view list was on the wire the route's object scope read as unanswered, so
AppContent dropped the route to its skeleton and remounted ObjectView on
the published view. A type refetching over an answer it still holds now
counts as answered, so the scope stays settled and the list keeps the
draft; a second change builds on the first. Publish and Discard in view
settings drop the local draft copy once the saved views are read again.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…r declares its deps

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-sales November 21, 2026 08:46
…ute drawn

The refresh pulse a draft save announces drops the adapter's app bundle
(clearCache), which then answers pending until its reload lands. The
scope's views answered not settled meanwhile, so AppContent swapped the
route for its skeleton and ObjectView mounted again on the published
view. viewsForObjects now answers from the bundle that last answered
in this world while the reload is on the wire, when it holds every
asked object; a world switch forgets it. The refresh contract is
unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

Final green head · 2026-11-21T11:20Z · area b1-DB

  • Head 7001680dd3f527e118a3fe7d77b1f43d6450b8ea: 41 success, 15 skipped, 0 failed; mergeable clean.
  • check-governed-merges --pr 36031: NOT governed, +737 / −14.
  • Round 2 (seat ruling A extended to the bundle path): MetadataProvider remembers the last app bundle that answered in this world; while a reloaded bundle is pending, viewsForObjects answers settled from it when it holds every asked object. Read side only; the refresh contract is unchanged.
  • Browser re-reading on the showcase stack at the fix (view and bundle reads each held 1.5 s): two picks and Publish draw no route skeleton and no remount; invalidate('object') still shows the skeleton (control A); a fresh open waits for the bundle (control B); the reader sees nothing before Publish and both footers after. Screens: build-seat1/35932/r2-*.png.
  • Clause-②: no. Metadata-protocol: none.
  • Overlap: one prop line with fix(ui): a view a read-only package ships hides only Delete in Manage views and opens its view panel read-only #36037 in ObjectView.tsx (keep handleDraftBarChange and add readOnly); whichever lands second merges main.
  • Next: L1-b review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT (L1-b)

Head-sha: 7001680 · read 2026-11-21T11:24Z · 6 files +737/−14 · checks at this head: 41 success · 15 expected skip · 0 failed · 0 pending · mergeable clean, merges clean onto main 8145424 (#36037 already in) · l1-face CLEAN

维护者速读: 管理员给共享视图存草稿(比如选底部合计方式、改视图设置)后,列表不再闪一下跳回已发布版本,连续改两次也会叠加,不会第二次覆盖第一次。做法是:刷新元数据时,已经拿到过的答复继续算"有答复",页面不回骨架屏、不重挂;有应用包的应用同理,用上一次的包内视图撑着,等新包下载完。这对所有刷新信号都生效(发布、装包、别的标签页改动),是"先显示旧的、后台换新的",不改变刷新约定。非管理员仍只看到发布后的视图。没有阻塞问题,两条小建议见下。

Must-fix

None.

Should-fix

None.

Nits

  • N1 — the last-answered bundle is not tied to its app. answeredBundleRef (MetadataProvider.tsx:1109, set at :1157) holds the last ready bundle of any app. AppBundleStore.peek() answers pending for a first entry into another app too (checkedAt === 0), so entering app X for the first time, with every asked object also in app Y's bundle, now settles on Y's views where it used to wait. Today that is harmless. The server puts every view bound to a served object in a bundle (meta-app-bundle-routes.ts:300-303), so a shared object carries the same views in both. But the comment and the changeset describe it as "a reload after a refresh pulse". Either key the held items by the app that answered them, or say in the comment that a first entry into another app takes the same path.
  • N2 — worth one browser look: Create view while in draft preview. Create announces the pulse and navigates to the new draft view. With the route kept mounted, resolvedViewId misses until listViews (refreshKey) or the in-place /meta/view refetch lands. That may show one frame of the default view plus the Requested view … not found warning, where the old path showed the skeleton. I have not run this. If it shows, it is a flash, not wrong data.

Checked

  • answered is set on a settled fetch (ready or error) and on the cached app item, and cleared only by a whole-type invalidate. refresh() and a lapsed TTL go through ensureType, which sets loading but keeps the items, so typeAnswered treats a refetch in place as answered. An error answer that is being retried stays settled, as error already did.
  • viewsForObjects: with the bundle ready, the code reads as before. With it pending, it falls back to the last-answered items only when they hold every asked object, and otherwise waits as before. The listed merge takes a list that is refetching in place. The no-bundle path settles on the held list. The unscoped object path's settled uses the same rule. Preview has peekBundle null, so it never reads the held bundle. dropAdapterWorld (organization or session switch) forgets it.
  • handleDraftBarChange: Publish or Discard sets the flag and bumps refreshKey. The effect drops viewDraft on the next savedViews change, which the listViews effect always produces, including on its catch (setSavedViews([])) and on the no-adapter branch. So the flag cannot go stale and later drop a draft being edited.
  • Tests: list path (no skeleton, no remount, two picks stack, reader sees the published view, CONTROL: invalidate('view') still waits). Bundle path (one mount through the reload, two picks then Publish, CONTROL: a first entry with no answered bundle waits, CONTROL: invalidate('object') shows the skeleton). Draft-bar handler unit test. The browser reading, 4 items with screenshots, is the thread's, not repeated here.
  • Shape: draft, Fixes #35932 (the card's whole ask: the list keeps the draft, and a second change builds on the first), one changeset @object-ui/app-shell patch, Clause-②: no · Metadata-protocol: none. The changeset states the side effect (every pulse keeps the drawn route).

Owed

  • L1 final at this head. To the seat for landing. N1 and N2 are the author's call, and neither blocks.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T11:25Z · The b1-DB area's PR for #35932: saving a list draft or publishing it no longer flashes the app skeleton or remounts the list. MetadataProvider changes only on the read side: it remembers the last answered app bundle of this world (cleared on an organisation or session change), and while the bundle reloads, viewsForObjects treats that answer as settled when it covers every object asked. The refresh contract (clearCache, the pulse, peekAppBundle's return) is unchanged. Side effect, stated in the body: during a reload the route shows the previous bundle's views, and the draft overlay keeps the draft on screen. The browser re-read on round 2 passed all four items, with both controls still distinguishing (invalidate('object') still remounts once; a first open still waits for the loading screen). Clause-②: no, no L2 owed. L1-b ACCEPT 7061871544 on 7001680d (this head). check-governed-merges --pr 36031 reads NOT governed (+737/−14). landing-k was not needed: the seat read K by hand, 9 since the merge base, under 15, and main since then touches neither translations/ nor skills/. On this head, 41 check-runs are success, 15 are skipped and none failed; mergeable clean. Two nits stay unfixed: the remembered bundle is not keyed by app (harmless today, as one object's views are the same in every bundle), and creating a view during a draft preview may flash the default view for a frame (not measured). #36037 resolves its one-line conflict in ObjectView.tsx when it merges main. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35932.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 11:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 55cd85f Nov 21, 2026
57 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35932-draft-save-no-remount branch November 21, 2026 11:45
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…es and publishes it; layout and row colour join the list draft (objectstack-ai#35955 PR 2) (objectstack-ai#36123)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuG6LywHEovAnGuZpiKQEc2W)_

repo:objectstack#1 · os-sales · session_01L6bhgWyeXh2Keywo6oK1Nn

Part of objectstack-ai#35955 (PR 2 of three: PR 1 objectstack-ai#36026 made a list change a draft;
PR 3 retires the server-side list preference and runs in parallel. The
card stays open.)

Clause-②: yes (widening) — five new `console.objectView.draft.*` keys in
every `@object-ui/i18n` locale pack (`saveToViewConfirmTitle`,
`saveToViewConfirm`, `saveToViewConfirmButton`, `savedForEveryone`,
`pendingDraft`); `@object-ui/plugin-list` `ListView` gains the optional
host prop `onRowColorChange` and two optional `viewDefaults` members,
`viewType` and `rowColor`; nothing removed or renamed
Metadata-protocol: none

## 维护者速读

- 共享视图上,能改这个视图的人(管理员,且视图所在的包接受保存)在「保存
▾」里也看到「保存到这个视图」:先问一次「所有用这个视图的人都会看到」,确认后存并立刻发布,提示「已保存,所有人可见」。选项菜单里的「保存」同一条路。
- 这个视图已有没发布的修改(谁存的都算)时什么都不写,提示先去视图设置里发布或放弃;不替任何人发布。保存人的行高、列宽不会写进共享视图。
- 显示面板的「布局」「行颜色」现在也是草稿:点开记录再回来还在,两条「保存」都会存进去,「放弃」还原成视图自己的。

## What changes

**Save to this view on a shared view** (`ObjectView.tsx`,
`objectViewViewCrud.tsx`, `runtime-metadata-persistence.ts`)

- Offered when `canSaveToSharedView`: not an environment list, not a
personal view, and the same test the footer calculation's pick uses
(`isAdmin && !activeViewPackageRefusesSaves && isSavedViewId(savedViews,
id)`), so a read-only package's view and the fallback tab never get it.
A personal view keeps its own save. The phone / narrow `Save ▾` is the
same component; the options menu's Save calls the same handler.
- It asks once through `confirmHandler` (`saveToViewConfirmTitle` /
`saveToViewConfirm` naming the view / `saveToViewConfirmButton`, cancel
`console.objectView.cancel`).
- The body is the view's own config with the draft laid over it
(`layListStateOverView`, split out of `buildPersonalViewConfig`), then
`buildViewConfigSaveBody`, the body the view settings panel saves. The
reader's row height is left out (`rowHeight: undefined` on the laid
preference, F5); column widths never travel.
- New `saveAndPublishRuntimeMetadata(type, name, body, ctx)`: a draft
write with the first-write pin (`{ mode: 'draft', ifNoneMatch: '*' }`),
then `publish`. A `409 METADATA_CONFLICT` on the write means a draft is
already pending; it resolves `'pending-draft'` and nothing is written or
published. A publish the server refuses discards the draft this save
wrote (`reset(type, name, { state: 'draft' })`) and rethrows. Caches are
invalidated and the draft ledger announced on both paths.
- `handleViewSaveAndPublish` shows the saved body at once
(`setViewDraft`) and lets `handleDraftBarChange` drop it when the
saved-views re-read lands (objectstack-ai#36031), so the list does not flash the old
sort. On `'published'` the list draft is dropped (`handleResetView`) and
"Saved, visible to everyone" is toasted; on `'pending-draft'` the draft
stays and `pendingDraft` is toasted.
- Using the server's pin instead of a client read of the draft closes
the read-then-write window the premise read named (P4). The window left
is between this save's draft write and its publish: the view settings
panel writes its draft without the pin, so a settings save landing in
those milliseconds would overwrite this draft and be published with it.
A known edge, not closed here: card objectstack-ai#36137.

**Layout and row colour join the draft** (`objectViewListRenderer.tsx`,
`ListView.tsx`, `personalViews.ts`)

- The renderer wires the published `onViewChange` to `listDraft.patch({
viewType })` and the new `onRowColorChange` to `listDraft.patch({
rowColor })`; picking the view's own value drops the entry. The draft's
values go to `ListView` as `schema.viewType` / `schema.rowColor`, and
the view's own through `viewDefaults.viewType` /
`viewDefaults.rowColor`, so the `layout` / `rowColor` parts and the
Display count still judge against the view after a remount.
- `ListView`: `onRowColorChange` fires on a pick in the row colour panel
(the rule in force) and on Clear (`null`), never at mount or for a
reset. Each new `viewDefaults` member is read only when its key is
present; without them nothing changes.
- Both saves read them: `PersonalViewListState.display` carries
`viewType` and `rowColor`; a layout switch retypes the view and fills
the kanban / gallery mirror from the saved columns when the block lacks
one (`IN_PLACE_COLUMN_MIRRORS`). Save as my view builds from
`listDraft.draft.viewType ?? activeView.type` and passes the row colour.

**i18n**: the five keys in all ten hand-written packs; zh-Hant
regenerated (`pnpm gen:zh-hant`).

**Docs**: `ui/packages/plugin-list/README.md` (new host-props section),
`content/docs/ui/views.mdx` (§ "A user's list state never writes the
view"), `docs/qa/platform-checklist/areas/records-forms.json`
`records-forms.adhoc-filter-sort-builder` revision 14 (steps[8],
acceptance[5], negative[4]; not loosened).

## Tests

- New `ObjectView.sharedViewSave-35955.test.tsx` (8): confirm, then
`save(... { mode: 'draft', ifNoneMatch: '*' })` then `publish`, body
carries the draft sort and the view's own row height `short` while the
reader's stored one is `tall`; cancel writes nothing; pending draft (409
`METADATA_CONFLICT`) writes nothing more and toasts; refused publish
resets the draft; a read-only package's view is not offered; layout and
row colour laid into the schema and `viewDefaults` and kept across a
remount; picking the view's own value drops it; the save retypes to
kanban with its columns mirror and the row colour.
- `runtime-metadata-persistence.test.ts` (+4): published; pending-draft;
a `409` with another code (`DESTRUCTIVE_CHANGE`) rethrows; refused
publish resets and rethrows.
- `ListView.personalization-28950.test.tsx` (+4): the `rowColor` part
judged against `viewDefaults`, a control without them,
`onRowColorChange` on pick and on Clear (`null`), and no call at mount.
- `ObjectView.personalViews-29635.test.tsx` (+1): the draft row colour
reaches the personal save and Save as my view.
- L1-b S1 (`ObjectView.sharedViewSave-35955.test.tsx` +3,
`ObjectView.personalViews-29635.test.tsx` +2): the confirm and Save as
my view's default name read the view's tab label (`listLabel`,
`viewTabLabel`), with a view that has no label and one whose label is a
locale map (plus a plain-label control on the confirm). Ablated: the raw
label turns the locale-map confirm case and both copy-name cases red. In
the shared-view harness a stored view with no label already arrives
named by its name, so that case is a pin, not a discriminator.
- `ObjectView.listUrlState-11860.test.tsx` (+2, G2): a reload whose
address was rewritten before the seed applies its `uf_*` state; a reload
on a record page then Back applies the list entry's `uf_*` state. Pins
of current behaviour, no behaviour change.

## Acceptance notes

- P3 (seat 14:28Z): any pending draft refuses, the saver's own earlier
draft too; the server does not record a draft's author.
- F5: a shared save never carries the saver's row height or column
widths; a personal save still carries the row height, as on main.
- The view settings panel and the footer calculation still save a shared
view as a draft that the view settings publish (ruling 7045525672
unchanged).
- Not touched: where column widths, row height and the view order are
stored (PR 3).
- Landing order with objectstack-ai#36133 (PR 3): both bump
`records-forms.adhoc-filter-sort-builder` to revision 14 and edit the
same section of `content/docs/ui/views.mdx`. Whichever lands second
renumbers to 15 and merges the two history entries.
- L1-b N1 taken: the pending-draft test is `isDraftVersionConflict` from
`DraftConflictDialog.tsx`, the predicate the other draft-door callers
use.

## Verification

CI and local runs at head `da8b797b`; the S1 commit's tests and type
check at `0ada6797`.

- CI: every check green (54 passed, 10 skipped by path), mergeable
clean. The first head (`433d7c02`) went red on four pins, each fixed in
its own commit: the `rowColor` firing control in
`object-view-unmirrored-keys-7779.test.ts` now reads `const
viewOwnRowColor = viewDef.rowColor ?? listSchema.rowColor;` (the relay
reads the view's own rule once, so the draft's can lie over it); the de
quote-pair count in `de-quote-pairing-3876.test.ts` goes 120 to 121 for
`saveToViewConfirm` („{{name}}“); three `viewDefaults` equalities in
`ObjectView.userListState-12418.test.tsx` gain `viewType`; a checker
narrowing in the new test is read through a cast. No pin was loosened:
each asserts the same thing at the new spelling.
- Local (`pnpm --dir ui exec vitest run` over
`app-shell/src/views/ObjectView*`, `runtime-metadata*`,
`personalViews*`, `listDraft*`, `plugin-list/src/__tests__/ListView*`):
237 files, 2290 tests; the only 3 failures were the `viewDefaults`
equalities above, 40/40 after the fix. `packages/i18n`: 105 files, 1962
passed. `packages/types` 7779: 236/236.
- `pnpm --dir ui/packages/app-shell run type-check` exit 0; `pnpm --dir
ui/packages/plugin-list run type-check` exit 0 (both include
`tsconfig.test.json`).
- eslint on every changed `ui/` source and test: 0 errors.
`check:i18n-keys`, `check:i18n-drift`, `check:control-bytes`,
`check:vi-mock-specifiers`, `check:vi-mock-override-shape`,
`check:metadata-write-doors`, `check:changeset-claims`,
`check:pending-changeset-literals`, `check:readme-exports`,
`check:new-line-citations` exit 0; `node
scripts/check-platform-checklist.mjs` OK.
- `node scripts/pm/overlap-check.mjs --base=origin/main`: clean against
main `dc10b3b4` and open objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024.
- Clause-② measured on the built
`ui/packages/plugin-list/dist/ListView.d.ts`: `onRowColorChange` and the
two `viewDefaults` members are added, optional; no member removed or
narrowed. The seat runs the declaration L2.
- Browser, at `0ada6797` (showcase `objectstack dev`, the `ui/` HMR
console pointed at it; checklist
`records-forms.adhoc-filter-sort-builder` steps[8]), on a shared view
the admin created and published (`showcase_task.team_tasks`, package
`com.example.showcase.custom`):
- admin, sort by Priority: Save offers "Save to this view"; the confirm
reads "Everyone who uses “Team tasks” will see these changes.";
confirming sends `PUT
/api/v1/meta/view/showcase_task.team_tasks?mode=draft` with
`If-None-Match: *` (200) then `POST …/publish` (200) and toasts "Saved,
visible to everyone"; Discard and Save go.
- a second reader who is not an administrator (`phone.demo@example.com`)
opens the view sorted by Priority, and after a sort of their own is
offered only "Save as my view". Control: on the read-only package's
`showcase_task.in_progress` the admin is offered only "Save as my view"
too.
- with a draft of the view already pending, the admin's confirmed save
gets `409` on the pinned `PUT`, sends no publish, toasts the
pending-draft hint and keeps Discard and Save; the pending draft is
still there afterwards and the live view unchanged.
- Not driven in the browser: the row height (F5) and the layout and row
colour round trip, pinned in the unit tests above.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgWyeXh2Keywo6oK1Nn

---
_Generated by [Claude Code](https://claude.ai/code)_
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgWyeXh2Keywo6oK1Nn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saving a shared view's draft reloads the whole list and shows the published version again until Publish

2 participants