Repository navigation
fix(studio): open system-scope packages read-only, with Customize - #29591
Merged
Merged
Conversation
The surface's write gate fell back to no verdict for a package the switcher's list leaves out; it now reads the listed row's server verdict, and the chip reads the surface's entry when the list does not carry the open package. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV3kBe3QqeCq1aYvu8
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T20:43ZHead-sha:
|
This was referenced Nov 2, 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 free
to 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.
Requested by Steedos · project thread
Fixes #29567
Clause-②: no
Metadata-protocol: none
The two lines are copied from the claim (comment 6586202344).
维护者速读
StudioDesignSurface.tsx里写入判定的 effect(切换器无条目时读listedPackageEntry);PackageSwitcher的current回退到新 propopenEntry;新测试StudioDesignSurface.kernelReadOnly-29567.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.kernelReadOnly-29567.test.tsx,预期 4 个用例全过(换回 main 的 StudioDesignSurface.tsx 时其中 3 个转红)。What changes
packages-io.ts: newlistedPackageEntry(manifests, id). APkgEntryfor any package the list names, read from the listed row (parseListedPackageManifests), the server'swritableverdict included. UnlikeparsePackagesit answers for a kernel package (manifest scopesystem/cloud), which the switcher's list still leaves out.parsePackagesis unchanged.StudioDesignSurface.tsx, the surface's write gate. When the switcher's entries do not carry the open package, the gate now readslistedPackageEntryinstead of settling on "no verdict". A system package therefore readswritable: false: the surface is read-only, the base facts (listed version, listed pair) are read, and the customization prop is built, so Customize runs the existing ensure path.pkgWritablestays "still asking" until that answer lands, so the surface never opens editable first. An id the list does not name still ends in "package not found", as before.PackageSwitcher(same file). New propopenEntry, the surface's entry for the open package. The trigger'scurrentfalls back to it once the list has answered, so the chip shows the package's name and the read-only lock. The menu is unchanged: kernel packages stay out of it, and "Manage package" still reads only the list's own entry.Tests
StudioDesignSurface.kernelReadOnly-29567.test.tsx. The realStudioDesignSurfaceand metadata client over a fetch stub that listscom.objectstack.plugin-auth(scopesystem, namespacesys,writable: false) beside a writable package. Pins: the chip names the package and showsstudio-pkg-readonly, and the menu still does not offer it; Customize is offered on its dashboard and the first edit POSTsensure-customization(201) and writes the pair's draft declaring the override at the listed version; a system package the door refuses (its manifest states no version, so the pair's^majorrange cannot be declared) shows Customize disabled with thenoVersionreason and never asks the door; CONTROL, a writable package opens with no chip and no Customize.packages-io.writableVerdict.test.ts: one case.listedPackageEntryanswers a system row with the server'swritable: falseand its namespace whileparsePackagesstill leaves it out, and answersnullfor an id the list does not name.StudioDesignSurface.tsxrestored to208d3e2e(git restore --source): 3 of the 4 new cases red (chip, Customize, door-refused), CONTROL green. Restored withgit checkout HEAD --,git diff HEADempty.scripts/ablation-replace.mjs,const current = listedCurrent ?? (…openEntry…)replaced bylistedCurrent, anchor 1 to 0): the two cases asserting the chip go red, the Customize case stays green (it reads the gate, not the chip). Restored: blob equals HEAD,git diff HEADempty.Acceptance notes
com.objectstack.plugin-auth.custom),foldCustomizationPairscannot fold it under a base the list leaves out, so the pair shows as its own row; opening it lands on the base through the existing pair URL redirect (customizationPairBaseOf; read in code, not measured). Noted, not changed.sysnamespace. Measured on a freshpnpm dev:crmat this head: 18 of the 25 listed packages are scopesystemwith namespacesys(plugin-auth, plugin-security, audit, rest.api, service-automation, service.settings and others).POST /api/v1/packages/com.objectstack.plugin-auth/ensure-customizationanswered 201 (sys_custom,^3); after it, the same door forcom.objectstack.plugin-securityandcom.objectstack.auditanswered422 NAMESPACE_CONFLICT("its namespace 'sys_custom' is already owned by package 'com.objectstack.plugin-auth.custom'"). So only the firstsyspackage can get a pair. The console cannot read that answer before asking (it is the registry's namespace owners), so such a package shows Customize and the refusal arrives at the first save, in the door's own sentence. Whether more than one system package should be customizable is outside this card and goes to the seat as a finding; the code is left as it is.writable(scope !== 'project') is unchanged, and it reads a scope-systemrow as writable; every current server serves the verdict on every row.Verification
All on head f933fef (base 208d3e2), in worktree
objectstack-issue-29567.Tests
pnpm --dir ui exec vitest run --maxWorkers=2over the 2 touched test files: 2 files, 11 tests passed.StudioDesignSurfaceorpackages-io(git grep -l), in five batches: 210 files passed, 1409 tests passed. Narrowed: CI's Test UI runs the rest of app-shell.pnpm --dir ui exec vitest run scripts/: 170 files passed, 2 skipped; 4972 tests passed.pnpm --filter @object-ui/app-shell run type-check(tsc --noEmitandtsc -p tsconfig.test.json): exit 0.pnpm exec eslintover the four touched ui files: exit 0, 0 errors (46 warnings, all on lines this PR does not touch).Gates
node scripts/pm/dispatch-gates.mjs --commands: 34 derived families. All 34 ran and exited 0, includingcheck-sdui-manifest.mjsand its--self-test,check-changeset-no-major,check-adr-0087-registration,check-closing-keyword-parity,check-empty-changesetandcheck:published-files.dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --dir ui check:new-line-citations: 0 new citations.!in the title and no (narrowing) arm.Generated by Claude Code