Repository navigation
feat(console): an admin can open a read-only package's app in Studio to look at it - #28076
Merged
Merged
Conversation
…to look at it The app bar and the app switcher drew their Studio entry only for a writable package's app. useStudioEntryGate answers the same gate with a posture: edit for a writable package (the pencil, unchanged), view for a read-only one (an eye, "Open app in Studio"). Kernel packages, including a flat-served kernel row, an unlisted package and an unread list draw neither. useStudioDesignGate is the edit half, so the sidebar Design entry and a page's pencil are as before. Two keys added in all ten locales. Claude-Session: https://claude.ai/code/session_01Utp6CZrsFMFmWFsxTaq2Bu Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe 席位核对ACCEPT · head
Generated by Claude Code |
This was referenced Oct 30, 2026
os-bill
added a commit
that referenced
this pull request
Oct 30, 2026
M1: name the ADR-0126 §9 first-bullet lift (badge, customization list, revert on served facts; diff-vs-base and the upgrade skip-report stay deferred; clone provenance untouched) and stop saying §9 "stands in full". S1: state the ADR-0070 D3 amendment for the paired case. S2: own the greyed-with-source presentation; cite ADR-0029 D7 for the contribution only. S3: correct the Context readings (directory hides field/package and shows the active package's types; dataset has a create dialog, no designer; the charter sentence is the file's doc comment; queue membership has no Setup section at this head, ADR-0142). S4: reachable provenance (ruling record 6520616687; the D1–D3 quotes have no GitHub record), restore the verbatim quote and mark the editorial note. S5: the ledger switch's authority and its disabled shape under a walled posture. S6: cite ADR-0141. S8: export "as ADR-0070 D4 lands". Note #28076 landing D5 ahead of the record. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CaRN6wdrRyLKJSCMYH
os-bill
added a commit
that referenced
this pull request
Oct 30, 2026
S9: the paired package is exported, duplicated and deleted as any writable package is; the export door is on the runtime route ledger. S10: the ledger switch's disabled shape reads the two served posture facts the walled catalog doors read; no client copy of the gate's sentence; "naming the platform operator". S11: D4's quote is on the card in part, D5 and D6 in full. S12: #28076 merged; ADR-0141 marked Proposed with its mechanisms on main; "the row-20 cards"; the create door sets the base's namespace explicitly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CaRN6wdrRyLKJSCMYH
This was referenced Oct 30, 2026
This was referenced Nov 1, 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 Bill · project thread
维护者速读
hooks/useStudioDesignGate.ts的useStudioEntryGate(同一次writable读出 edit / view 两种姿态),AppHeader.tsx顶栏按钮,AppSwitcher.tsx的 Studio 行。pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/AppHeader.editAppFollowsPackagePosture-12615.test.tsx packages/app-shell/src/layout/__tests__/AppSwitcher.homeMenu-12605.test.tsx,应见 2 files passed。Part of #27356 (row 12, hotcrm#2320 Studio S1: a read-only package's app opens in Studio to look at it; maintainer-ruled B, comment 6520616687)
Clause-②: no
Metadata-protocol: none
What changes
useStudioEntryGate(path)(new,hooks/useStudioDesignGate.ts) reads the same two halves as before (a workspace admin holdingmanage_metadata; the package as Studio's package list carries it) and answers{ path, posture }:editfor a package the list carrieswritable,viewfor one it carries read-only,nullotherwise. The posture comes from the server'swritableverdict read once, inpackageStudioPosture; no second derivation.useStudioDesignGateis now theedithalf of that answer, so the sidebar ⋯ menu's Design entry and a page's Edit in studio pencil are unchanged.editkeeps the pencil, 「Edit app」.viewdraws an eye in the same slot, 「Open app in Studio」 (data-testid="app-view-in-studio-button"), to the same Studio path, which Studio opens in its read-only posture.studioPostureprop (defaultedit):viewturns the last row into 「Open APP in Studio」 with an eye (app-switcher-view-in-studio);editkeeps 「Edit APP in Studio」 with the pencil.scopetop level) stays in the list read-only, because the list's visibility filter reads the manifest'sscopeonly;parsePackagesnow marks such a rowkernel: true(visibility unchanged), and the gate answersnullfor it. Without this the Setup app would have got the eye.topbar.openAppInStudio(en 「Open app in Studio」, zh 「在 Studio 中查看应用」) andlayout.appSwitcher.openAppInStudio(en 「Open {{app}} in Studio」, zh 「在 Studio 中查看 {{app}}」). No key renamed, no en value changed.layout/**andhooks/**; none of the files open PRs hold (UnifiedSidebar.tsx,ConsoleLayout.tsxand the rest of the seat's list) is touched.views/studio-design/packages-io.tsis in the order's Studio surface.Tests
AppHeader.editAppFollowsPackagePosture-12615.test.tsx(realAppHeader, router andMePermissionsProvider, packages served atfetch): its reading now carries the eye and the switcher's posture too. The read-only package (HotCRM,writable: false) case changes from "nothing" to "no pencil, the eye to/studio/app.objectstack.hotcrm/interfaces?surface=dashboard:pipeline, the switcher row to the same target inview, named 「Open app in Studio」". The writable CONTROL reads the pencil with postureeditand no eye. Setup, the unlisted package, the flat-served system package, the in-flight read and the failed read each read no pencil, no eye and no switcher row.AppSwitcher.homeMenu-12605.test.tsxgains two cases:viewdraws 「Open HotCRM in Studio」 with the eye glyph and no Edit row;editkeeps 「Edit HotCRM in Studio」 with the pencil (the file's first case already reads the row with no posture passed).Readings (head 6f086f6, branch rebuilt from origin/main bc496bf after #27978 merged; install and app-shell closure rebuilt)
useStudioDesignGate,AppHeader,AppSwitcher,SidebarItemMenu,parsePackages,fetchPackagesorpackages-io, plus the wholepackages/i18n/: 326 files, 3011 passed / 13 skipped.pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run type-check: exit 0 (lock VERDICT command-exit 0).scripts/ablation-replace.mjs:return pkg.writable ? 'edit' : 'view';to... : null(the read-only package gets nothing, as before): 1 failed / 8 passed (the HotCRM case red); restored blob = HEAD blobdf9f158d1490,git diff HEADempty.if (!pkg || pkg.kernel) return null;toif (!pkg) return null;(the flat-served kernel row gets the eye): 1 failed / 8 passed (the flat system package case red); restored,git diff HEADempty.@object-ui/*to source, so neither ablation needed a rebuild.pnpm --dir ui run check:i18n-drift: 0 en values changed (2 keys added, all ten packs).Acceptance notes
appStudioRoutePath's deep link). Studio's own read-only posture (row 13, fix(studio): the read-only header offers an overlay only for a type that takes one #27927) is what the viewer then sees; this PR promises a look, not an edit, and the server's write gate is unchanged.kernelmark reads a flat row's top-levelscope, the position the registry half serves; it changes no visibility. Whether a real server serves Setup flat was not measured here; the existing pin says it does.Verification
On head
6f086f63:dispatch-gates --commandsderived 34 families for this diff; all 34 were run locally, each exit 0, and--ranreconciled 34 run, 0 NOT-MEASURED, 0 UNRUN.check:new-line-citations: 0 new. CI check-runs were in progress when this was opened.Generated by Claude Code