Skip to content

fix(ui): a view a read-only package ships hides only Delete in Manage views and opens its view panel read-only - #36037

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/issue-35974-readonly-package-view-saves
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/issue-35974-readonly-package-view-saves

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #35974

Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none — no authorable metadata changes (Metadata-protocol: none)

repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

This implements ruling B on this card: maintainer comment 7058654416, which amends 7057139393, and the claim amendment 7058659088. @object-ui/plugin-view gains one optional field, ViewTabItem.definitionReadonly. Restoring a shipped view to its factory version from the list page is follow-up #36011 and is not in this PR.

维护者速读

  • 管理员在只读包自带的列表视图上:「管理视图」里不再出现删除;重命名、置顶、设为默认照常可用并能保存;「查阅视图配置」打开只读的设置面板,没有保存。列表选项菜单里的重命名也恢复提供。
  • 属于列表页重做专题:替管理员去掉点了必被服务器拒绝的两个入口(删除、保存视图定义),保留服务器其实会接受的操作。
  • 出错时最坏是某个按钮多出或少了;读不到包列表时一切照旧提供、服务器照旧拒绝,可直接撤回本改动。
  • 要你做什么:现在不需要。

What changes

These rules apply to a view a read-only package ships, for example one of the showcase package's views:

The code changes are:

  • @object-ui/plugin-view ViewTabItem: new optional definitionReadonly?: boolean, documented in its JSDoc. In ManageViewsDialog, deleteAction is dropped and the config label switches to view.showViewConfig. Nothing else reads the field. readonly still wins when both are set. Without the field a row behaves exactly as before. ViewTabBar does not read it. This replaces the unpublished readonlyConfigViewable that the option-A rounds of this branch had added.
  • @object-ui/i18n: view.showViewConfig, with real text in all 11 locales. zh-Hant is generated from zh-Hans (gen:zh-hant).
  • @object-ui/app-shell:
    • useObjectViewTitleSwitcher adds definitionReadonly: true to a saved row whose served _packageId the session package list carries as read-only. It reads the list through usePackagesRefusingSaves(ids) in useStudioDesignGate.ts: the same packageStudioPosture(...) === 'view' verdict, the same session-held fetchSessionPackages read (at most one GET /api/v1/packages per new package id per session; concurrent checks share it) and the same fail-open as usePackageRefusesSaves.
    • ViewConfigPanel gains a readOnly prop. ObjectView passes it in edit mode from the same refusingPackages set that flags the rows, for the open view and for the view the panel was opened for (round 2, below).
    • ObjectView's options-menu Rename drops the !activeViewPackageRefusesSaves gate.
  • @object-ui/console is listed in the changeset because it bundles the private app-shell.

Read first (risk order):

  1. ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx: the viewTabItems map that sets definitionReadonly from refusingPackages.
  2. ui/packages/plugin-view/src/ManageViewsDialog.tsx: the deleteAction line and the config-entry label.
  3. ui/packages/app-shell/src/views/ObjectView.tsx: the Rename gate lift and the panel's readOnly prop.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx passes. The case 'Manage views: the shipped row offers everything but Delete and "View config"; the custom row is unchanged' drives the real dialog from the real ObjectView.

