diff --git a/.changeset/36905-permission-fullscreen.md b/.changeset/36905-permission-fullscreen.md
new file mode 100644
index 00000000000..62a926600d5
--- /dev/null
+++ b/.changeset/36905-permission-fullscreen.md
@@ -0,0 +1,16 @@
+---
+'@object-ui/app-shell': patch
+---
+
+feat(studio): a permission set opens full-screen at its metadata address; the record-visibility overview gets its own route
+
+Clause-②: no
+Metadata-protocol: none
+
+A permission set in Studio now opens at its own address, `/studio/PACKAGE/metadata/permission/NAME`, full-screen beside the left menu, instead of the Access pillar's rail and workbench. The header is the one every full-screen item page has: × back to the list of sets (its filters kept), ‹ › through it, the set's label (its machine name on the title's tooltip), type and package, and a ⋯ menu. The Access pillar's own page and its list of sets are gone. The tab row is the matrix's five sections (Objects, System capabilities, Row-level security, Tab visibility, Delegated admin), then References, History and Source; History replaces the matrix's History sheet and is addressable (`?tab=history`). Save stays the Studio top bar's, and leaving with unsaved edits (×, ‹ ›, the menu, a reload, closing the tab) asks first; the browser's Back button does not ask.
+
+What the pillar drew around the matrix comes along: Discard draft, Explain access, the suggested-audience strip, and on a read-only base "New similar", now in ⋯ and also on each of the base's rows in the list of sets; the copy opens at its own address with the strip saying where it landed. A draft the AI assistant left (copilot or MCP) shows the designers' notice, and 「放弃 AI 的改动」 drops that one set's draft; a person's own leftover draft keeps Discard draft.
+
+The organization-wide default sharing overview ("Who can see which records") is a page of its own, `/studio/PACKAGE/owd`, the Access group's menu entry; a set's per-object visibility badge opens it on that object (`?object=NAME`).
+
+Old addresses keep working: `/studio/PACKAGE/access?surface=permission:NAME` redirects to the set's address (a set a read-only base's `.custom` pair adds, a "New similar" copy among them, to the pair's address, where it opens writable as the pillar opened it), `?surface=owd:overview` to the overview, and a bare `/studio/PACKAGE/access` to the list of sets; other query parameters are kept. `/studio/PACKAGE/metadata/permission/NAME/history` opens the History tab. The cross-package leg (`/studio/~all/...`) keeps the matrix's environment page. No locale keys, props of published packages or exports change: the catalogue rows only the Access pillar read stay in `@object-ui/i18n`, unread.
diff --git a/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx b/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx
index cdc411daca5..1e971dccd4b 100644
--- a/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx
+++ b/ui/apps/console/src/components/StudioRoute.metadataArea-28561.test.tsx
@@ -168,6 +168,8 @@ describe('/studio — the "All metadata" area\'s routes (objectstack#28561)', ()
'/studio/com.example.crm/metadata',
// objectstack#36899 — the left menu's targets that are not an area list.
'/studio/~org/automations',
+ // objectstack#36905 — the sharing overview's own route, and the old address that redirects to it.
+ '/studio/com.example.crm/owd',
'/studio/com.example.crm/access?surface=owd%3Aoverview',
'/studio/com.example.crm/metadata/_diagnostics',
])(
diff --git a/ui/packages/app-shell/src/__tests__/homeRecoveryRedirectsFollowDeclaration-7373.test.ts b/ui/packages/app-shell/src/__tests__/homeRecoveryRedirectsFollowDeclaration-7373.test.ts
index 14f506ae2cf..a5f524b2399 100644
--- a/ui/packages/app-shell/src/__tests__/homeRecoveryRedirectsFollowDeclaration-7373.test.ts
+++ b/ui/packages/app-shell/src/__tests__/homeRecoveryRedirectsFollowDeclaration-7373.test.ts
@@ -143,7 +143,6 @@ const RECOVERY_SITES: ReadonlyArray<{
'packages/app-shell/src/views/studio-design/StudioPillarKit.tsx',
'packages/app-shell/src/views/studio-design/DataPillarHelpers.tsx',
'packages/app-shell/src/views/studio-design/AutomationsPillar.tsx',
- 'packages/app-shell/src/views/studio-design/AccessPillar.tsx',
'packages/app-shell/src/views/studio-design/DataPillar.tsx',
],
site: 'Studio: the header Back to app, with no app to name',
diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.saveSurface-12725.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.saveSurface-12725.test.tsx
index dd5dcb46810..ef11e489ca8 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.saveSurface-12725.test.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.saveSurface-12725.test.tsx
@@ -4,14 +4,15 @@
* objectui#12725 (the remainder, item 1) — the permission matrix names its
* authoring surface only under the Studio host.
*
- * `PermissionMatrixEditPage` serves two hosts: Studio's Access pillar mounts it
+ * `PermissionMatrixEditPage` serves two hosts: Studio's permission set page
+ * (objectstack#36905; the Access pillar before it) mounts it
* with `packageId` and `embedded`, and its draft save is a person's edit in
* Studio, so it sends `?surface=studio` (recorded as `by: 'studio'` in the
* draft's `draftChanges`, objectstack#24395). metadata-admin mounts it through
* the resource registry with only `type` and `name`: its save is the
* environment door's live write and states no surface.
*
- * Both hosts are the REAL ones (`AccessPillar`, `MetadataResourceEditPage`
+ * Both hosts are the REAL ones (`StudioPermissionSetPage`, `MetadataResourceEditPage`
* through the built-in registration), and the save goes through a REAL
* `MetadataClient` whose transport records each `PUT`, so the pins read the
* query string the server would read.
@@ -89,7 +90,7 @@ vi.mock('../studio-design/StudioAiCopilot', () => ({ StudioChatDock: () => null
import '../../services/builtinComponents.js';
import { MetadataResourceEditPage } from './ResourceEditPage';
-import { AccessPillar } from '../studio-design/StudioDesignSurface';
+import { StudioPermissionSetPage } from '../studio-design/StudioPermissionSetPage';
import { StudioSaveHarness, pressStudioSave } from '../studio-design/__tests__/studioSaveHarness';
window.matchMedia = ((query: string) => ({
@@ -115,11 +116,11 @@ beforeEach(() => {
afterEach(cleanup);
describe('the permission matrix states `surface` only under the Studio host (objectui#12725)', () => {
- it('Studio’s Access pillar: the draft save sends `?surface=studio`, once', async () => {
+ it('Studio’s permission set page: the draft save sends `?surface=studio`, once', async () => {
render(
-
+ ,
);
diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.studioSave-36511.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.studioSave-36511.test.tsx
index 71c97611dd7..c1b5d597fd6 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.studioSave-36511.test.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.studioSave-36511.test.tsx
@@ -1,8 +1,9 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
/**
- * objectstack#36511 — a permission set in the Studio's Access pillar saves with
- * the top bar's Save and Cancel, and a Save is live at once.
+ * objectstack#36511 — a permission set in Studio (since objectstack#36905 on
+ * its full-screen page) saves with the top bar's Save and Cancel, and a Save
+ * is live at once.
*
* - A grant clicked sends nothing: no draft write leaves before Save is
* pressed, however long the page waits (the set's 1.5 s autosave is gone
@@ -13,7 +14,7 @@
* - A refused publish keeps the grant unsaved, says why on the page, and takes
* back the draft the Save wrote.
*
- * The REAL `AccessPillar` inside the top bar's coordinator; the writes go
+ * The REAL `StudioPermissionSetPage` inside the top bar's coordinator; the writes go
* through a REAL `MetadataClient` whose transport records each one, so the pins
* read the URL the server would read. The environment door (metadata-admin,
* no package) keeps its own Save and live write: pinned in
@@ -101,7 +102,7 @@ vi.mock('../../components/SuggestedBindingsPanel', () => ({ SuggestedBindingsPan
vi.mock('../studio-design/StudioAiCopilot', () => ({ StudioChatDock: () => null }));
import { toast } from 'sonner';
-import { AccessPillar } from '../studio-design/StudioDesignSurface';
+import { StudioPermissionSetPage } from '../studio-design/StudioPermissionSetPage';
import { StudioSaveHarness, pressStudioCancel, pressStudioSave } from '../studio-design/__tests__/studioSaveHarness';
import { tFormat } from './i18n';
@@ -130,7 +131,7 @@ async function mount(): Promise {
render(
-
+ ,
);
diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx
index 55c761de980..93541cee3c2 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx
@@ -106,7 +106,7 @@ import { useDraftAutoSave, type DraftSend } from '../studio-design/useDraftAutoS
// objectstack#36511 — in the Studio the set is sent by the top bar's Save, which makes it live.
import { publishSavedItem, useStudioSaveEntry, type StudioSaveResult } from '../studio-design/studioSaveBar.js';
import { publishFailureOf, publishRefusal } from '../studio-design/metadataError.js';
-// objectui#12456 — the Studio Access pillar's presentation draws the shared item header.
+// objectui#12456 — the Studio presentation draws the shared item header when no frame draws one.
import { StudioItemHeader, StudioTab } from '../studio-design/StudioItemHeader.js';
import type { CustomizationMarkKind } from '../studio-design/customizationMarks.js';
import { useDisplayLocale } from '@object-ui/i18n';
@@ -139,7 +139,7 @@ import { holdingOfRead, holdingPackage, type PermissionSetHolding } from './perm
import { isEnvironmentScope, useWalledCatalogReadOnly } from './catalog-scope.js';
import { useCanAuthorMetadata, useCanReadAuthoringTrail } from '../../hooks/useCanAuthorMetadata.js';
import { errorCodeIs } from '@object-ui/types';
-import { formatMetadataError, type MetadataError } from '@object-ui/data-objectstack';
+import { formatMetadataError, readDraftChanges, type DraftChange, type MetadataError } from '@object-ui/data-objectstack';
import { PermissionSetCloneDialog } from './PermissionSetCloneDialog.js';
import { isStudioHiddenSystemField } from '../studio-design/studioHiddenSystemField.js';
import { permissionSetCloneNoticeText, type PermissionSetCloned } from './permission-set-clone.js';
@@ -520,9 +520,10 @@ function headersAbbreviate(actions: ReturnType, locale:
}
/**
- * objectui#12456 — the five tabs of the Studio Access pillar's permission-set
- * page (epic objectui#12446, decision C): each holds one of the sections the
- * routed page stacks in one column.
+ * objectui#12456 — the five tabs of the Studio's permission-set page (epic
+ * objectui#12446, decision C; since objectstack#36905 the set's full-screen
+ * page, `StudioPermissionSetPage`): each holds one of the sections the routed
+ * page stacks in one column.
*/
export type PermissionStudioTab = 'objects' | 'capabilities' | 'rls' | 'tabs' | 'admin';
@@ -534,26 +535,71 @@ export const PERMISSION_STUDIO_TABS: ReadonlyArray<{ key: PermissionStudioTab; l
{ key: 'admin', labelKey: 'engine.studio.access.tab.admin' },
];
-/** What the Studio Access pillar hands the page for its tabbed presentation. */
+/** What the Studio host (`StudioPermissionSetPage`) hands the page for its tabbed presentation. */
export interface PermissionStudioChrome {
- /** The open tab; the pillar holds it (default `objects`). */
+ /** The open tab; the host holds it (default `objects`). */
tab: PermissionStudioTab;
onTabChange: (tab: PermissionStudioTab) => void;
- /** Before the header's icon tile (the pillar's mobile rail toggle). */
+ /** Before the header's icon tile. Drawn only without a {@link frame}. */
leading?: React.ReactNode;
- /** The pillar's draft / read-only note, at the right end of the tab row. */
+ /** A draft / read-only note at the right end of the tab row. Drawn only without a {@link frame}. */
chips?: React.ReactNode;
- /** Before History in the header's actions (the pillar's Explain access). */
+ /** Before History in the header's actions. Drawn only without a {@link frame}. */
actions?: React.ReactNode;
/**
* objectstack#32774 — told, for the set `name` this editor shows, the
* package the clone door must name to copy it (`holdingPackage` of the
* holding this editor read): `undefined` where the name alone addresses it
- * (one holder, the environment's own set) or no holder was read. The pillar
- * hosts its own clone dialog ("New similar") and passes it as
+ * (one holder, the environment's own set) or no holder was read. The Studio
+ * host keeps its own clone dialog ("New similar") and passes it as
* `sourcePackage`.
*/
onCloneSourceRead?: (name: string, sourcePackage: string | undefined) => void;
+ /**
+ * objectstack#36905 — the full-screen item page's frame (`StudioPermissionSetPage`):
+ * the host draws the header (`StudioDetailHeader`) from the parts this page
+ * hands it, and its tab row carries the item tools (References, History,
+ * Source) after the five section tabs, so History is a tab there and this
+ * page draws no History button. Omitted, the page draws its own
+ * `StudioItemHeader`: no Studio host mounts it that way since the Access
+ * pillar was deleted (objectstack#36905), and only this page's own unit
+ * tests draw it; the pillar's leftovers go with objectstack#36909.
+ */
+ frame?: PermissionStudioFrame;
+}
+
+/** The pieces of the page's header a {@link PermissionStudioFrame} host composes. */
+export interface PermissionStudioHeaderParts {
+ /** The set's label, or its name before one is known. */
+ title: string;
+ /** The line under the title: provenance, default and lock labels. */
+ note: React.ReactNode;
+ /** The granted-object and field-override counts, once loaded. */
+ meta?: string;
+ /** The page's own actions: the save status, the environment's Save, the artifact tier's Clone. */
+ actions: React.ReactNode;
+ /** The page's own ⋯ items (`DropdownMenuItem`s): the name and label editor. */
+ menuItems: React.ReactNode;
+ /** The five section tabs (`StudioTab`s), none active while {@link PermissionStudioFrame.toolOpen}. */
+ sectionTabs: React.ReactNode;
+}
+
+export interface PermissionStudioFrame {
+ /** Draw the header from the page's parts. */
+ renderHeader: (parts: PermissionStudioHeaderParts) => React.ReactNode;
+ /**
+ * An item tool's panel is open in place of the sections: they stay mounted
+ * and hidden, so an edit survives the visit, and no section tab is active.
+ */
+ toolOpen?: boolean;
+ /** The open tool's panel, drawn in the body while {@link toolOpen}. */
+ toolPanel?: React.ReactNode;
+ /**
+ * Told, on every load, who wrote the set's pending draft: its per-key
+ * provenance (`draftChanges`), `null` with no draft or none recorded. The
+ * host draws the AI-draft notice from it (epic decision 1).
+ */
+ onDraftChangesRead?: (changes: DraftChange[] | null) => void;
}
export interface PermissionMatrixEditPageProps {
@@ -589,21 +635,20 @@ export interface PermissionMatrixEditPageProps {
/**
* objectui#2505 — when provided, the per-object OWD badge becomes a link that
* opens the package-level Record Sharing Baseline (OWD) overview, scrolled to
- * that object. Set only by the Studio Access pillar (which hosts the sibling
- * overview surface); omitted at environment scope / metadata-admin, where the
- * badge stays a plain read-only chip.
+ * that object. Set only by the Studio host (objectstack#36905: the overview
+ * is its own route, `/studio//owd`); omitted at environment scope /
+ * metadata-admin, where the badge stays a plain read-only chip.
*/
onOpenOwd?: (objectName: string) => void;
/**
* Fires on every unsaved-edit transition (false → true → false). The Studio
- * Access pillar keys this page per set (`key={name}`) and swaps it out for
- * the OWD overview, so the HOST must know before a surface switch whether a
- * remount would discard edits. Reset to `false` on unmount so a discarded
+ * host keys this page per set, so the HOST must know before a departure
+ * whether a remount would discard edits. Reset to `false` on unmount so a discarded
* editor never leaves the host thinking edits are still pending.
*/
onDirtyChange?: (dirty: boolean) => void;
/**
- * Host-level read-only gate — set by the Studio Access pillar when the
+ * Host-level read-only gate — set by the Studio host when the
* surrounding PACKAGE is read-only. Independent of the TYPE-level
* `allowEnvironmentOverlay` writability: either gate locks the matrix (checkboxes,
* bulk buttons, name/label, facets), hides Save, and shows the read-only
@@ -612,17 +657,18 @@ export interface PermissionMatrixEditPageProps {
*/
readOnly?: boolean;
/**
- * When true, the editor is hosted inside another surface (the Studio Access
- * pillar) rather than the routed metadata admin. Relative navigation would
- * resolve against the HOST's route (`/studio/:packageId/access/...`), where
- * the metadata-admin routes don't exist — so History opens as an in-place
+ * When true, the editor is hosted inside another surface (the Studio's
+ * permission-set page) rather than the routed metadata admin. Relative
+ * navigation would resolve against the HOST's route, where the
+ * metadata-admin routes don't exist — so History opens as an in-place
* sheet instead of navigating, and the PageShell breadcrumb loses its
* `/metadata` links (same rule as MetadataResourceEditPage's `embedded`).
*/
embedded?: boolean;
/**
- * objectui#12456 — the Studio Access pillar's presentation (set with
- * `embedded`). The page draws the Studio item header (the set's label, api
+ * objectui#12456 — the Studio presentation (set with `embedded`; since
+ * objectstack#36905 by `StudioPermissionSetPage`, with a {@link
+ * PermissionStudioChrome.frame}). The page draws the Studio item header (the set's label, api
* name, Package chip, granted / override counts, History and a more menu
* holding the name / label editor) instead of the PageShell breadcrumb,
* badge row and collapsible set header, and splits its sections into five
@@ -637,7 +683,7 @@ export interface PermissionMatrixEditPageProps {
* draws for this set (`customizationMarks.ts`, the one rule): on a read-only
* base, `'added'` for a set its `.custom` pair holds (a New similar
* copy or a set created there), `'customized'` for a served override of a
- * base set. Set only by the Studio Access pillar; omitted (Setup, the
+ * base set. Set only by the Studio host; omitted (Setup, the
* metadata admin) or `null` (no mark, or the read has not answered),
* nothing changes. Read by the provenance badge alone.
*/
@@ -709,7 +755,7 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
// the block below the state declaration for why the type tier alone is
// not the whole gate.
//
- // • HOST gate — the package-level `readOnly` prop the Studio Access pillar
+ // • HOST gate — the package-level `readOnly` prop the Studio host
// passes for a read-only package. UNCHANGED and still dominant: this is
// the "Studio 维持包级只读" half of the objectstack#5768 ruling, and a
// code-defined package stays locked here exactly as before.
@@ -836,6 +882,8 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
const cloneSourcePackage = holdingPackage(assignmentsHolding ?? undefined);
const onCloneSourceReadRef = React.useRef(studio?.onCloneSourceRead);
onCloneSourceReadRef.current = studio?.onCloneSourceRead;
+ const onDraftChangesReadRef = React.useRef(studio?.frame?.onDraftChangesRead);
+ onDraftChangesReadRef.current = studio?.frame?.onDraftChangesRead;
React.useEffect(() => {
onCloneSourceReadRef.current?.(name, cloneSourcePackage);
}, [name, cloneSourcePackage]);
@@ -1119,6 +1167,7 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
}
const pendingDraft = pendingRead?.answer ?? null;
hadDraftRef.current = !!pendingDraft;
+ onDraftChangesReadRef.current?.(pendingDraft ? readDraftChanges(pendingDraft) : null);
verdictReadSeq.current += 1;
setServedVerdict(
editedItemDiagnostics({
@@ -1627,7 +1676,7 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
// answers the 404 shape, which `MetadataClient.layered` resolves as
// `{ effective: null, … }` — that arm keeps the `?? payload` base on
// purpose: a set that exists only as a package draft (what the Studio
- // Access pillar's "+ New" creates) has no published rows for anyone to
+ // create leaves before its first publish) has no published rows for anyone to
// lose, and refusing there would block its first save.
//
// objectstack#26837 — and this door's save WRITES the pending draft, so
@@ -1670,7 +1719,7 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
// objectui#11773 — the guard pins the package door's DRAFT save; the
// environment door's live write passes through it unpinned, as before.
// objectui#12725 — the draft names its authoring surface only under the
- // Studio host (`embedded`, the Access pillar), so a person's edit there
+ // Studio host (`embedded`, the set's Studio page), so a person's edit there
// is recorded `studio`, not `api`. metadata-admin mounts this page with
// neither `packageId` nor `embedded`, and states no surface.
const outcome = await saveVersioned(type, payload.name, toSave, {
@@ -1976,7 +2025,7 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
);
// objectui#12456 — the pieces both presentations draw: the routed page
- // (PageShell) and the Studio Access pillar's tabbed one (`studio`).
+ // (PageShell) and the Studio's tabbed one (`studio`).
const envSaveEl = (
<>
{/* ADR-0086 D7 — the environment door's explicit Save: a live write. */}
@@ -2417,33 +2466,64 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
// set's machine name is the title's tooltip, and the provenance, default
// and lock labels are the line under it.
const studioTitle = headerLabel || name;
+ const frame = chrome.frame;
+ const titleNoteEl = (
+
+ {/* Same test id and the same answer as the page's badge. */}
+ {/* objectstack#35018 — in the builder's words: a set the app
+ brings reads 「随应用提供」, not the package term 「包内置」. */}
+
+ {shippedByPackage ? t('engine.studio.access.origin.app') : t('perm.badge.custom')}
+
+ {!!draft.isDefault && (
+ <>
+ ·
+ {t('perm.badge.default')}
+ >
+ )}
+ {/* A host-locked package says so in the host's note; the
+ other gates (type, artifact, wall) keep their own badge. */}
+ {!readOnly && lockBadgeEl}
+
+ );
+ const basicsItemEl = (
+ setBasicsOpen((o) => !o)}>{t('perm.basics.editHint')}
+ );
+ const sectionTabsEl = PERMISSION_STUDIO_TABS.map((tab) => (
+ chrome.onTabChange(tab.key)}
+ >
+ {t(tab.labelKey)}
+
+ ));
return (
+ {frame ? (
+ frame.renderHeader({
+ title: studioTitle,
+ note: titleNoteEl,
+ meta,
+ actions: (
+ <>
+ {autosaveStatusEl}
+ {envSaveEl}
+ {lockedByArtifactTier && cloneButton}
+ >
+ ),
+ menuItems: basicsItemEl,
+ sectionTabs: sectionTabsEl,
+ })
+ ) : (
- {/* Same test id and the same answer as the page's badge. */}
- {/* objectstack#35018 — in the builder's words: a set the app
- brings reads 「随应用提供」, not the package term 「包内置」. */}
-
- {shippedByPackage ? t('engine.studio.access.origin.app') : t('perm.badge.custom')}
-
- {!!draft.isDefault && (
- <>
- ·
- {t('perm.badge.default')}
- >
- )}
- {/* A host-locked package says so in the pillar's note; the
- other gates (type, artifact, wall) keep their own badge. */}
- {!readOnly && lockBadgeEl}
-
- }
+ note={titleNoteEl}
meta={meta}
actions={
<>
@@ -2475,26 +2555,13 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
-
- setBasicsOpen((o) => !o)}>
- {t('perm.basics.editHint')}
-
-
+ {basicsItemEl}
>
}
tabs={
<>
- {PERMISSION_STUDIO_TABS.map((tab) => (
- chrome.onTabChange(tab.key)}
- >
- {t(tab.labelKey)}
-
- ))}
+ {sectionTabsEl}
{/* The pillar's draft / read-only note, whole, at the tab row's
right: in the title row it squeezed the label and the counts
at the 1280 px design width. */}
@@ -2502,14 +2569,23 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved,
>
}
/>
+ )}
+ {frame?.toolOpen &&
+ // objectstack#36905 — kept mounted under an open item tool, so an
+ // edit survives the visit.
+
{noticesEl}
{basicsOpen && (
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
index 831aed3a963..22c352f8e59 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
@@ -100,6 +100,9 @@ import { resolveAffordance, type SchemaLike } from '@object-ui/core';
import { useAdapter, useMetadata } from '@object-ui/react';
import { usePermissions } from '@object-ui/permissions';
import { SharingRuleCloneDialog, type SharingRuleCloneDialogProps } from './SharingRuleCloneDialog.js';
+import { PermissionSetCloneDialog } from './PermissionSetCloneDialog.js';
+import { permissionSetCloneNoticeText } from './permission-set-clone.js';
+import { newSimilarOutcome } from '../studio-design/permissionNewSimilar.js';
import { postureHasOrgWall, useTenancyPosture } from '../../hooks/useTenancyPosture.js';
import {
applyListState,
@@ -355,6 +358,10 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
}).allowed;
const CloneDialog = authoredObject && canClone ? DECLARATION_CLONE_DIALOGS[type] : undefined;
const [cloning, setCloning] = React.useState | null>(null);
+ // objectstack#36905 — "New similar" on a read-only base's permission sets in
+ // Studio's area, where the Access pillar's rail offered it before: the clone
+ // door picks the package, and the copy opens at its own address.
+ const [newSimilarFrom, setNewSimilarFrom] = React.useState<{ name: string; sourcePackage?: string } | null>(null);
// Studio is scoped to a single *project* package at a time. Load the
// installed packages and keep only project-scoped ones — anything not
@@ -842,6 +849,7 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
size="sm"
variant={config.createFields ? 'default' : 'outline'}
onClick={handleCreate}
+ data-testid="metadata-list-create"
title={
config.createFields
? tFormat('engine.list.createHint', locale, { type: typeLabel })
@@ -927,6 +935,8 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
// then the row's controls — the Active switch, Clone, or both in one cell —
// pinned at its right edge (objectui#13091). One column, because the grid
// holds one column at that edge.
+ // On the base's own rows only: a row its pair adds is writable where it opens.
+ const newSimilarRows = type === 'permission' && !!host?.packageId && host.readOnly === true && canAuthor && !walled;
const gridColumns: MetadataGridColumn[] = [
...shownColumns.map((c, ci) => ({
key: c.key,
@@ -936,7 +946,7 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
// objectstack#36898 — the item's change time and its pending-draft mark.
{ key: CHANGED_COLUMN, label: t('engine.list.col.changedAt', locale) },
{ key: SOURCE_COLUMN, label: t('engine.list.col.source', locale) },
- ...(activation || CloneDialog
+ ...(activation || CloneDialog || newSimilarRows
? [
{
key: CONTROLS_COLUMN,
@@ -1140,12 +1150,26 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
);
};
- if (activation || CloneDialog) {
+ if (activation || CloneDialog || newSimilarRows) {
cellDraws[pageField(CONTROLS_COLUMN)] = (_value, rec) => {
const info = rowInfoOf(rec);
if (!info) return null;
+ const newSimilar = newSimilarRows && (!info.rowPkg || info.rowPkg === host?.packageId);
return (
+ {newSimilar && (
+
+ )}
{activation && (
{t('engine.catalog.declaredOnly.switchReadOnly', locale)}
)}
+ {newSimilarFrom && (
+ setNewSimilarFrom(null)}
+ onCloned={(copy) => {
+ setNewSimilarFrom(null);
+ const outcome = newSimilarOutcome(copy);
+ if ('open' in outcome) {
+ navigate(outcome.open.to, { state: outcome.open.state });
+ return;
+ }
+ // Nothing to open: said where the person is, in the strip's words.
+ toast.warning(
+ outcome.strip.kind === 'noPackage'
+ ? tFormat('engine.studio.access.newSimilar.noPackage', locale, { name: outcome.strip.name })
+ : t('perm.clone.noName', locale),
+ outcome.strip.notice
+ ? {
+ description: permissionSetCloneNoticeText(
+ { notice: outcome.strip.notice, noticeCode: outcome.strip.noticeCode, package: null },
+ locale,
+ ),
+ }
+ : undefined,
+ );
+ }}
+ />
+ )}
{cloning && CloneDialog && (
> = [];
+
const CLIENT = {
list: async (type: string) =>
type === 'package'
@@ -43,7 +54,7 @@ const CLIENT = {
{ manifest: { id: PROJECT, scope: 'project', name: 'CRM' } },
]
: type === 'permission'
- ? PERMISSION_SETS
+ ? [...PERMISSION_SETS, ...EXTRA_SETS]
: [],
};
@@ -94,7 +105,7 @@ vi.mock('../../hooks/useCanAuthorMetadata', async (importOriginal) => ({
import { MetadataDirectoryPage } from './DirectoryPage';
import { MetadataResourceListPage } from './ResourceListPage';
-import { t } from './i18n';
+import { t, tFormat } from './i18n';
beforeEach(() => {
vi.stubGlobal(
@@ -112,6 +123,8 @@ beforeEach(() => {
afterEach(() => {
cleanup();
vi.unstubAllGlobals();
+ vi.restoreAllMocks();
+ EXTRA_SETS.length = 0;
});
const crmArea = (readOnly = false): MetadataAreaHost => ({
@@ -193,7 +206,9 @@ describe('the directory under the area (objectstack#28561)', () => {
describe('the list under the area', () => {
const rowLink = (container: HTMLElement, name: string) => container.querySelector(`a[href*="/${name}"]`);
- const createButton = () => screen.queryByRole('button', { name: new RegExp(t('engine.list.create', 'en-US')) });
+ // By its test id: a read-only base's row offers "New similar" (objectstack#36905), which is no
+ // create, and a label query would match it.
+ const createButton = () => screen.queryByTestId('metadata-list-create');
it('a package\'s area lists that package\'s rows, with no repair, and offers create', async () => {
const { container } = mount(crmArea(), `/studio/${PROJECT}/metadata/permission?package=${PROJECT}`, );
@@ -231,3 +246,93 @@ describe('the list under the area', () => {
expect(where()).toBe('/studio/~all/metadata/permission?scope=environment');
});
});
+
+/**
+ * objectstack#36905 (card item 2) — "New similar" on the rows of a read-only
+ * base's list of sets: the row action the Access pillar's rail had, on the
+ * REAL list page, over the REAL clone dialog and clone door (`fetch`).
+ */
+describe('"New similar" on a read-only base\'s rows (objectstack#36905)', () => {
+ const PAIR = `${PROJECT}.custom`;
+ const LIST_URL = `/studio/${PROJECT}/metadata/permission?package=${PROJECT}`;
+ const newSimilar = (name: string) => screen.queryByTestId(`list-new-similar-${name}`);
+
+ /** The clone door answers `data`; every other read answers as the harness does. */
+ function serveClone(data: Record) {
+ const calls: string[] = [];
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn(async (url: string) => {
+ const json = (status: number, body: unknown) =>
+ new Response(JSON.stringify(body), { status, headers: { 'Content-Type': 'application/json' } });
+ if (String(url).includes('/security/permission-sets/')) {
+ calls.push(String(url));
+ return json(200, { success: true, data });
+ }
+ if (String(url).startsWith('/api/v1/data/sys_metadata_activation')) {
+ return json(200, { object: 'sys_metadata_activation', records: [], hasMore: false });
+ }
+ return json(404, { success: false });
+ }),
+ );
+ return calls;
+ }
+
+ async function openBaseList() {
+ EXTRA_SETS.push({ name: 'crm_rep_copy', label: 'CRM Rep copy', _packageId: PAIR, _provenance: 'package' });
+ const view = mount(crmArea(true), LIST_URL, );
+ await waitFor(() => expect(rowLink(view.container, 'crm_rep')).not.toBeNull());
+ await waitFor(() => expect(rowLink(view.container, 'crm_rep_copy')).not.toBeNull());
+ return view;
+ }
+
+ async function copyFrom(name: string) {
+ fireEvent.click(newSimilar(name)!);
+ const dialog = await screen.findByRole('dialog');
+ fireEvent.change(within(dialog).getByLabelText(t('perm.clone.name', 'en-US')), { target: { value: 'my_rep' } });
+ fireEvent.change(within(dialog).getByLabelText(t('perm.clone.label', 'en-US')), { target: { value: 'My rep' } });
+ fireEvent.click(within(dialog).getByRole('button', { name: t('perm.clone.confirm', 'en-US') }));
+ }
+
+ const rowLink = (container: HTMLElement, name: string) => container.querySelector(`a[href*="/${name}?"]`);
+
+ it("the base's own row offers it; its pair's row does not", async () => {
+ serveClone({});
+ await openBaseList();
+ expect(newSimilar('crm_rep')).toBeInTheDocument();
+ expect(newSimilar('crm_rep_copy')).toBeNull();
+ });
+
+ it('the copy opens at its metadata address in the package the clone door names', async () => {
+ const calls = serveClone({ permissionSet: { name: 'my_rep', label: 'My rep' }, package: PAIR, notice: 'Saved.' });
+ await openBaseList();
+ await copyFrom('crm_rep');
+ await waitFor(() =>
+ expect(where()).toBe(`/studio/${PAIR}/metadata/permission/my_rep?package=${encodeURIComponent(PAIR)}`),
+ );
+ expect(calls).toHaveLength(1);
+ expect(calls[0]).toContain('/security/permission-sets/crm_rep/clone');
+ });
+
+ it('an answer naming no package opens nothing and says so', async () => {
+ const warning = vi.spyOn(toast, 'warning');
+ serveClone({ permissionSet: { name: 'my_rep', label: 'My rep' }, notice: 'Saved.' });
+ await openBaseList();
+ await copyFrom('crm_rep');
+ await waitFor(() =>
+ expect(warning).toHaveBeenCalledWith(
+ tFormat('engine.studio.access.newSimilar.noPackage', 'en-US', { name: 'my_rep' }),
+ expect.anything(),
+ ),
+ );
+ expect(where()).toBe(LIST_URL);
+ });
+
+ it('CONTROL: a writable package offers no New similar, and offers create', async () => {
+ serveClone({});
+ const { container } = mount(crmArea(), LIST_URL, );
+ await waitFor(() => expect(rowLink(container, 'crm_rep')).not.toBeNull());
+ expect(newSimilar('crm_rep')).toBeNull();
+ expect(screen.getByTestId('metadata-list-create')).toBeInTheDocument();
+ });
+});
diff --git a/ui/packages/app-shell/src/views/studio-design/AccessPillar.tsx b/ui/packages/app-shell/src/views/studio-design/AccessPillar.tsx
deleted file mode 100644
index 364777d4e56..00000000000
--- a/ui/packages/app-shell/src/views/studio-design/AccessPillar.tsx
+++ /dev/null
@@ -1,1115 +0,0 @@
-// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
-
-/**
- * The Access pillar — the permission-set rail and the embedded permission
- * workbench — with its "New similar" arrival reader and the list-row name
- * label only it draws, moved out of `StudioDesignSurface.tsx` unchanged by
- * objectstack#36893 (the move-only split's pillar slice; the surface
- * re-exports it).
- */
-
-import * as React from 'react';
-import { useNavigate, useLocation } from 'react-router-dom';
-import { formatMetadataError } from '@object-ui/data-objectstack';
-import { type I18nLabel } from '@objectstack/spec/ui';
-import { type StudioSurfaceLabel } from './StudioAiCopilot.js';
-import { StudioItemHeader, StudioStatusChip, type StudioItemStatus } from './StudioItemHeader.js';
-import { StudioRail, StudioRailRow } from './StudioRail.js';
-import { StudioEmptyState, StudioEmptyStateAction } from './StudioEmptyState.js';
-import { pairIdOf } from './AutomationsFlowRail.js';
-import {
- confirmDropUnsavedWork,
- CreateTakenNotice,
- findTakenIdentifier,
- type StudioBaseCustomization,
- StudioReadOnlyLink,
-} from './StudioPillarKit.js';
-import { useIsMobile } from '@object-ui/components';
-import { Copy, Shield, ShieldCheck, ShieldQuestion, Menu, Undo2 } from 'lucide-react';
-import { PermissionMatrixEditPage, type PermissionStudioTab } from '../metadata-admin/PermissionMatrixEditor.js';
-import { AccessExplainPanel } from '../metadata-admin/AccessExplainPanel.js';
-import { useMetadataClient } from '../metadata-admin/useMetadata.js';
-import { publishSavedItem } from './studioSaveBar.js';
-import { studioPillarItemPath } from './metadataArea.js';
-import { PermissionSetCloneDialog } from '../metadata-admin/PermissionSetCloneDialog.js';
-import { permissionSetCloneNoticeText, type PermissionSetCloned } from '../metadata-admin/permission-set-clone.js';
-import { useWalledCatalogReadOnly } from '../metadata-admin/catalog-scope.js';
-import { useCanAuthorMetadata } from '../../hooks/useCanAuthorMetadata.js';
-import { useMetadataRefreshNonce } from './useMetadataRefreshNonce.js';
-import { useSurfaceDeepLink, resolveSurfaceDeepLink } from './useSurfaceDeepLink.js';
-import { buildPermissionSkeleton } from './skeletons.js';
-import { t, tFormat, translateMetadataType, useMetadataLocale } from '../metadata-admin/i18n.js';
-import { SuggestedBindingsPanel } from '../../components/SuggestedBindingsPanel.js';
-import type { SuggestedBinding } from '../../services/suggestedBindingsApi.js';
-import { suggestedSetLabel as suggestedSetLabelOf } from '../../components/suggestedSetLabel.js';
-import {
- navItemLabelText,
-} from '../metadata-admin/previews/navItemLabel.js';
-import { errorCodeIs } from '@object-ui/types';
-import { CreateItemDialog } from './CreateItemDialog.js';
-import { PackageOwdOverviewPanel } from './PackageOwdOverviewPanel.js';
-import {
- RailCustomizationFilter,
- RailCustomizationMark,
- StudioPairItemChip,
- railCustomizationsOf,
- useDeepLinkFallback,
- useRailCustomizationsOnly,
-} from './StudioRailCustomizations.js';
-import { toast } from 'sonner';
-
-/**
- * A Studio list row's name (objectui#11862, on the maintainer's word
- * 「所有地方以标签为主,机器名只作为次要信息」): the label as the primary text, and
- * the machine name beneath it as secondary text — smaller and monospace — when
- * it differs from the label. With no label the name alone is the text.
- *
- * Display only: it reads what the row already holds and writes nothing. The
- * secondary name is `aria-hidden`, so a row's accessible name stays the label
- * it was; the nav rail carries the machine name for assistive tech on the
- * row's `title` (`type · name`), as it did before.
- */
-function StudioNameLabel({ label, name }: { label: string; name?: string }): React.ReactElement {
- const primary = label.trim() ? label : (name ?? '');
- const secondary = name && name !== primary ? name : '';
- return (
-
- {primary}
- {secondary ? (
-
- {secondary}
-
- ) : null}
-
- );
-}
-
-/**
- * objectstack#28573 — what the Access pillar's "New similar" strip says: the
- * copy the clone door saved (shown on that copy, in the package the answer
- * named), or an answer the pillar could not open (no copy named, or no
- * package). `notice` is the server's sentence, and `noticeCode` the code it
- * names it by (objectstack#29727): shown in the console's language for a known
- * code, as sent otherwise.
- */
-type NewSimilarStrip =
- | { kind: 'landed'; name: string; package: string; notice: string; noticeCode?: string }
- | { kind: 'noPackage'; name: string; notice: string; noticeCode?: string }
- | { kind: 'noName'; notice: string; noticeCode?: string };
-
-/** The navigation-state key the copy's landing rides to the copy's pillar on. */
-const NEW_SIMILAR_ARRIVAL_STATE = 'accessNewSimilar';
-
-/**
- * The landing a "New similar" navigation carried, for the pillar it opened:
- * kept only when it names THIS package, so a stale history entry of another
- * package's pillar shows nothing.
- */
-function readNewSimilarArrival(state: unknown, packageId: string): NewSimilarStrip | null {
- const arrival = (state as Record | null | undefined)?.[NEW_SIMILAR_ARRIVAL_STATE] as
- | Partial>
- | undefined;
- if (!arrival || arrival.kind !== 'landed' || arrival.package !== packageId || typeof arrival.name !== 'string') {
- return null;
- }
- return {
- kind: 'landed',
- name: arrival.name,
- package: packageId,
- notice: typeof arrival.notice === 'string' ? arrival.notice : '',
- ...(typeof arrival.noticeCode === 'string' ? { noticeCode: arrival.noticeCode } : {}),
- };
-}
-
-/**
- * Access pillar — the permission workbench (builder-ui §7, ADR-0084's fourth
- * content pillar). Left rail: the environment's permission sets / profiles;
- * main: the Salesforce-style PermissionMatrixEditPage (objects × CRUD/VAMA +
- * field-level R/W).
- *
- * Scope note (ADR-0086 P0/P1/P2): the pillar is scoped to the current package.
- * The left rail lists only permission sets this package owns — the metadata API
- * filters `permission` by the record-level `package_id` provenance server-side
- * (P1), so environment-owned platform defaults (`admin_full_access`,
- * `member_default`, …) are excluded by the backend. The object MATRIX lists only
- * the objects this package declares, and Save merges just that slice back,
- * leaving other packages' contributed rows untouched (P0). Save writes a package
- * DRAFT and publishes with the whole package via the top-bar Publish (P2, D6).
- */
-// Exported for tests — routed only through StudioDesignSurface in production.
-export function AccessPillar({
- packageId: railPackageId,
- publishNonce,
- onDraftSaved,
- readOnly: packageReadOnly = false,
- customization = null,
- onDirtyChange,
- onSurfaceLabelChange,
-}: {
- packageId: string;
- publishNonce?: number;
- onDraftSaved?: () => void;
- /** Courtesy gate: hide/disable permission-authoring affordances. */
- readOnly?: boolean;
- /** objectstack#28572 — on a read-only base, its pair: the rail lists the pair's sets too, and New lands there. */
- customization?: StudioBaseCustomization | null;
- /** objectui#2600 — mirrors the pillar's unsaved-edit state (permission
- * matrix or OWD overview rows) up to the Studio header, whose
- * pillar/Home/package navigation unmounts this whole pillar (SPA nav, so no
- * beforeunload). Reports `false` when the pillar unmounts, same contract as
- * PermissionMatrixEditPage's own onDirtyChange. */
- onDirtyChange?: (dirty: boolean) => void;
- /**
- * objectstack#35018 — the open set's label (or the record-visibility
- * overview's title) for the copilot's chip: 「正在看:权限 · 组织成员」,
- * never the type word and machine name. Same seam as the Data and
- * Interfaces pillars' reports.
- */
- onSurfaceLabelChange?: (surface: StudioSurfaceLabel | null) => void;
-}): React.ReactElement {
- const client = useMetadataClient();
- const locale = useMetadataLocale();
- // See DataPillar's rail — same mobile-overlay treatment for the permission-set list.
- const isMobile = useIsMobile();
- const [railOpen, setRailOpen] = React.useState(false);
- // objectui#7255 — same live-pulse subscription as the sibling rails; this
- // one only replaces the permission-set LIST, so no edit-buffer hold.
- const metadataRefreshNonce = useMetadataRefreshNonce();
- const [perms, setPerms] = React.useState<
- Array<{ name: string; label: string; isDefault?: boolean; addedIn?: string }>
- >([]);
- const [loaded, setLoaded] = React.useState(false);
- const [error, setError] = React.useState(null);
- const [current, setCurrent] = React.useState(null);
- // objectstack#28572 (ADR-0146 D3) — the rail is the base's; on a read-only
- // base it lists the sets its pair adds too, and New lands in the pair. A set
- // the pair adds opens writable, read and saved at the pair: the open set's
- // matrix names `packageId` and asks `readOnly`, the open set's own. The
- // package-wide surfaces (the OWD overview, suggested bindings, Explain)
- // stay the base's.
- const railPairId = packageReadOnly && customization ? customization.pairId : null;
- const railMarks = railCustomizationsOf(customization?.marks, railPackageId);
- const [onlyCustomized, toggleOnlyCustomized] = useRailCustomizationsOnly();
- const newInPair = packageReadOnly && customization !== null && !customization.walled;
- const currentAddedIn = perms.find((p) => p.name === current)?.addedIn;
- const packageId = currentAddedIn ?? railPackageId;
- const readOnly = packageReadOnly && !currentAddedIn;
- // The Record Sharing Baseline (OWD) overview is a sibling surface to the
- // permission-set matrix (objectui#2505) — same package-author ownership
- // boundary, no principal dimension. `owdOpen` swaps the main panel to it;
- // `owdHighlight` carries the object a permission-matrix badge deep-linked to.
- const [owdOpen, setOwdOpen] = React.useState(false);
- const [owdHighlight, setOwdHighlight] = React.useState(null);
- const appliedOwdDeepLink = React.useRef(false);
- // `?surface=permission:` / `?surface=owd:overview` capture + mirror —
- // shared plumbing (see useSurfaceDeepLink). This rail keys `current` by name,
- // so wrap the open surface in the identity the param carries.
- const currentSurface = React.useMemo(
- () =>
- owdOpen
- ? { type: 'owd', name: 'overview' }
- : current
- ? { type: 'permission', name: current }
- : null,
- [owdOpen, current],
- );
- const initialSurface = useSurfaceDeepLink(currentSurface);
- // objectstack#28572 — see `useDeepLinkFallback`.
- const deepLinkUpgrade = useDeepLinkFallback();
- // objectstack#35018 — lift the open set's label to the copilot's chip, the
- // pillar's word first: 「正在看:权限 · 组织成员」. Keyed on primitives, the
- // callback read through a ref (the Data pillar's report).
- const onSurfaceLabelChangeRef = React.useRef(onSurfaceLabelChange);
- React.useEffect(() => {
- onSurfaceLabelChangeRef.current = onSurfaceLabelChange;
- });
- const accessSubject = t('engine.studio.copilot.subject.access', locale);
- const currentSetLabel = current ? perms.find((p) => p.name === current)?.label : undefined;
- const surfaceReportLabel = owdOpen
- ? `${accessSubject} · ${t('engine.studio.owd.title', locale)}`
- : current && currentSetLabel
- ? `${accessSubject} · ${currentSetLabel}`
- : undefined;
- const surfaceReportType = currentSurface?.type;
- const surfaceReportName = currentSurface?.name;
- React.useEffect(() => {
- onSurfaceLabelChangeRef.current?.(
- surfaceReportType && surfaceReportName && surfaceReportLabel
- ? { type: surfaceReportType, name: surfaceReportName, label: surfaceReportLabel }
- : null,
- );
- }, [surfaceReportType, surfaceReportName, surfaceReportLabel]);
- React.useEffect(
- () => () => {
- onSurfaceLabelChangeRef.current?.(null);
- },
- [],
- );
- const currentRef = React.useRef(current);
- React.useLayoutEffect(() => {
- currentRef.current = current;
- });
- const [query, setQuery] = React.useState('');
- // inline creator (same rail pattern as the Data pillar's object creator)
- const [creating, setCreating] = React.useState(false);
- const [createErr, setCreateErr] = React.useState(null);
- const [busy, setBusy] = React.useState(false);
- // objectstack#26836 — a create refused because the name is taken: which set
- // holds it, and whether it is this package's, so the dialog can open it.
- const [createTaken, setCreateTaken] = React.useState<{ name: string; label: string; here: boolean } | null>(null);
- // Which of the rail's sets are published, and which hold a pending draft:
- // the draft discard's two inputs, read by `load` with the rail.
- const [publishedNames, setPublishedNames] = React.useState>(() => new Set());
- const [draftNames, setDraftNames] = React.useState>(() => new Set());
- const [discarding, setDiscarding] = React.useState(false);
- // Bumped by a discard: the open matrix re-reads as it does after a publish,
- // since in both its draft is gone (added to `publishNonce` below).
- const [draftGoneNonce, setDraftGoneNonce] = React.useState(0);
- // [ADR-0090 D6] "why can this user access?" — right-side explain sheet.
- const [explainOpen, setExplainOpen] = React.useState(false);
- // objectstack#28573 (ADR-0146 D6) — "New similar" on a read-only base's set:
- // whether its dialog is open, and what the strip above the matrix says. A
- // `landed` strip is the copy the clone door saved, shown on that copy; a
- // `noPackage` / `noName` strip is an answer this pillar cannot open, shown
- // on the base. The copy usually opens in ANOTHER package, which remounts
- // this pillar (keyed by package), so the strip rides the navigation's state
- // and is read once here.
- const navigate = useNavigate();
- const location = useLocation();
- const [newSimilarOpen, setNewSimilarOpen] = React.useState(false);
- // objectstack#32774 — the package "New similar" clones the open set from,
- // as the matrix read it: named only where the set's name has more than one
- // holder (`onCloneSourceRead`), so a name with one holder is cloned by name.
- const [newSimilarSource, setNewSimilarSource] = React.useState<{ name: string; sourcePackage: string | undefined } | null>(
- null,
- );
- const onCloneSourceRead = React.useCallback((name: string, sourcePackage: string | undefined) => {
- setNewSimilarSource((prev) =>
- prev && prev.name === name && prev.sourcePackage === sourcePackage ? prev : { name, sourcePackage },
- );
- }, []);
- const [newSimilarStrip, setNewSimilarStrip] = React.useState(() => {
- // objectstack#28572 — a copy that landed in the base's pair arrives on
- // the base's surface; matched by the spec's pairing rule (a read).
- const pair = pairIdOf(railPackageId);
- return readNewSimilarArrival(location.state, railPackageId) ?? (pair ? readNewSimilarArrival(location.state, pair) : null);
- });
- // Who may press it: the clone door asks the metadata door's verdict
- // (`manage_metadata`), and under a wall the catalog is the platform
- // operator's (ADR-0131 D3), refused whatever the capability. Either way the
- // action draws disabled, with the console's own sentence for why.
- const canAuthorSets = useCanAuthorMetadata();
- const walledSets = useWalledCatalogReadOnly('permission');
- // objectui#12456 — the open set's tab (epic objectui#12446, decision C):
- // Objects, System capabilities, Row-level security, Tab visibility,
- // Delegated admin. Objects is the landing; the choice holds across sets.
- const [accessTab, setAccessTab] = React.useState('objects');
- // Both main-panel surfaces hold unsaved edits and unmount on a rail-driven
- // swap: the matrix page is keyed by `current` (and unmounts entirely when
- // the OWD overview swaps in), and the OWD overview batch-editor unmounts
- // when a set swaps back in. Each editor reports its dirty state up
- // (`onDirtyChange` — the two never coexist, so at most one bit is set), and
- // every swap is gated on this confirm — same native prompt as the metadata
- // editor's leave guard. Each editor resets its report on unmount, so a
- // confirmed discard clears its bit by itself.
- const [matrixDirty, setMatrixDirty] = React.useState(false);
- const [owdDirty, setOwdDirty] = React.useState(false);
- const pillarDirty = matrixDirty || owdDirty;
- // The combined bit also gates the Studio header's pillar/Home/package
- // navigation, which unmounts this whole pillar (objectui#2600) — mirror it
- // up alongside the local rail guard. Ref-stabilized like the editors' own
- // reports; the unmount cleanup reports `false` so a discarded pillar clears
- // the surface's guard state.
- const onDirtyChangeRef = React.useRef(onDirtyChange);
- React.useEffect(() => {
- onDirtyChangeRef.current = onDirtyChange;
- });
- React.useEffect(() => {
- onDirtyChangeRef.current?.(pillarDirty);
- }, [pillarDirty]);
- React.useEffect(
- () => () => {
- onDirtyChangeRef.current?.(false);
- },
- [],
- );
- const confirmDiscardEdits = React.useCallback(
- () => confirmDropUnsavedWork(pillarDirty, locale),
- [pillarDirty, locale],
- );
-
- // objectstack#28572 — the latest rail read wins: a read the pair's arrival
- // re-ran can finish before or after one a New in the pair asked for.
- const loadSeqRef = React.useRef(0);
- const load = React.useCallback(async (pairOverride?: string) => {
- const seq = ++loadSeqRef.current;
- const railPair = pairOverride ?? railPairId;
- try {
- // Scope the rail to this package server-side (ADR-0086 P1): the metadata
- // API filters `permission` by the record-level `package_id` provenance, so
- // it returns only the sets this package owns — environment-owned platform
- // defaults (`admin_full_access`, `member_default`, …) are excluded by the
- // backend, not the client. (The `?package=` list rows don't echo the
- // provenance columns, so a client-side filter can't do this.)
- //
- // ADR-0086 P2 (D6): a package permission set is draft/published metadata,
- // so the rail shows published ∪ pending-draft sets — a set created (or
- // renamed) as a draft but not yet published must still appear, just like
- // the Data/Interfaces pillars merge their drafts. Draft headers are
- // already package-scoped by `listDrafts({ packageId })`.
- const packageId = railPackageId;
- // objectstack#28572 — and, on a read-only base with a pair, the pair's
- // published and draft sets: those the base's list does not hold are the
- // sets the pair adds. A failed pair read lists none of them.
- const readPair = async () =>
- railPair === null
- ? null
- : Promise.all([
- client.list('permission', { packageId: railPair }) as Promise>>,
- client.listDrafts({ packageId: railPair, type: 'permission' }).catch(() => []),
- ]);
- const [list, drafts, pair] = await Promise.all([
- client.list('permission', { packageId }) as Promise>>,
- client.listDrafts({ packageId, type: 'permission' }).catch(() => []),
- readPair().catch(() => null),
- ]);
- if (seq !== loadSeqRef.current) return;
- const byName = new Map();
- for (const p of list || []) {
- const name = String(p.name ?? (p as Record).id ?? '');
- if (!name) continue;
- byName.set(name, {
- name,
- label: String(p.label ?? p.name ?? ''),
- isDefault: !!(p as Record).isDefault,
- });
- }
- // objectui#11862 — a draft-only set reads as the label its `_drafts` row
- // carries (objectstack-ai/objectstack#22200), in the designer locale; the
- // set is not read for it (ruling `6053526025`, question 1). A row with
- // no label leaves `label` empty, and the rail shows the name alone.
- for (const d of (drafts as Array<{ name?: string; label?: I18nLabel | null }>) || []) {
- const name = String(d?.name ?? '');
- if (!name || byName.has(name)) continue;
- byName.set(name, { name, label: navItemLabelText(d?.label ?? undefined, locale).trim() });
- }
- const [pairList, pairDrafts] = pair ?? [[], []];
- if (railPair !== null) {
- for (const p of pairList || []) {
- const name = String(p.name ?? (p as Record).id ?? '');
- if (!name || byName.has(name)) continue;
- byName.set(name, { name, label: String(p.label ?? p.name ?? ''), addedIn: railPair });
- }
- for (const d of (pairDrafts as Array<{ name?: string; label?: I18nLabel | null }>) || []) {
- const name = String(d?.name ?? '');
- if (!name || byName.has(name)) continue;
- byName.set(name, { name, label: navItemLabelText(d?.label ?? undefined, locale).trim(), addedIn: railPair });
- }
- }
- const scoped = [...byName.values()];
- setPerms(scoped);
- const nameOf = (p: Record) => String(p.name ?? p.id ?? '');
- setPublishedNames(new Set([...(list || []), ...(pairList || [])].map(nameOf)));
- setDraftNames(
- new Set(
- [...((drafts as Array<{ name?: string }>) || []), ...((pairDrafts as Array<{ name?: string }>) || [])]
- .map((d) => String(d?.name ?? ''))
- .filter(Boolean),
- ),
- );
- // A `?surface=owd:overview` deep-link opens the OWD overview instead of a
- // permission set; `current` still defaults to the first set so switching
- // back to the matrix has a target. Applied once — a later publish re-runs
- // `load`, and we must not yank the user back to OWD then.
- if (!appliedOwdDeepLink.current && initialSurface?.type === 'owd') {
- appliedOwdDeepLink.current = true;
- setOwdOpen(true);
- }
- const deepLinked = resolveSurfaceDeepLink(scoped, initialSurface, 'permission');
- // objectstack#28572 — a set the pair adds is listed once the pair is
- // known (`useDeepLinkFallback`).
- if (deepLinked && deepLinkUpgrade.take(currentRef.current, deepLinked.name)) {
- setCurrent(deepLinked.name);
- } else {
- if (!deepLinked && initialSurface?.type === 'permission' && currentRef.current === null) {
- deepLinkUpgrade.note(scoped[0]?.name ?? null);
- }
- setCurrent((c) => c ?? deepLinked?.name ?? scoped[0]?.name ?? null);
- }
- } catch (e) {
- if (seq === loadSeqRef.current) setError(formatMetadataError(e));
- } finally {
- if (seq === loadSeqRef.current) setLoaded(true);
- }
- }, [client, railPackageId, railPairId, locale]);
-
- React.useEffect(() => {
- void load();
- // Re-read after a package publish so drafts that went live collapse into
- // the published rail (ADR-0086 P2), and on the live-metadata pulse so a
- // copilot turn's permission set appears without a page reload (#7255).
- }, [load, publishNonce, metadataRefreshNonce]);
-
- const doCreate = React.useCallback(
- async (label: string, name: string) => {
- setBusy(true);
- setCreateErr(null);
- setCreateTaken(null);
- try {
- // A name a permission set already holds, published or as a draft, in
- // this package or any other, is refused here and nothing is written:
- // over a published set the first-write pin below would write this
- // blank skeleton as its pending draft (`findTakenIdentifier`).
- const taken = await findTakenIdentifier(client, 'permission', name, locale);
- if (taken) {
- setCreateTaken({ ...taken, here: perms.some((p) => p.name === name) });
- return;
- }
- // objectstack#28572 (ADR-0146 D3) — on a read-only base the set is
- // created in its pair, which the ensure door answers (creating it on
- // first use, without a prompt).
- const target =
- packageReadOnly && customization ? (await customization.ensurePackage()).packageId : railPackageId;
- // Package door → a DRAFT stamped with this package (D6/D7).
- // objectui#11773 — and the door refuses a draft row too (the
- // first-write pin), for one that lands between the check above and
- // this save. A set published in that window is not refused by it.
- await client.save('permission', name, buildPermissionSkeleton(name, label), {
- mode: 'draft',
- packageId: target,
- ifNoneMatch: '*',
- surface: 'studio',
- });
- // objectstack#36511 — then that one set is published, so it is live at
- // once like every Save in Studio. A refused publish takes back the
- // draft it wrote, so nothing is created, and says why.
- const live = await publishSavedItem(client, { type: 'permission', name, packageId: target }, false);
- if (!live.ok) {
- setCreateErr(formatMetadataError(live.error));
- return;
- }
- toast.success(tFormat('engine.studio.access.created', locale, { label }));
- setCreating(false);
- // A set made in the pair is read back from the pair the door named.
- await load(target === railPackageId ? undefined : target);
- // Land on the new set's matrix — also from the OWD overview, whose
- // discard the "+ New" gate already confirmed up front.
- setOwdOpen(false);
- setCurrent(name);
- } catch (e) {
- // objectstack#26846 — the first-write pin's refusal, for a draft that
- // landed after the check above, read by its code: this create sent
- // the pin, so a conflict means the identifier holds a draft. The
- // door's sentence speaks of the pin itself and is not shown.
- setCreateErr(
- errorCodeIs(e, 'METADATA_CONFLICT')
- ? tFormat('engine.studio.access.createDraftTaken', locale, { name })
- : formatMetadataError(e),
- );
- } finally {
- setBusy(false);
- }
- },
- [client, load, railPackageId, packageReadOnly, customization, locale, perms],
- );
-
- // The refusal's way out: the taken set is this package's, so it opens in
- // the matrix instead of a second one being made. The "+ New" gate already
- // confirmed any discard of unsaved edits.
- const openTakenSet = React.useCallback((name: string) => {
- setCreating(false);
- setCreateTaken(null);
- setOwdOpen(false);
- setCurrent(name);
- }, []);
-
- // objectstack#28573 — the clone door saved a copy of the open set. It opens
- // only where the answer says it landed: that package's Access pillar with
- // the copy selected. An answer that names no copy, or no package, is said
- // so and opens nothing; the landing is never derived from the base.
- const onNewSimilarSaved = React.useCallback(
- (copy: PermissionSetCloned) => {
- setNewSimilarOpen(false);
- if (!copy.name) {
- setNewSimilarStrip({ kind: 'noName', notice: copy.notice, noticeCode: copy.noticeCode });
- return;
- }
- if (typeof copy.package !== 'string') {
- setNewSimilarStrip({ kind: 'noPackage', name: copy.name, notice: copy.notice, noticeCode: copy.noticeCode });
- return;
- }
- const landed: NewSimilarStrip = {
- kind: 'landed',
- name: copy.name,
- package: copy.package,
- notice: copy.notice,
- noticeCode: copy.noticeCode,
- };
- // objectstack#28572 — the pair's sets are this surface's too.
- if (copy.package === railPackageId || (railPairId !== null && copy.package === railPairId)) {
- setNewSimilarStrip(landed);
- setOwdOpen(false);
- setCurrent(copy.name);
- void load();
- return;
- }
- navigate(studioPillarItemPath(copy.package, 'access', { type: 'permission', name: copy.name }), {
- state: { [NEW_SIMILAR_ARRIVAL_STATE]: landed },
- });
- },
- [railPackageId, railPairId, navigate, load],
- );
-
- // Discard the open set's pending draft (`DELETE ?state=draft` at this
- // package's address, the door the metadata editor's "Discard draft" uses).
- // A published set goes back to its live body; a set that was never
- // published has nothing left, so it leaves the rail.
- const discardDraft = React.useCallback(
- async (name: string) => {
- const row = perms.find((p) => p.name === name);
- const item = row?.label || name;
- const neverPublished = !publishedNames.has(name);
- // One confirm: an unsaved edit on the open matrix is an unpublished
- // change of this same set, and the discard removes it with the rest.
- if (
- !window.confirm(
- tFormat(
- neverPublished ? 'engine.studio.access.discardConfirmUnpublished' : 'engine.studio.access.discardConfirm',
- locale,
- { item },
- ),
- )
- ) {
- return;
- }
- setDiscarding(true);
- try {
- await client.reset('permission', name, { state: 'draft', packageId });
- toast.success(tFormat('engine.edit.draftDiscarded', locale, { item }));
- if (neverPublished) setCurrent((c) => (c === name ? null : c));
- // The open matrix holds the discarded draft and the pin it was read
- // with: read it again, as after a publish (its draft is gone).
- setDraftGoneNonce((n) => n + 1);
- onDraftSaved?.();
- await load();
- } catch (e) {
- toast.error(t('engine.studio.access.discardFailed', locale), {
- description: formatMetadataError(e),
- classNames: { description: 'whitespace-pre-line' },
- });
- } finally {
- setDiscarding(false);
- }
- },
- [perms, publishedNames, locale, client, packageId, onDraftSaved, load],
- );
-
- const filtered = perms.filter(
- (p) =>
- (!query.trim() ||
- p.label.toLowerCase().includes(query.trim().toLowerCase()) ||
- p.name.toLowerCase().includes(query.trim().toLowerCase())) &&
- // objectstack#28572 — "only customizations" keeps the marked rows.
- (!onlyCustomized || railMarks?.markOf({ type: 'permission', ...p }) != null),
- );
- const markedSets = railMarks ? perms.filter((p) => railMarks.markOf({ type: 'permission', ...p }) !== null).length : 0;
-
- // objectui#12459 — the item header inside the content column. The
- // "Permission matrix" band above the rail retires. objectui#12456 — an
- // open set's header is the matrix page's own (its label, api name, Package
- // chip, granted / override counts, History, the tab row), fed the three
- // pieces below; this pillar draws the header for the OWD overview and for
- // the empty states.
- const accessRailToggleEl = (
-
- );
- // objectui#11781 — "saved as draft" is what an editable package does. A
- // read-only one saves nothing: objectui#12453 puts the read-only link where
- // the note was, and the link's title carries the note's sentence. An open
- // set's header draws it at the tab row's right end (objectui#12456: the
- // title row truncated the set's label at the 1280 px design width).
- // objectui#12524 — the writable note is this pillar's draft status: the
- // header draws it in the status place every pillar shares. The read-only
- // link is an action, so it stays in the actions slot.
- // The note speaks for what the main panel shows: the open set, or the
- // package-wide OWD overview and empty header, which are the base's.
- const noteReadOnly = owdOpen || current === null ? packageReadOnly : readOnly;
- // objectstack#29674 — an open set the pair adds lists its base's objects
- // too (`permissionObjectScopePackages`), so its note names the base instead
- // of claiming "this package's objects" only.
- const notePairBase = !owdOpen && current !== null && currentAddedIn ? (customization?.baseLabel ?? railPackageId) : null;
- const accessStatus: StudioItemStatus | undefined = noteReadOnly
- ? undefined
- : notePairBase !== null
- ? {
- label: tFormat('engine.studio.access.bannerPair', locale, { package: notePairBase }),
- title: tFormat('engine.studio.access.bannerTitlePair', locale, { package: notePairBase }),
- }
- : { label: t('engine.studio.access.banner', locale), title: t('engine.studio.access.bannerTitle', locale) };
- const accessNoteEl = accessStatus ? (
-
- ) : (
-
- );
- const accessExplainEl = (
-
- );
- // The rail's "+" — and the empty block's button, which runs this same
- // handler (objectui#12514). Creating a set lands on the new set's matrix — a
- // remount of the open matrix, or a swap out of the OWD overview — so gate
- // the flow up front.
- const openCreateSet = packageReadOnly && !newInPair
- ? undefined
- : () => {
- if (!confirmDiscardEdits()) return;
- setCreateErr(null);
- setCreateTaken(null);
- setCreating(true);
- };
- // objectstack#26836 — the open set's pending draft can be discarded where
- // the set is edited; nothing in Studio offered it, so a blank draft over a
- // live set could only be published.
- const accessDiscardEl =
- !readOnly && current && !owdOpen && draftNames.has(current) ? (
-
- ) : null;
- // objectstack#28573 (ADR-0146 D6) — a read-only base's set offers "New
- // similar", never an override: the copy is a NEW set, in the package the
- // clone door chooses. Disabled, it says why in the console's words.
- const newSimilarBlocked = walledSets
- ? tFormat('engine.catalog.readOnly.walled', locale, { type: translateMetadataType('permission', locale) })
- : canAuthorSets
- ? null
- : t('engine.edit.capabilityReadOnly', locale);
- const accessNewSimilarEl =
- readOnly && current && !owdOpen ? (
-
-
- {newSimilarBlocked !== null && (
-
- {newSimilarBlocked}
-
- )}
-
- ) : null;
- const newSimilarStripEl =
- newSimilarStrip && !owdOpen && (newSimilarStrip.kind !== 'landed' || newSimilarStrip.name === current) ? (
-
- ) : null;
- const accessHeaderEl = (
-
- {noteReadOnly && accessNoteEl}
- {accessExplainEl}
- >
- }
- />
- );
-
- // A suggestion names its set by machine name only; the banner, its toasts
- // and its state lines name it by the label the rail shows for that set
- // (`ux-conventions.labels-over-machine-names`). The suggestions listed here
- // are this package's own sets, which the rail read; a set the rail does not
- // hold, or one with no label, is named by its machine name.
- const suggestedSetLabel = (s: SuggestedBinding): string => suggestedSetLabelOf(s, perms);
-
- return (
-
- {/* ADR-0090 D5/D9 — this package's suggested audience bindings
- (isDefault sets shipped by the package) and the deployment's
- decision on each. Renders nothing when there are none or for a
- caller without manage_metadata (the list answers 403); accept and
- revoke are enforced server-side by the anchor gates. Drawn on a
- read-only package too: accepting or dismissing a suggestion is a
- deployment decision about the package, not an edit of it, and a
- marketplace-installed package — read-only here — is the one that
- ships an isDefault set. Only this strip ignores `packageReadOnly`;
- every affordance that edits the package keeps its gate. */}
-
- tFormat(
- s.anchor === 'guest'
- ? 'engine.studio.access.suggestPromptGuest'
- : 'engine.studio.access.suggestPromptEveryone',
- locale,
- { set: suggestedSetLabel(s) },
- ),
- confirm: t('engine.studio.access.suggestConfirm', locale),
- confirming: t('engine.studio.access.suggestConfirming', locale),
- dismiss: t('engine.studio.access.suggestDismiss', locale),
- confirmedToast: (s) =>
- tFormat('engine.studio.access.suggestConfirmedToast', locale, {
- set: suggestedSetLabel(s),
- anchor: s.anchor,
- }),
- dismissedToast: (s) =>
- tFormat('engine.studio.access.suggestDismissedToast', locale, { set: suggestedSetLabel(s) }),
- guestUnsupported: t('engine.studio.access.suggestGuestUnsupported', locale),
- acceptedState: (s) =>
- tFormat('engine.studio.access.suggestAcceptedState', locale, { set: suggestedSetLabel(s) }),
- notInForceState: (s) =>
- tFormat('engine.studio.access.suggestNotInForceState', locale, { set: suggestedSetLabel(s) }),
- dismissedState: (s) =>
- tFormat('engine.studio.access.suggestDismissedState', locale, { set: suggestedSetLabel(s) }),
- revoke: t('engine.studio.access.suggestRevoke', locale),
- revoking: t('engine.studio.access.suggestRevoking', locale),
- revokedToast: (s) =>
- tFormat('engine.studio.access.suggestRevokedToast', locale, { set: suggestedSetLabel(s) }),
- reopen: t('engine.studio.access.suggestReopen', locale),
- reopening: t('engine.studio.access.suggestReopening', locale),
- reopenedToast: (s) =>
- tFormat('engine.studio.access.suggestReopenedToast', locale, { set: suggestedSetLabel(s) }),
- }}
- />
-
-
- {isMobile && railOpen && (
-
setRailOpen(false)}
- aria-hidden="true"
- />
- )}
-
- }
- pinned={
- // Pinned sibling surface: the package-wide Record Sharing Baseline
- // (OWD) overview (objectui#2505). Same package-author ownership as
- // the sets below, but a distinct surface — not a permission set.
-
- {
- // Re-clicking the open overview is a no-op — nothing
- // remounts, so no confirm (mirrors the set re-click below).
- if (owdOpen) {
- setOwdHighlight(null);
- if (isMobile) setRailOpen(false);
- return;
- }
- if (!confirmDiscardEdits()) return;
- setOwdOpen(true);
- setOwdHighlight(null);
- if (isMobile) setRailOpen(false);
- }}
- icon={}
- className="font-medium"
- >
- {t('engine.studio.owd.railLabel', locale)}
-
-
- }
- isMobile={isMobile}
- open={railOpen}
- >
- {/* objectui#12514 — the empty sentence names the "+" it points at;
- without one, the content column's block speaks alone. */}
- {perms.length === 0 && (error || !loaded || openCreateSet) && (
-
- )}
- {filtered.map((p) => (
- {
- if (!owdOpen && current === p.name) {
- if (isMobile) setRailOpen(false);
- return;
- }
- if (!confirmDiscardEdits()) return;
- setOwdOpen(false);
- setCurrent(p.name);
- if (isMobile) setRailOpen(false);
- }}
- icon={}
- name={p.label.trim() ? p.label : p.name}
- trailing={
- <>
-
- {p.isDefault ? (
- {t('perm.badge.default', locale)}
- ) : null}
- >
- }
- >
- {/* objectui#11862 — the set's label. objectstack#34795: the
- machine name is no longer drawn as secondary text; it is the
- row's tooltip. A set listed from its draft header alone has
- no label in hand (the header carries none), so its name is
- the text, as before. */}
-
-
-
-
- ))}
-
-
-
- {(owdOpen || !current) && accessHeaderEl}
- {newSimilarStripEl}
-
- {owdOpen ? (
- /* Sibling surface: the package-wide OWD baseline overview
- * (objectui#2505) — object × sharingModel,
- * batch-edited as per-object drafts. */
-
- ) : current ? (
- /* The existing Salesforce-style matrix page in its Studio
- * presentation (objectui#12456): the item header and five tabs
- * are the page's own, its autosave + destructive-change guard
- * included. The OWD chip deep-links to the overview above. */
- {
- // The set now holds a pending draft, so its discard shows.
- setDraftNames((names) => (names.has(current) ? names : new Set(names).add(current)));
- onDraftSaved?.();
- // objectstack#26846 — and the rail reads the sets again, so a
- // label this save changed shows there without a publish or a
- // reload.
- void load();
- }}
- onSaved={() => {
- // objectstack#36511 — the top bar's Save published the set: no
- // draft of it is left, and the rail reads its label again.
- setDraftNames((names) => {
- if (!names.has(current)) return names;
- const next = new Set(names);
- next.delete(current);
- return next;
- });
- void load();
- }}
- readOnly={readOnly}
- onDirtyChange={setMatrixDirty}
- embedded
- // objectstack#29809 — the header's provenance chip reads the
- // mark this set's rail row draws, so the two tell one story.
- customizationMark={railMarks?.markOf({ type: 'permission', name: current, addedIn: currentAddedIn }) ?? null}
- studio={{
- tab: accessTab,
- onTabChange: setAccessTab,
- onCloneSourceRead,
- leading: accessRailToggleEl,
- chips: currentAddedIn ? (
- <>
-
- {accessNoteEl}
- >
- ) : (
- accessNoteEl
- ),
- actions: (
- <>
- {accessNewSimilarEl}
- {accessDiscardEl}
- {accessExplainEl}
- >
- ),
- }}
- onOpenOwd={(objectName) => {
- // The badge deep-link swaps this page out for the OWD
- // overview — same remount, same guard.
- if (!confirmDiscardEdits()) return;
- setOwdHighlight(objectName || null);
- setOwdOpen(true);
- }}
- />
- ) : loaded && !error && perms.length === 0 ? (
- // objectui#12514 — one centered block whose button runs the rail's "+".
-
-
- )
- }
- />
-
- ) : null}
-
-
-
-
-
-
- {/* objectstack#28573 — the clone door's dialog, shared with Setup's
- catalog: a name and a label, nothing else, refusals verbatim. */}
- {newSimilarOpen && current && (
- setNewSimilarOpen(false)}
- onCloned={onNewSimilarSaved}
- />
- )}
-
- openTakenSet(createTaken.name) : undefined}
- />
- )
- }
- onSubmit={({ label, name }) => void doCreate(label, name)}
- />
-
- );
-}
diff --git a/ui/packages/app-shell/src/views/studio-design/CreateItemDialog.oneLabel-11787.test.ts b/ui/packages/app-shell/src/views/studio-design/CreateItemDialog.oneLabel-11787.test.ts
index 3d8908f7266..fe3ee872a9a 100644
--- a/ui/packages/app-shell/src/views/studio-design/CreateItemDialog.oneLabel-11787.test.ts
+++ b/ui/packages/app-shell/src/views/studio-design/CreateItemDialog.oneLabel-11787.test.ts
@@ -66,8 +66,12 @@ function createDialogSites(): Site[] {
const DRAFT_LABEL = "t('engine.studio.createDraft', locale)";
const LIVE_LABEL = "t('engine.studio.createLive', locale)";
-/** The dialogs of the live editors, by their title key (objectstack#36511). */
-const LIVE_TITLES = ['engine.studio.data.newObject', 'engine.studio.auto.newTitle', 'engine.studio.access.new'];
+/**
+ * The dialogs of the live editors, by their title key (objectstack#36511).
+ * objectstack#36905 — the Access pillar's went with the pillar: a permission
+ * set is created from its type's list.
+ */
+const LIVE_TITLES = ['engine.studio.data.newObject', 'engine.studio.auto.newTitle'];
const titleKeyOf = (site: Site): string | undefined => site.props.match(/title=\{t\('([^']+)'/)?.[1];
diff --git a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx
index b68bef3131d..ba7a1446f1b 100644
--- a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx
@@ -30,7 +30,7 @@
*/
import * as React from 'react';
-import { Lock, ArrowUpRight } from 'lucide-react';
+import { ArrowUpRight } from 'lucide-react';
import type { MetadataClient, MetadataLayered } from '@object-ui/data-objectstack';
// The ONE draft-envelope reader (objectui#8181): unwrap AND strip the
// framework's read decorations in one place. This file used to carry its own
@@ -545,20 +545,13 @@ export function PackageOwdOverviewPanel({
];
return (
- {/* objectui#12456 — the overview's title and subtitle are the Access
- pillar's item header above this panel, so its own header is the
- toolbar row: what the dials decide. objectstack#36511 — its Save is
- the top bar's. */}
+ {/* objectui#12456 — the overview's title and subtitle are the item
+ header above this panel, so its own header is the toolbar row: what
+ the dials decide. objectstack#36511 — its Save is the top bar's.
+ objectstack#36905 — a read-only package's one mark is that header's
+ (objectui#12453), so this row draws none. */}