Uh oh!
There was an error while loading. Please reload this page.
fix(app-shell): Studio read-only packages stop advertising writability they do not have (#4036 B-half) - #4341
Merged
Conversation
…y they do not have (#4036) Two captions on the Studio package surfaces contradicted the controls beside them. Both are display-side defects — the interaction gating was already correct in each case, and this change does not touch it. `/studio/<pkg>/access` rendered a permission set's title row as `... · Security · writable · ...` while all 207 permission checkboxes and Save below it were disabled with the read-only-package tooltip. The two renderings answer the same question from different inputs: the controls read `!!resolved.allowOrgOverride && !readOnly` (type registry AND host package gate — the right answer), the badge read `entry.allowOrgOverride` alone, and `permission` is one of the overlay-allowed types, so the badge said "writable" in every package. PageShell now takes a `readOnly` host gate that dominates the type-level flag; the Access pillar passes the same value it already gives the matrix's controls, and the tooltip names the package as the reason by reusing the `engine.studio.pkg.readonly*` wording the Studio top bar and identity strip already use, rather than inventing a second spelling. The badge slot became one `WritabilityBadge` because it was duplicated verbatim in the compact and hero headers — the shape that lets a gate be honoured in one and forgotten in the other. The `Data -> Form` layout caption read `Draft layout — your unsaved changes` in a read-only package, with `Save draft` disabled and no draggable element on the surface. The mechanism was not a stale diff: the caption was selected by `formMode === 'layout'`, a TAB selector, so it asserted pending edits on every clean layout tab, read-only or not, while the component's real `dirty` flag sat a few lines below driving the preview warning. The claim now renders only for real local edits on a surface that can save them; a neutral `Draft layout` caption covers every other case. Nothing about the read-only policy changed. This is the B-half of the objectstack#5768 split ruling — Studio keeps its blanket package-level read-only while the A-half is under review — so both suites carry control tests asserting a read-only package still disables every checkbox, still offers no Save, and still exposes no add-field affordance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 11, 2026 17:56
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4036 — the B-half only. The card stays open: the A-half (whether the 15 overlay-allowed types become individually editable in Studio) is still pending upstream, and this PR leaves every gate exactly as policy-consistent as it found it.
The ruling this implements
objectstack-ai/objectstack#5768, maintainer half-ruling of 2026-08-06 — quoted verbatim and untranslated:
The policy the display is being made to cohere with, from the 裁决 comment in the same thread:
Studio 维持包级只读.So this is display-side only. No enable/disable gating, no save/publish path, and no part of the read-only policy is touched. The A-half review must find the surface exactly as it is today.
Two captions that contradicted the controls beside them
1. The
accessheader badge advertised "writable" above 207 disabled checkboxes/studio/:pkg/accessrendered a permission set's title row as... · Security · writable · ...while all 207 permission checkboxes and Save below it were disabled with the read-only-package tooltip. Both renderings answer the same question — can you write this? — from different inputs:!!resolved.allowOrgOverride && !readOnly, i.e. the type registry AND the host package gate, which is the right answer;entry.allowOrgOverridealone.permissionis one of the overlay-allowed types, so that flag is true and the badge said "writable" in every package, read-only or not.PageShellnow accepts areadOnlyhost gate that dominates the type-level flag, and the Studio Access pillar passes the same value it already hands the matrix's own controls. The tooltip names the package as the reason by reusing theengine.studio.pkg.readonly*wording the Studio top bar and the identity strip already use for this gate, rather than inventing a second spelling for one screen. The badge slot became a singleWritabilityBadgecomponent because it was duplicated verbatim in the compact and hero headers — precisely the shape that lets a gate be honoured in one header and forgotten in the other.2. The
Data → Formlayout caption claimed unsaved changes that could not existIn a read-only package the form tab read
Draft layout — your unsaved changeswithSave draftdisabled and no draggable element on the surface at all. The mechanism was not a stale diff: the caption was selected byformMode === 'layout'— a tab selector — so it asserted pending edits on every clean layout tab, read-only or not, while the component's realdirtyflag sat a few lines below driving the preview warning. The claim now renders only for real local edits on a surface that can save them; a neutralDraft layoutcaption (engine.studio.data.form.layoutBadgeClean, added to both locale tables) covers every other case, so the caption still names what you are looking at.Sweep for the same shape
Same-shape means "a display that answers a gate question from an input that is not the governing gate". On these screens there was nothing else:
readOnlyfor their own affordances;dirty/hasDraft), not from a tab selector;Tests, and the reverse verification
Two new suites, 9 tests. Predicted directions were written down before the fix was removed, and the run matched exactly: 4 red, 5 green.
Reverting only the four source files to
origin/mainand keeping the tests:The 5 that stay green are green on purpose, and one of them is an inverted case worth naming rather than dressing up as a red:
writable package with real unsaved edits: the claim renderspasses before and after. Pre-fix the caption was a constant claim, so of course it renders once you really edit. It is not a red-first test — it is the anti-deletion pin: without it, "suppress the false claim" could be satisfied by deleting the claim outright, taking the caption from always-lying to never-telling.Full ladder, all from the repo root:
pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/ packages/app-shell/src/views/studio-design/→ 164 files / 1638 passed, 1 skipped. ThePageShellrefactor touches every metadata-admin page's chrome, so the sweep is the whole consumption radius of the changed component, not just the two new files.--filter '@object-ui/app-shell^...' build), then both tsc projects:tsc --noEmit→ exit 0,tsc -p tsconfig.typetests.json→ exit 0.eslinton the six changed files → 0 errors, 38 warnings, all pre-existing and byte-identical onorigin/main(react-hooks/*on untouched effects, plus one unusedButtonimport inPageShell.tsxthatorigin/maincarries at the same line — not introduced here, and out of scope for this PR).check-control-bytesOK,check-i18n-call-site-keysOK,check-i18n-en-drift(0 en values changed),check-changeset-presence/-fixed/-no-majorOK.A changeset is included: the copy is user-visible.
Continuation note
The original agent on this card was killed by a host restart mid-implementation, leaving six uncommitted files in the worktree and nothing pushed. This PR inherits that work after judging each hunk against the ruling: all six were kept as correct, with the changeset added (it was missing) and the reverse verification and full ladder run here for the first time.
Generated by Claude Code