Tests

  • ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx is new, with 8 cases. It runs the real ObjectView with the real ManageViewsDialog held open, fetchSessionPackages stubbed, and the panel replaced by a stand-in that records its props.
    • The shipped row has pin and set default, no lock, and its menu holds Rename, View config, Set as default and Pin, with no Delete. The custom row keeps all five entries with "Edit view config".
    • The shipped row's "View config" opens the panel in edit mode with readOnly: true. The custom row's entry opens it with readOnly: false. The panel opened on each view directly agrees.
    • The reader's own view is unchanged.
    • An unread package list and a failed read each leave every offer in place.
  • ui/packages/app-shell/src/views/ObjectView.readOnlyPackageView-35933.test.tsx: the shipped-view case now expects onRenameView to be wired, and the calculation menu stays absent.
  • ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx (the panel's harness) has a top-level describe, 'ViewConfigPanel — read-only (objectstack#35974)', with 2 cases: Close only and no draft bar; the inspector is read-only and relays no patch.
  • ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx (the dialog's read-only harness) has a top-level describe, 'ManageViewsDialog definitionReadonly (objectstack#35974)', with 4 cases:
    • the flagged row offers rename, View config, set default and pin, with no Delete and no lock;
    • View config calls onConfigView;
    • without the flag nothing changes (six entries, "Edit view config", Delete present), which pins the no-flag behaviour;
    • readonly wins (no menu, lock drawn).
Affected suites: 274 files passed

pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-view/ packages/i18n/ packages/app-shell/src/views/ObjectView packages/app-shell/src/views/ViewConfigPanel packages/app-shell/src/views/objectViewTitleSwitcher packages/app-shell/src/hooks/useStudioDesignGate packages/app-shell/src/layout/SidebarItemMenu at c17e284d gave Test Files 274 passed (274) · Tests 3589 passed | 13 skipped (3602) · VERDICT command-exit 0. The later head 2e34976c changes only the changeset. The whole @object-ui/app-shell package is declared to CI's Test UI shards.

Type-check: plugin-view, i18n, app-shell exit 0

pnpm --dir ui --workspace-concurrency=2 --filter @object-ui/plugin-view --filter @object-ui/i18n --filter @object-ui/app-shell run type-check at 2e34976c gave three Done and VERDICT command-exit 0. Each package's tsconfig.test.json leg compiles its test files.

Ablations: each ruling-B gate reverted once, restore proven

Every mutation went through node scripts/ablation-replace.mjs inside a script with an EXIT/INT/TERM trap. In each, the anchor went from 1 hit to 0 and the blob changed. After restore the blob equalled HEAD and git diff HEAD was empty. Under the vitest alias, @object-ui/plugin-view resolves to src, so no dist/ is in the path. The suites used were the three ObjectView and plugin-view files at 3f5c9478, 28 cases.

  1. Delete gate (isReadonly || definitionReadonly ? undefined : onDelete → isReadonly ? …): 3 failed.
  2. Label (showViewConfig → editViewConfig): 4 failed.
  3. App-shell flag ({ ...item, definitionReadonly: true } : item → item : item): 3 failed.
  4. Rename lift (put !activeViewPackageRefusesSaves && back): 1 failed (the 35933 case).
  5. Panel prop (readOnly={…} → readOnly={false}): 2 failed.
  6. Derivation (!isReadonly && !!view.definitionReadonly → !!view.definitionReadonly): stayed green, 28 of 28. readonly already drops both entries the flag changes, so the check could not be observed. c17e284d removes it, and the code now matches the ablated form.

The panel's own guards (footer, handlePatch, inspector readOnly, draft bar) were each ablated in the earlier round, and each turned its own case red. Those lines are unchanged since.

Built declaration: the one widening

pnpm --dir ui --filter @object-ui/plugin-view build at 2e34976c was followed by diff -r of the declarations against a dist built from main-equivalent plugin-view source. The only difference is in ViewTabBar.d.ts: definitionReadonly?: boolean; plus its JSDoc. The other 12 .d.ts files are byte-identical.

Measurements and browser check (showcase stand, console dev server on this branch)

The stand: backend objectstack dev --seed-admin --fresh -p 4417 in examples/app-showcase, and a Console Vite server on :5417 (--strictPort) proxying to it. Signed in as the seeded admin, on showcase_task, view showcase_task.in_progress (shipped by com.example.showcase, writable: false). Both servers were stopped by PID afterwards.

What the server refuses, measured before ruling B:

  • The panel's save (PUT /api/v1/meta/view/...?mode=draft, naming no package) → 403, "save it into 'com.example.showcase.custom'".
  • Delete (DELETE /api/v1/meta/view/showcase_task.in_progress) → 403.

What lands, through the UI on this branch:

  • Before: the row shows no lock, with Pin and the default star present. The menu holds Rename, View config, Set as Default and Pin View, with no Delete.
  • Rename to "Renamed In Progress": POST /api/v1/packages/com.example.showcase/ensure-customization → 201 (created). Then PUT /api/v1/meta/view/showcase_task.in_progress?package=com.example.showcase.custom → 200, "Saved customization overlay", seq 1.
  • Pin: ensure-customization → 200, then the same PUT → 200, seq 2.
  • Set as default: the shipped default showcase_task.default is cleared (PUT ?package=com.example.showcase.custom → 200, seq 3), then in_progress is set (PUT → 200, seq 4). No toast was shown.
  • After a reload: the row reads "Renamed In Progress" with the default badge, which is the only default badge. The pin control reads "Unpin View". The menu holds Rename, View config and Unpin View, with no Delete.
  • View config opens the panel. Save: absent. Discard: absent. Footer: "Close". The label input shows "Renamed In Progress". The only enabled controls are section expanders, one input and Close. Nothing was written while the panel was open.

Round 2 (L2 S1)

The L2 record 7060948822 raised should-fix S1. The panel's read-only verdict came from a second, per-view hook (usePackageRefusesSaves) that answers "not read-only" until its own read settles, while the Manage views rows read usePackagesRefusingSaves. Two failures followed:

  • "View config" on a shipped row opened from another package's view drew an editable frame first.
  • A verdict arriving after an edit stranded the edit: no Discard, the list preview kept the edit, and the read-only panel showed it in place of the stored view.

The fix:

  • Same verdict. ObjectView judges the panel from the refusingPackages set the rows are flagged from. useObjectViewTitleSwitcher now returns that set.
    • The panel is judged for the open view and also for the view the panel was opened for (configTargetId, cleared when the panel closes). The view switch from a non-active row lands in a router transition, after the panel opens.
    • activeViewPackageRefusesSaves is still used for the calculation-menu gate.
  • Late verdict. When ViewConfigPanel turns read-only (edit mode) with unsaved or relayed edits, it runs Discard's revert without closing: the opening values are replayed through onViewUpdate, so the list preview returns to the stored view, and the buffer resets to the stored view.
  • Answers kept per package. usePackagesRefusingSaves keeps each package's answer for the session as it lands. A change to the list of ids (a refetch that brings a view of a new package) no longer blanks the set, so an open panel cannot flip back to savable.

New cases:

  • the 35974 ObjectView file, "View config" on a shipped row while another package's view is open: every render of the open panel after the click has readOnly: true. The panel stand-in records each render.
  • the 35974 ObjectView file, a new package id joining the list takes back none of what is known (a hook probe).
  • ViewConfigPanel.test.tsx, a verdict landing after an edit: the opening columns are replayed, the panel shows them, it is read-only with no Discard or Save, it stays open, and a later edit relays nothing.
  • ViewConfigPanel.test.tsx, a verdict landing before any edit relays nothing.
Round 2 ablations: each guard once, all red, restore proven

Run at 60a4b3b7 through node scripts/ablation-replace.mjs in a trap script, over the 35974 ObjectView file and ViewConfigPanel.test.tsx (17 cases). In each, the anchor went from 1 hit to 0 and the blob changed. After restore the blob equalled HEAD and git diff HEAD was empty, and the hash-object check passed for all three files.

  1. Late discard (revertEdits() → void 0): 1 failed, the late-verdict case.
  2. Same verdict (readOnly={viewConfigPanelReadOnly} → the old activeViewPackageRefusesSaves expression): 1 failed, the non-active-row case.
  3. Opened-for target (drop || viewRefusesSaves(configTargetId)): 1 failed, the non-active-row case. This shows the transition frame is real.
  4. Per-package answers (setAnswers(null) at the start of each read): 1 failed, the hook case.
Round 2 runs

Acceptance notes

Verification

Derived gate families: 41 derived, 41 run, 0 NOT MEASURED, all exit 0

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 224cb17f derived 41 commands from 22 paths against merge base 55cd85fc7. All 41 exited 0 at 224cb17f. pnpm --dir ui exec vitest run scripts/ gave Test Files 172 passed | 2 skipped (174).

pnpm check:changeset-fixed was also run, exit 0. Its roster lives under .changeset/, where this PR edits a file, and it is outside the derivation.

dispatch-gates --ran gave "41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN". origin/main has since moved to 615d9954 (2 commits); the tool reports that neither touches what the derivation reads.

The type-check lanes, the artifact-roster families and the wide-population families are CI's; their check-runs are the record.

Clause-② measurement: yes (widening)

ViewTabItem.definitionReadonly is an optional field on a type exported from @object-ui/plugin-view's entry. When it is absent, behaviour is unchanged, which the plugin-view case 'without the flag' pins. @object-ui/i18n adds one locale key. @object-ui/app-shell is private: true, and its new hook and prop are not re-exported.

Overlap: node scripts/pm/overlap-check.mjs --branch=HEAD at 224cb17f merges cleanly with origin/main (55cd85fc, which contains #36031) and with #36054, #36038, #36026 and #36024. VERDICT clean exit 0.


🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv

…l and offers no Manage views writes

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…g, which opens the panel read-only

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…; definitionReadonly replaces readonlyConfigViewable

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…s menu; tests follow ruling B

Rename lands in the package's customization pair through updateView
(ensure-customization, then PUT ...?package=BASE.custom -> 200, read back
after reload), so the options-menu Rename hidden for such a view is offered
again. The calculation-menu gate is unchanged.

Tests: the factory row offers rename, pin and set default, not Delete;
View config opens the panel read-only; custom rows and the unread or failed
package list keep every action.

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

readonly already removes both Manage views entries the flag changes (Delete
and the configuration entry), so the check could not fail a test (ablated:
the suites stayed green).

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

Final green head · 2026-11-21T09:55Z · area b1-DB

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T09:56Z. The brief handed to the isolated declaration-face reviewer for PR #36037 (owed by the changeset's Clause-②: yes (widening) line). The record follows as its own comment.

Contract review brief — PR #36037 @ 2e34976cd9d1b6a7710568624a055d96abc53e8f (card #35974)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35974: its body and EVERY comment (rulings and earlier records included)
· PR #36037: its body, its file list, and the net diff against main at 2e34976cd9d1b6a7710568624a055d96abc53e8f
· the check-runs on 2e34976cd9d1b6a7710568624a055d96abc53e8f: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36037/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT (L1-b)

Head-sha: 2e34976 · read 2026-11-21T09:57Z · full read of 9a98a46..2e34976 (22 files, +558/−31), against card #35974, ruling 7057139393 as amended by ruling B 7058654416, and the claim with its amendments 7057996821 / 7058659088.

维护者速读

  • 按裁定 B 做:只读包自带的视图在「管理视图」里只去掉「删除」;重命名、置顶、设为默认照常可用,这些改动会存进该包的定制包里。
  • 「查阅视图配置」能打开设置面板,但只能看不能改:面板里只有「关闭」,没有保存,也没有草稿条。列表选项菜单里的「重命名」恢复了。
  • 包的「可写」结论还没读到或读取失败时,一切照旧,仍由服务端拒绝写入,和 Footer calculation menu is offered on read-only package views; the list-view rows lose _packageId so the UI cannot tell them apart #35933 的做法一致。普通共享视图和个人视图不受影响。
  • CI 全绿,可合并状态为 clean。

Must-fix / Should-fix

None.

Nits

  • N1 — The panel's readOnly comes from activeViewPackageRefusesSaves, the active view's posture. "View config" on a row that is not the active view switches to it first (handleConfigView → handleViewChange) and opens the panel in the same tick. For an id the session list has not answered yet, the posture is unknown for that moment, so the panel can draw editable for a frame before turning read-only. This is fail-open by the ruling, since the server still refuses the save. Noted only.
  • N2 — The changeset lists @object-ui/console: patch, but the PR touches no ui/apps/console file. This is harmless if it follows the convention that an app-shell fix shipping in the console names it. If not, the line can go.

Checked

  • Ruling B, item by item. ManageViewsDialog: deleteAction is dropped for definitionReadonly. Rename, duplicate, pin, set default and config stay, and config reads 「查阅视图配置」 with an Eye icon (view.showViewConfig, new in all 11 packs; zh-Hant generated). readonly still wins, because it already drops those entries. In ObjectView, the options-menu Rename gate loses !activeViewPackageRefusesSaves, which lifts fix(ui): a view a read-only package ships offers no footer calculation menu and no Rename #35975's hiding; the thread measured a rename through the customization pair at 200, as the ruling asks. ViewConfigPanel readOnly: handlePatch returns before the draft or onViewUpdate, the inspector gets readOnly, RuntimeDraftBar is not drawn, and the footer is Close only (common.close). It applies to mode === 'edit' only, so creating a view is unaffected.
  • Verdict source. usePackagesRefusingSaves reads the same session-held fetchSessionPackages answer and packageStudioPosture(...) === 'view' that Footer calculation menu is offered on read-only package views; the list-view rows lose _packageId so the UI cannot tell them apart #35933's single-id hook reads. It is keyed on the sorted unique ids (stable against fresh arrays), drops a stale answer by key and session, and fails open when an id is unread, rejected or unlisted. It is only asked for admins, the only readers of Manage views. Rows are matched by studioPackageId of the served row, and a readonly row is left untouched.
  • Tests. The new ObjectView.readOnlyPackageViewSaves-35974.test.tsx covers Manage views on a shipped row versus a custom row, View config opening read-only, the custom row opening savable, a customization-package shared view not read-only, the reader's own view unchanged, and both fail-open cases (unread and failed). readonlyViewMenus-10209.test.tsx covers the flag's three row shapes and readonly winning. ViewConfigPanel.test.tsx covers read-only versus savable. The Footer calculation menu is offered on read-only package views; the list-view rows lose _packageId so the UI cannot tell them apart #35933 test's Rename expectation flips with its card reference.
  • Clause-② widening. ViewTabItem.definitionReadonly?: boolean (optional, documented) plus one i18n key; nothing removed. app-shell is private. The changeset matches the code sentence by sentence (only Delete hidden, View config read-only and Close only, Rename back, fail-open, ViewTabBar does not read the flag).
  • Scope. The files are inside the amended claim surface. The adjacent-line overlap with fix(console): a shared view's draft save keeps the list on the draft, and a second change builds on the first #36031 in ObjectView.tsx is the thread's to resolve at merge (both lines kept).
  • l1-face at 2e34976: CLEAN. 45 success, 13 expected skip, 0 failed, 0 pending; mergeable_state clean; Fixes #35974 delivers the whole card as amended.

Owed

  • None from L1. The L1 is final at this green head.
  • The declaration L2 and landing are the seat's. This L1 does not replace the L2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 2e34976cd9d1b6a7710568624a055d96abc53e8f
Local-runs: none

Face: declaration, owed by Clause-②: yes (widening) on the PR body and on .changeset/35974-read-only-package-view-panel.md. Inputs read: card #35974 (body, triage, ruling 7057139393, claim 7057506464, amendment 7057996821, ruling B 7058654416, amendment 7058659088), the PR #36037 body and file list (22 files, +558 / -31), the net diff against main (merge base 9a98a4675), and the 58 check-runs on the head: 45 success, 13 skipped, 0 failed. Check Changeset, Type Check UI, Lint UI, Test UI 1-16, TypeScript Type Check, Lint & Repo Gates and every Lint · / Type Check · leg are green. UI Published Artifacts is skipped by its workflow condition (github.event_name != 'pull_request'), which is expected on a PR. It is not a gap.

① Derived judgments

Public surface (published packages):

  1. @object-ui/plugin-view, ViewTabItem.definitionReadonly?: boolean (ViewTabBar.tsx): one new optional member on an exported type. Nothing is removed or renamed. RIGHT. This is the widening the claim amendment declared. With the member absent, ManageViewsDialog resolves every action exactly as before. The only behaviour change is deleteAction = isReadonly || definitionReadonly ? undefined : onDelete plus the config-entry label and icon (Eye and view.showViewConfig against Pencil and view.editViewConfig). readonly still wins, because configAction, setDefaultAction, pinAction and deleteAction are all undefined under it. The plugin-view case 'without the flag' pins the no-flag behaviour.
  2. @object-ui/plugin-view, ManageViewsDialog render: the new Eye icon import from lucide-react adds no dependency. RIGHT.
  3. @object-ui/i18n, view.showViewConfig: one added key, present in all 11 locales, each in its own language (zh-Hant 查閱檢視配置, generated from zh-Hans 查阅视图配置). Nothing is removed. RIGHT, and additive.

Accept-set changes in the console (@object-ui/app-shell, private, bundled into @object-ui/console), judged against ruling B (7058654416) and amendment 7058659088:

  1. Manage views hides only Delete on a row a read-only package ships. Rename, pin and set as default stay, and no lock is drawn. RIGHT, as ruling B states it. Rows are flagged in useObjectViewTitleSwitcher from usePackagesRefusingSaves(ids): the same packageStudioPosture(...) === 'view' verdict and the same session-held fetchSessionPackages as Footer calculation menu is offered on read-only package views; the list-view rows lose _packageId so the UI cannot tell them apart #35933/fix(ui): a view a read-only package ships offers no footer calculation menu and no Rename #35975. The read is admin-only (isAdmin ? ... : []), matching ObjectView's own admin-only read. A row that already has readonly is left untouched.
  2. The view panel opens read-only from "View config". RIGHT (ruling 7057139393 A, kept by ruling B). ViewConfigPanel.readOnly: handlePatch returns early, the inspector gets readOnly, RuntimeDraftBar is not mounted, and the footer is Close only. handleSave and handleDiscard have no other callers, so there is no keyboard or second save path. ObjectView passes readOnly={viewConfigPanelMode === 'edit' && activeViewPackageRefusesSaves}, so create mode on a shipped view (a new view) stays savable. That is correct.
  3. The options-menu Rename gate (!activeViewPackageRefusesSaves) is lifted. RIGHT. Ruling B orders the lift "after one measured rename through the customization pair", and the PR records it: ensure-customization returned 201, then PUT ...?package=com.example.showcase.custom returned 200, with read-back after reload. The calculation-menu (pickSummary) gate stays, which is correct because that pick saves through the panel's refused path.
  4. Delete has no other surface in the console. The title switcher's Delete is for personal views only, and ViewTabBar is no longer rendered by app-shell. RIGHT. The acceptance "Manage Views offers no ... delete" is complete.
  5. Fail-open: an unread, failed or unlisted package leaves the id out of the set and the row keeps every offer. RIGHT, and it matches fix(ui): a view a read-only package ships offers no footer calculation menu and no Rename #35975. The 35974 suite pins both the unread and the failed case.
  6. Unchanged surfaces: a custom shared view in the .custom package, the reader's own view, and toolbar personal state (listPrefs). RIGHT, each pinned by a case.

Graded findings:

  • should-fix S1 (ObjectView.tsx, the readOnly prop). The panel's readOnly comes from usePackageRefusesSaves(studioPackageId(activeSavedViewRow)), which returns null (so not read-only) on every render until its effect's promise settles for a new package id. The manage-views row flag comes from a different hook. Two consequences follow:
    (a) "View config" on a shipped row while a view from another package is active (for example, the .custom view) runs handleViewChange and then opens the panel. The panel paints at least once with Save, Discard and the draft bar before it flips read-only. The 35974 case 'the shipped row's "View config" opens the panel on that view, read-only' asserts through waitFor, so it cannot see the flip.
    (b) Worse: while the session list is still unread (fetchSessionPackages waits up to SESSION_PACKAGE_READ_MAX_WAIT_MS = 8 s for quiet), the admin gets an editable panel (fail-open, correct). Edits reach handleViewUpdate and ObjectView's viewDraft. When the verdict then arrives, the panel flips read-only and Discard disappears. Close is onClose only and does not clear viewDraft, so the local preview edit is stranded, and the "read-only" panel shows the draft rather than the stored config.
    Nothing wrong reaches the server, because the save is still refused. Suggested fix: when readOnly turns true with a draft present, run the discard path (revert through onViewUpdate or setViewDraft(null)). Or derive the panel's verdict from the same set the dialog row used, so the two agree in the same render. This does not block the verdict.
  • nit N1 (PR body, "no new request"). fetchSessionPackages answers from the hold only for an id the hold lists or has already marked unlisted. Every saved-view row is now asked about, not only the active one. So a row served under a package the list leaves out (the PR says kernel packages are left out) can cost one more GET /api/v1/packages re-read per new id per session. Concurrent asks share one request. This is the documented contract of fetchSessionPackages, and it is bounded, but "no new request" is slightly too strong.
  • nit N2 (ViewTabBar.tsx JSDoc). definitionReadonly sits on the shared ViewTabItem, but only ManageViewsDialog honours it. The published ViewTabBar still offers Delete on such a row to a third-party host. The JSDoc says so ("ViewTabBar does not read it"), so this is disclosed, not a defect.

No must-fix.

② Semver level

  • @object-ui/plugin-view: patch. The diff publishes one optional member on an exported type, a non-protocol widening. AGENTS.md (changeset rule 3) says a non-protocol change, widening or breaking, ships patch. The level is correct. The built-declaration comparison in the PR body (only ViewTabBar.d.ts differs, by that member) agrees with the source diff.
  • @object-ui/i18n: patch. One added key. Correct.
  • @object-ui/app-shell: patch (private) and @object-ui/console: patch (bundles app-shell). These are consistent with the fixed group, and Check Changeset is green.
  • Metadata-protocol: none. RIGHT. ViewTabItem is a host prop shape, not authorable metadata, and no spec key or accepted value moves. Skills-docs: none follows.
  • Clause-②: yes (widening) is on both the PR body and the changeset body, line-initial. It is well-formed, it matches the diff (one added optional member, nothing narrowed), and it matches claim amendments 7057996821 and 7058659088. The original claim's provisional Clause-②: no was properly amended once a published plugin-view member became necessary.

③ Boundary flags

Implemented-by: claude/issue-35974-readonly-package-view-saves
Reviewed-by: isolated L2 sub-agent of seat session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

…ew its Manage views row

The panel read a second, per-view package verdict that answers "not
read-only" until its own read settles. A shipped row's "View config" opened
from another package's view could draw an editable frame, and a verdict
landing after an edit stranded that edit with no Discard.

- ObjectView judges the panel from the same refusingPackages set the rows
  are flagged from, for the open view and for the view the panel was opened
  for (the view switch lands in a transition, after the panel opens).
- ViewConfigPanel discards unsaved edits when it turns read-only: the list's
  preview is restored and the panel shows the stored view.
- usePackagesRefusingSaves keeps each package's answer as it lands, so a
  change to the list of ids never makes an open panel savable again.

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

# Conflicts:
#	ui/packages/app-shell/src/views/ObjectView.tsx
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 224cb17fc2f71d24a4d77d0ca2a70475a7518780
Local-runs: none

Delta round. It is judged against the previous record on 2e34976cd9d1b6a7710568624a055d96abc53e8f (PASS, with should-fix S1 and nits N1 and N2).

Delta shape. I compared the PR's net change at the old head (against merge base 9a98a4675) with its net change at the new head (against merge base 55cd85fc7). This sets aside the two merges of origin/main (#36031, #36040, #35983, #35968, #35886, among others).

Check-runs on 224cb17f at 2026-11-21T12:22Z: CI is still running. 59 runs: 13 success, 15 skipped, 31 in progress, 0 failed. Still in progress: Test UI 1-16, Type Check UI, Lint UI, Check Changeset, Build & E2E UI, Live E2E UI, and every Lint · / Type Check · leg. Their conclusions are the gate verdicts, and none has concluded yet. This record judges the contract; it does not replace those verdicts.

① Derived judgments

Public surface: no change from the reviewed head. ViewTabItem.definitionReadonly?: boolean and view.showViewConfig are byte-for-byte as reviewed. The new refusingPackages member of useObjectViewTitleSwitcher's return is internal to the private @object-ui/app-shell. RIGHT.

S1 from the previous record is resolved:

  1. The verdict now comes from one source, and the row and the panel agree in the same render. RIGHT. ObjectView judges the panel with viewRefusesSaves(id) over the same refusingPackages set that set definitionReadonly on the Manage views row. It judges both the open view and configTargetId, the view the row's entry was opened for. configTargetId covers the router transition: handleConfigView → handleViewChange → navigate lands after the panel opens.
    • The non-active-row case now records every render of the panel stand-in and asserts that all of them have readOnly: true. That closes the gap that waitFor hid in the earlier case.
    • The PR body's ablation 3 (dropping the configTargetId arm turns that case red) shows the transition frame is real.
    • activeViewPackageRefusesSaves still gates the calculation menu only. That is correct.
  2. A late verdict no longer strands an edit. RIGHT. handleDiscard's revert was extracted unchanged as revertEdits. When readOnly goes from false to true in edit mode with isDirty or forwarded keys (relayedRef), the panel replays the opening values through onViewUpdate and resets the local draft without closing. So the list preview (viewDraft) and the read-only panel both show the stored view again.
    • wasReadOnlyRef makes this fire on the transition only, and the PR's ablation 1 pins it.
    • The case where the verdict lands after an edit asserts the replay of the opening columns, the absence of the replay of the edited ones, read-only state, no Discard or Save, and the panel staying open.
  3. Answers are kept per package. RIGHT. usePackagesRefusingSaves keeps a per-session map from package id to verdict, filled as each read lands. A change to the list of ids no longer blanks the set, so an open panel cannot flip back to savable after a refetch.
    • Fail-open holds. A failed read records nothing, and an unread or unlisted id is not in the answer.
    • A later read that reports the package writable still overwrites a refusing entry, so the map does not freeze a stale verdict.
    • The early return for an empty id list is gone, which is harmless because the loop is then empty.

N1 is resolved. The hook's JSDoc now says "at most one GET /api/v1/packages per new package id per session, concurrent asks sharing it". That matches fetchSessionPackages.

N2 is left as is. It is disclosed in the ViewTabItem JSDoc, and no change was required.

New graded finding:

  • nit N3 (ObjectView.tsx, configTargetId). configTargetId is cleared only when showViewConfigPanel becomes false. handleViewChange closes the panel on a real switch, so the title switcher and Manage views paths are covered. A route change that does not go through handleViewChange would keep the panel open with the stale target, for example browser back or forward while the panel is open. The panel would then stay read-only on a savable view until it is closed and reopened.
    • This fails closed: nothing is written, and Close and reopen clears it.
    • The fix is one line: clear the target when activeView?.id changes to something other than the target after the switch has landed, or key it to the route's view id.

No must-fix, and no should-fix outstanding.

② Semver level

No change.

  • The changeset still lists @object-ui/app-shell, @object-ui/console, @object-ui/plugin-view and @object-ui/i18n at patch.
  • Its only edit is one added sentence of prose about the late verdict, which is accurate to the code.
  • Clause-②: yes (widening) and Metadata-protocol: none are unchanged on both the changeset and the PR body, and they still match the diff. The published delta is nil, because the plugin-view and i18n hunks are unchanged.
  • Check Changeset is in progress on this head.

③ Boundary flags

  • Overlap with fix(console): a shared view's draft save keeps the list on the draft, and a second change builds on the first #36031: now merged. The adjacent line keeps both sides, as the earlier round said it would. Answered.
  • "Round 2 (L2 S1)" in the PR body: it states the four fixes, the four new cases and four ablations, each red once and then restored. This matches the diff. Answered.
  • open_questions: none.
  • SQL push-down (Prime Directive 5): no finding. The delta adds no server query and no id materialisation for a query. viewRefusesSaves is a savedViews.find(...) over the already-loaded client view list, and there is nothing it could push down to.

Implemented-by: claude/issue-35974-readonly-package-view-saves
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob (isolated L2 sub-agent of the seat)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

Final green head (round 2, L2 S1) · 2026-11-21T12:41Z · area b1-DB

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — delta ACCEPT (L1-b)

Head-sha: 224cb17 · read 2026-11-21T12:42Z · prior record ACCEPT 7060916097 @2e34976c · delta: 60a4b3b (the L2 S1 fix), 224cb17 (changeset), three merges of main · checks at this head: 49 success · 17 expected skip · 0 failed · mergeable clean

维护者速读: 这一轮把视图设置面板的"只读"判定改成和"管理视图"那一行用同一份答复,所以从某一行点"View config"不会再先打开一个能改的面板。如果只读答复来得晚、管理员已经改了几项,面板会变成只读并撤回这些改动,列表回到保存的样子,不会留下一份没处放弃的改动。合并 main 时和 #36031 冲突的那一行两边都保留了。没有新问题。

L2 S1: resolved

  • ObjectView.tsx: the panel's readOnly is now viewConfigPanelReadOnly, judged from refusingPackages. That is the set useObjectViewTitleSwitcher builds from the admin's savedViews and uses to mark the Manage views rows definitionReadonly. It checks both the open view and configTargetId, the view the row opened the panel for, because the view switch lands after the panel opens. configTargetId is cleared when the panel closes. A personal view, or a view with no package, gives null and stays savable, as before.
  • usePackagesRefusingSaves: each answer is kept per id for the session (a Map), so a refetch that adds a new package id does not drop what is already known. A session change starts fresh, and a failed read adds nothing (fail-open as before). The returned set is memoised on answers, key and session.
  • ViewConfigPanel: Discard's replay is now revertEdits. A readOnly going from false to true while the panel is dirty or has relayed keys replays the opening values through onViewUpdate and keeps the panel open. A panel that opens read-only, or a verdict that lands before any edit, replays nothing. Both paths are pinned.
  • Tests (4 new): no editable render after "View config" on a shipped row while another package's view is open; a new package id takes back nothing; a late verdict discards the edit and keeps the panel open; a verdict before any edit relays nothing.

Merges

Nits

  • N1: the footer calculation menu still reads activeViewPackageRefusesSaves (the single-id hook, ObjectView.tsx:848), while the panel and the rows read refusingPackages. Both come from the same session-held fetchSessionPackages answer, so they cannot disagree once it has landed, only for a frame while one hook's effect lags. No change asked.
  • The L2's N3 (browser back or forward with the panel open may rest read-only, erring only toward read-only) is noted in the body. I agree it errs the safe way.

Owed

  • The L1 is final at this head. To the seat for landing.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T12:43Z · The b1-DB PR for #35974: a view shipped by a package that refuses saves hides only Delete in Manage views, and its view panel opens read-only. The panel reads the same refusing-packages answer as its Manage views row, for both the open view and the view it was opened for. A panel that turns read-only mid-edit falls back to discard without closing, and answers are kept per package for the session. Clause-②: yes (widening). The seat's declaration-face L2 at TIER_DEFAULT read PASS on 2e34976c (7060948822, S1 should-fix) and the delta read PASS on 224cb17f (this head, 7062534252, nit N3 on back/forward left as a known nit). L1-b delta ACCEPT 7062761921 on the same head. check-governed-merges --pr 36037 reads NOT governed (+707/−50). The seat read K by hand: 4 first-parent commits since the merge base, under 15; main since then touches no translations/ bundle and three skills/ files this PR does not touch. On this head, 49 check-runs are success, 17 are skipped and none failed; mergeable clean. The one main-merge conflict (an ObjectView.tsx line shared with #36031) keeps both sides, and the L2 delta read it. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35974.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 12:44
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 27e414b Nov 21, 2026
67 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35974-readonly-package-view-saves branch November 21, 2026 13:15
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.

Read-only package views still offer view-settings save and the Manage Views pin / set default / delete actions, which the server refuses

2 participants