Repository navigation
fix(ui): a view a read-only package ships hides only Delete in Manage views and opens its view panel read-only - #36037
Conversation
…l and offers no Manage views writes 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
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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…urce 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
…; 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
…e console Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
|
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv Final green head · 2026-11-21T09:55Z · area b1-DB
|
|
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 Contract review brief — PR #36037 @
|
|
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. 维护者速读
Must-fix / Should-fixNone. Nits
Checked
Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Face: declaration, owed by ① Derived judgmentsPublic surface (published packages):
Accept-set changes in the console (
Graded findings:
No must-fix. ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
…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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv # Conflicts: # ui/packages/app-shell/src/views/ObjectView.tsx
…4's panel Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Delta round. It is judged against the previous record on Delta shape. I compared the PR's net change at the old head (against merge base
Check-runs on ① Derived judgmentsPublic surface: no change from the reviewed head. S1 from the previous record is resolved:
N1 is resolved. The hook's JSDoc now says "at most one N2 is left as is. It is disclosed in the New graded finding:
No must-fix, and no should-fix outstanding. ② Semver levelNo change.
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv Final green head (round 2, L2 S1) · 2026-11-21T12:41Z · area b1-DB
|
|
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
Merges
Nits
Owed
|
|
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. |
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-viewgains 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:
readonlyfor this, so the lock is not drawn: the row's label, pin and default are writable. Only its definition is not.readOnly, no edit reaches the list, and there is no draft bar. The footer shows only Close.The code changes are:
@object-ui/plugin-viewViewTabItem: new optionaldefinitionReadonly?: boolean, documented in its JSDoc. InManageViewsDialog,deleteActionis dropped and the config label switches toview.showViewConfig. Nothing else reads the field.readonlystill wins when both are set. Without the field a row behaves exactly as before.ViewTabBardoes not read it. This replaces the unpublishedreadonlyConfigViewablethat 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:useObjectViewTitleSwitcheraddsdefinitionReadonly: trueto a saved row whose served_packageIdthe session package list carries as read-only. It reads the list throughusePackagesRefusingSaves(ids)inuseStudioDesignGate.ts: the samepackageStudioPosture(...) === 'view'verdict, the same session-heldfetchSessionPackagesread (at most one GET /api/v1/packages per new package id per session; concurrent checks share it) and the same fail-open asusePackageRefusesSaves.ViewConfigPanelgains areadOnlyprop.ObjectViewpasses it in edit mode from the samerefusingPackagesset 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!activeViewPackageRefusesSavesgate.@object-ui/consoleis listed in the changeset because it bundles the private app-shell.Read first (risk order):
ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx: theviewTabItemsmap that setsdefinitionReadonlyfromrefusingPackages.ui/packages/plugin-view/src/ManageViewsDialog.tsx: thedeleteActionline and the config-entry label.ui/packages/app-shell/src/views/ObjectView.tsx: the Rename gate lift and the panel'sreadOnlyprop.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.tsxpasses. 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.tsxis new, with 8 cases. It runs the realObjectViewwith the realManageViewsDialogheld open,fetchSessionPackagesstubbed, and the panel replaced by a stand-in that records its props.readOnly: true. The custom row's entry opens it withreadOnly: false. The panel opened on each view directly agrees.ui/packages/app-shell/src/views/ObjectView.readOnlyPackageView-35933.test.tsx: the shipped-view case now expectsonRenameViewto 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, 'ManageViewsDialogdefinitionReadonly(objectstack#35974)', with 4 cases:onConfigView;readonlywins (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/SidebarItemMenuatc17e284dgaveTest Files 274 passed (274)·Tests 3589 passed | 13 skipped (3602)·VERDICT command-exit 0. The later head2e34976cchanges only the changeset. The whole@object-ui/app-shellpackage 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-checkat2e34976cgave threeDoneandVERDICT command-exit 0. Each package'stsconfig.test.jsonleg compiles its test files.Ablations: each ruling-B gate reverted once, restore proven
Every mutation went through
node scripts/ablation-replace.mjsinside 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 andgit diff HEADwas empty. Under the vitest alias,@object-ui/plugin-viewresolves tosrc, so nodist/is in the path. The suites used were the three ObjectView and plugin-view files at3f5c9478, 28 cases.isReadonly || definitionReadonly ? undefined : onDelete→isReadonly ? …): 3 failed.showViewConfig→editViewConfig): 4 failed.{ ...item, definitionReadonly: true } : item→item : item): 3 failed.!activeViewPackageRefusesSaves &&back): 1 failed (the 35933 case).readOnly={…}→readOnly={false}): 2 failed.!isReadonly && !!view.definitionReadonly→!!view.definitionReadonly): stayed green, 28 of 28.readonlyalready drops both entries the flag changes, so the check could not be observed.c17e284dremoves it, and the code now matches the ablated form.The panel's own guards (footer,
handlePatch, inspectorreadOnly, 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 buildat2e34976cwas followed bydiff -rof the declarations against a dist built from main-equivalent plugin-view source. The only difference is inViewTabBar.d.ts:definitionReadonly?: boolean;plus its JSDoc. The other 12.d.tsfiles are byte-identical.Measurements and browser check (showcase stand, console dev server on this branch)
The stand: backend
objectstack dev --seed-admin --fresh -p 4417inexamples/app-showcase, and a Console Vite server on :5417 (--strictPort) proxying to it. Signed in as the seeded admin, onshowcase_task, viewshowcase_task.in_progress(shipped bycom.example.showcase,writable: false). Both servers were stopped by PID afterwards.What the server refuses, measured before ruling B:
PUT /api/v1/meta/view/...?mode=draft, naming no package) →403, "save it into 'com.example.showcase.custom'".DELETE /api/v1/meta/view/showcase_task.in_progress) →403.What lands, through the UI on this branch:
POST /api/v1/packages/com.example.showcase/ensure-customization→201(created). ThenPUT /api/v1/meta/view/showcase_task.in_progress?package=com.example.showcase.custom→200, "Saved customization overlay", seq 1.200, then the same PUT →200, seq 2.showcase_task.defaultis cleared (PUT?package=com.example.showcase.custom→200, seq 3), thenin_progressis set (PUT →200, seq 4). No toast was shown.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 readusePackagesRefusingSaves. Two failures followed:The fix:
ObjectViewjudges the panel from therefusingPackagesset the rows are flagged from.useObjectViewTitleSwitchernow returns that set.configTargetId, cleared when the panel closes). The view switch from a non-active row lands in a router transition, after the panel opens.activeViewPackageRefusesSavesis still used for the calculation-menu gate.ViewConfigPanelturns read-only (edit mode) with unsaved or relayed edits, it runs Discard's revert without closing: the opening values are replayed throughonViewUpdate, so the list preview returns to the stored view, and the buffer resets to the stored view.usePackagesRefusingSaveskeeps 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:
readOnly: true. The panel stand-in records each render.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
60a4b3b7throughnode scripts/ablation-replace.mjsin a trap script, over the 35974 ObjectView file andViewConfigPanel.test.tsx(17 cases). In each, the anchor went from 1 hit to 0 and the blob changed. After restore the blob equalled HEAD andgit diff HEADwas empty, and the hash-object check passed for all three files.revertEdits()→void 0): 1 failed, the late-verdict case.readOnly={viewConfigPanelReadOnly}→ the oldactiveViewPackageRefusesSavesexpression): 1 failed, the non-active-row case.|| viewRefusesSaves(configTargetId)): 1 failed, the non-active-row case. This shows the transition frame is real.setAnswers(null)at the start of each read): 1 failed, the hook case.Round 2 runs
origin/mainwas merged twice, both times cleanly except the one fix(console): a shared view's draft save keeps the list on the draft, and a second change builds on the first #36031 line above. HEAD is now224cb17f. The app-shell dependency closure was rebuilt after the first merge:turbo run build --filter='@object-ui/app-shell^...', 68 of 68 successful.5f754fbc(224cb17fchanges only the changeset). The run coveredpackages/plugin-view/,packages/i18n/, the app-shellObjectView*,ViewConfigPanel*,objectViewTitleSwitcher*,objectViewViewCrud*,useStudioDesignGate*andSidebarItemMenu*files, andAppContent.draftSaveKeepsList-35932.test.tsx. Result:Test Files 276 passed (276)·Tests 3608 passed | 13 skipped (3621)·VERDICT command-exit 0.ec456e0d, threeDone. App-shell again at5f754fbc, after fix(console): a shared view's draft save keeps the list on the draft, and a second change builds on the first #36031's app-shell change:VERDICT command-exit 0.Acceptance notes
configTargetIdinObjectView.tsxclears only when the panel closes, so browser back/forward with the panel open can leave it read-only on a savable view until it is reopened. It only fails toward read-only.5f754fbc) kept both of itsonAfterChange={handleDraftBarChange}and this PR'sreadOnly={viewConfigPanelReadOnly}onViewConfigPanel. They compose:handleDraftBarChangeruns only from the draft bar, which a read-only panel does not mount, and the late-verdict discard below goes throughonViewUpdate.Verification
Derived gate families: 41 derived, 41 run, 0 NOT MEASURED, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat224cb17fderived 41 commands from 22 paths against merge base55cd85fc7. All 41 exited 0 at224cb17f.pnpm --dir ui exec vitest run scripts/gaveTest Files 172 passed | 2 skipped (174).pnpm check:changeset-fixedwas also run, exit 0. Its roster lives under.changeset/, where this PR edits a file, and it is outside the derivation.dispatch-gates --rangave "41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN".origin/mainhas since moved to615d9954(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.definitionReadonlyis 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/i18nadds one locale key.@object-ui/app-shellisprivate: true, and its new hook and prop are not re-exported.Overlap:
node scripts/pm/overlap-check.mjs --branch=HEADat224cb17fmerges cleanly withorigin/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