From 21b627fe1675554c0499d4d113c103b00435524b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 00:34:53 +0000 Subject: [PATCH 1/3] =?UTF-8?q?fix(studio):=20permission=20title,=20?= =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E7=9C=8B=20line=20and=20field=20panel=20head?= =?UTF-8?q?er=20use=20names,=20not=20internal=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The open permission set's title is its label alone; the note under it and the tab-row note read in the builder's words. The Access and Automations rails report the open item's label to the copilot's 正在看 line. The Data rail's field panel draws one header row with one close button; the field's machine name stays under 开发者信息; the right slot's foot strip that repeated the 属性 | AI 助手 switch is gone. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzfrh8TiPJf1i2kMSoa --- .changeset/35018-studio-names-a.md | 17 +++ .../metadata-admin/PermissionMatrixEditor.tsx | 20 ++-- ...aPillar.baseObjectExtension-28575.test.tsx | 4 +- ...taPillar.readOnlyRailReason-12303.test.tsx | 47 +++++++- ...esignSurface.accessPairCopy-29674.test.tsx | 4 +- ...dioDesignSurface.accessTabs-12456.test.tsx | 3 +- ...DesignSurface.accessWording-34795.test.tsx | 26 ++++- .../StudioDesignSurface.aiChipLabel.test.tsx | 36 +++++- ...Surface.kanbanCardSelection-12725.test.tsx | 5 +- ...Surface.leafColumnSelection-12725.test.tsx | 6 +- ...ignSurface.pillarsClaimSlot-12725.test.tsx | 19 ++-- ...udioDesignSurface.rightSlot-12725.test.tsx | 27 ++--- .../studio-design/StudioDesignSurface.tsx | 103 ++++++++++++++++-- .../views/studio-design/StudioRightSlot.tsx | 34 +----- .../__tests__/studioRightSlot-12725.test.tsx | 17 +-- ui/packages/i18n/src/namespaces/studio/en.ts | 15 ++- ui/packages/i18n/src/namespaces/studio/zh.ts | 15 ++- 17 files changed, 292 insertions(+), 106 deletions(-) create mode 100644 .changeset/35018-studio-names-a.md diff --git a/.changeset/35018-studio-names-a.md b/.changeset/35018-studio-names-a.md new file mode 100644 index 00000000000..cbda3cf37fd --- /dev/null +++ b/.changeset/35018-studio-names-a.md @@ -0,0 +1,17 @@ +--- +'@object-ui/app-shell': patch +'@object-ui/i18n': patch +--- + +fix(studio): the permission page title, the AI panel's 正在看 line and the field panel header use names, not internal names + +Clause-②: no +Metadata-protocol: none + +Three Studio surfaces still showed internal names. They now use the names the builder gave: + +- **Permission page.** The open permission set's title is the set's label alone. The app's name is already in the top bar, so the title no longer starts with it. The line under the title reads 随应用提供 / "Included with the app" instead of 包内置 / "Package". The note at the right of the tab row reads 本应用的对象 · 发布后生效 / "This app’s objects · applies on publish" instead of 仅本包对象 · 保存为草稿. The Setup pages keep their own wording. +- **AI panel 正在看 line.** On the Access and Automations rails the line reads the rail's word and the open item's label, for example 「正在看:权限 · 组织成员」 or 「正在看:流程 · 新会议提醒」, as the Data rail's 「正在看:会议 · 记录」 does. It no longer shows `permission · app_…_member_access`. The type and machine name stay on the line's hover title. What the agent receives is unchanged. +- **Field properties panel.** One header row: 字段属性 (Field properties), the field's label, the field's actions and one close button. The field's machine name shows only under 开发者信息 (Developer info). The 「AI 助手 / 回到对话 →」 strip at the foot of the right panel is gone, because the 属性 | AI 助手 switch at the top does the same thing and carries the same pending count. + +`@object-ui/i18n`: three new `studio` namespace keys (`engine.studio.access.origin.app`, `engine.studio.copilot.subject.access`, `engine.studio.copilot.subject.flow`). The en and zh values of `engine.studio.access.banner` and `engine.studio.access.bannerPair` are reworded. 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 543c7767fb8..91c0958ffd0 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx @@ -534,11 +534,6 @@ export interface PermissionStudioChrome { chips?: React.ReactNode; /** Before History in the header's actions (the pillar's Explain access). */ actions?: React.ReactNode; - /** - * objectstack#34795 — the open app's name. The header's title reads - * "app · set label"; without it, the set's label alone. - */ - appLabel?: string; /** * objectstack#32774 — told, for the set `name` this editor shows, the * package the clone door must name to copy it (`holdingPackage` of the @@ -2314,11 +2309,12 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved, const chipButton = 'inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground'; const facetTab = chrome.tab === 'rls' || chrome.tab === 'tabs' || chrome.tab === 'admin' ? chrome.tab : null; - // objectstack#34795 — the title is "app · set label", in the title row - // alone, so it is not cut: the set's machine name is the title's tooltip, - // and the provenance, default and lock labels are the line under it. - const setLabel = headerLabel || name; - const studioTitle = chrome.appLabel ? `${chrome.appLabel} · ${setLabel}` : setLabel; + // objectstack#35018 — the title is the set's label alone: the app's name + // is the top bar's, so it is not repeated here (objectstack#34795 put it + // in front). The title row holds nothing else, so it is not cut; the + // 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; return (
{/* 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('perm.badge.package') : t('perm.badge.custom')} + {shippedByPackage ? t('engine.studio.access.origin.app') : t('perm.badge.custom')} {!!draft.isDefault && ( <> diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.baseObjectExtension-28575.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.baseObjectExtension-28575.test.tsx index 107b5b783da..37dcdfa29de 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.baseObjectExtension-28575.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.baseObjectExtension-28575.test.tsx @@ -237,7 +237,9 @@ describe('Studio adds a field to a read-only base object as an extension in its // Wanted 3 — it shows in the Form at once, and its inspector edits the extension. expect(cardOf('Region')).toHaveLength(1); const inspector = await screen.findByTestId('data-field-inspector'); - expect(within(inspector).getByText('region__c')).toBeInTheDocument(); + // objectstack#35018 — the header names the field by its label; its machine name is under 开发者信息. + expect(within(inspector.querySelector('header') as HTMLElement).getByText('Region')).toBeInTheDocument(); + expect(within(within(inspector).getByTestId('field-developer-section')).getByDisplayValue('region__c')).toBeInTheDocument(); const label = within(inspector).getByTestId('field-label-input'); expect(label).toBeEnabled(); expect(within(inspector).queryByTestId('field-base-patch-only')).toBeNull(); diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.readOnlyRailReason-12303.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.readOnlyRailReason-12303.test.tsx index 97d6cd3f747..efbfc761202 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.readOnlyRailReason-12303.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.readOnlyRailReason-12303.test.tsx @@ -116,7 +116,8 @@ describe('Data pillar Field properties on a read-only package — the reason rea const apiName = within(body).getByDisplayValue('priority'); expect(apiName).toBeDisabled(); // objectstack#34794 — Remove is the header ⋯ menu's entry; the menu is disabled. - expect(within(body).getByTestId('field-more-menu')).toBeDisabled(); + // objectstack#35018 — that menu sits in the rail's one header row now. + expect(within(rail.querySelector('header') as HTMLElement).getByTestId('field-more-menu')).toBeDisabled(); }); it('hovering the disabled controls opens a tooltip with the reason', async () => { @@ -131,7 +132,7 @@ describe('Data pillar Field properties on a read-only package — the reason rea const user = userEvent.setup(); const rail = await openRail(true); const body = rail.querySelector('[data-disabled-reason]') as HTMLElement; - // The rail header's own close button (the inspector inside has one too). + // The rail header's close button, the rail's only one (objectstack#35018). within(rail.querySelector('header') as HTMLElement).getByRole('button', { name: L('engine.studio.close') }).focus(); await user.tab(); expect(body).toHaveFocus(); @@ -146,3 +147,45 @@ describe('Data pillar Field properties on a read-only package — the reason rea expect(screen.queryByText(REASON)).toBeNull(); }); }); + +/** The text a reader sees in `root`: text in a `hidden` subtree (a collapsed section) is left out. */ +function visibleText(root: HTMLElement): string { + const parts: string[] = []; + const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, { + acceptNode: (node) => (node.parentElement?.closest('[hidden]') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT), + }); + for (let node = walker.nextNode(); node; node = walker.nextNode()) parts.push(node.textContent ?? ''); + return parts.join(''); +} + +// objectstack#35018 — the Field properties rail draws ONE header row: the +// field's label as its title and ONE close button; the field's machine name is +// not on show until 开发者信息 is opened. +describe('Data pillar Field properties: one header row (objectstack#35018)', () => { + it('one header, one close button, titled by the field label', async () => { + const rail = await openRail(false); + const closes = within(rail).getAllByRole('button', { name: /^close$/i }); + expect(closes).toHaveLength(1); + expect(rail.querySelectorAll('header')).toHaveLength(1); + const header = rail.querySelector('header') as HTMLElement; + expect(header).toContainElement(closes[0]); + expect(header).toHaveTextContent(L('engine.studio.data.fieldProps')); + expect(header).toHaveTextContent('Priority'); + // The inspector draws no header strip of its own inside the rail. + expect(within(rail).getByTestId('inspector-shell-hosted')).toBeInTheDocument(); + // Its actions (the ⋯ menu) are in the one header row. + expect(within(header).getByTestId('field-more-menu')).toBeInTheDocument(); + }); + + it('the machine name is not on show by default; 开发者信息 holds it', async () => { + const rail = await openRail(false); + expect(visibleText(rail)).not.toContain('priority'); + // CONTROL: the scan reads the rendered rail — the label is in it, and the + // collapsed developer section holds the API name input. + expect(visibleText(rail)).toContain('Priority'); + const developer = within(rail).getByTestId('field-developer-section'); + expect(within(developer).getByDisplayValue('priority')).not.toBeVisible(); + fireEvent.click(within(developer).getByTestId('field-developer-toggle')); + expect(within(developer).getByDisplayValue('priority')).toBeVisible(); + }); +}); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessPairCopy-29674.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessPairCopy-29674.test.tsx index ebd2602dc1b..737647913d1 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessPairCopy-29674.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessPairCopy-29674.test.tsx @@ -303,7 +303,7 @@ describe('the header’s provenance chip follows the rail’s mark (objectstack# await copyOpen(); await waitFor(() => expect(railMarkOf('My contributor')).toBe('added'), { timeout: 8000 }); expect(chip()).toHaveTextContent(t('perm.badge.custom', 'en')); - expect(chip()).not.toHaveTextContent(t('perm.badge.package', 'en')); + expect(chip()).not.toHaveTextContent(t('engine.studio.access.origin.app', 'en')); }); it('a set created in the pair: Custom in the header, Added in the rail', async () => { @@ -320,6 +320,6 @@ describe('the header’s provenance chip follows the rail’s mark (objectstack# // The read has answered: the copy's row is marked, the base set's is not. await waitFor(() => expect(railMarkOf('My contributor')).toBe('added'), { timeout: 8000 }); expect(railMarkOf('Contributor')).toBeNull(); - expect(chip()).toHaveTextContent(t('perm.badge.package', 'en')); + expect(chip()).toHaveTextContent(t('engine.studio.access.origin.app', 'en')); }); }); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessTabs-12456.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessTabs-12456.test.tsx index ba6ef2134c3..47e66bed08f 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessTabs-12456.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessTabs-12456.test.tsx @@ -123,7 +123,8 @@ describe('Access pillar — the open set is a header and five tabs (objectui#124 // objectstack#34795 — the api name is the title's tooltip, not a chip. expect(header().getByRole('heading', { level: 1 })).toHaveAttribute('title', 'guest_portal'); expect(header().queryByText('guest_portal')).toBeNull(); - expect(header().getByTestId('perm-provenance-badge')).toHaveTextContent(en('perm.badge.package')); + // objectstack#35018 — the Studio note reads the builder's words, not the package term. + expect(header().getByTestId('perm-provenance-badge')).toHaveTextContent(en('engine.studio.access.origin.app')); expect(header().getByText('1 object granted · 0 field overrides')).toBeInTheDocument(); expect(header().getByRole('button', { name: en('engine.studio.access.explain.open') })).toBeInTheDocument(); expect(header().getByRole('button', { name: en('engine.edit.history') })).toBeInTheDocument(); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessWording-34795.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessWording-34795.test.tsx index 77f28dd29bb..b38a3b39e3f 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessWording-34795.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessWording-34795.test.tsx @@ -6,7 +6,8 @@ * • an accepted member-access suggestion reads as one sentence, and its * action reads 「取消默认授予」 while it makes the same call 撤销 made * (the dismiss door on the accepted row, ADR-0090 D5/D9 unchanged); - * • the open set's title is "app · set label"; the set's machine name is + * • the open set's title is the set's label alone (objectstack#35018: the + * app's name is the top bar's, not repeated); the set's machine name is * the title's tooltip, not page text, and the rail row's too; * • every object row draws 「全选 · 只读 · 清空」 (and the CRUD arm as a * fourth) without a hover, and each writes what All / R / None / CRUD @@ -127,7 +128,7 @@ async function mountZh(withSuggestion = true) { render( - + , ); @@ -169,20 +170,33 @@ describe('objectstack#34795 — the accepted suggestion reads as one business se }); describe('objectstack#34795 — the open set: title, tooltip, terms', () => { - it('the title reads "app · set label"; the machine name is its tooltip and the rail row tooltip', async () => { + it('the title reads the set label alone — no app name; the machine name is its tooltip and the rail row tooltip', async () => { api.list.mockResolvedValue([ACCEPTED]); await mountZh(); const title = within(screen.getByTestId('access-item-header')).getByTestId('perm-studio-title'); - expect(title).toHaveTextContent('会议纪要 · 组织成员'); + // objectstack#35018 — the app's name is the top bar's; the title is the set's label, whole. + expect(title.textContent).toBe('组织成员'); + expect(screen.getByTestId('access-item-header').textContent).not.toContain('会议纪要'); // CONTROL: the machine name stays reachable — on the title's tooltip and the rail row's. expect(title).toHaveAttribute('title', SET); expect(screen.getByTestId(`access-rail-set-${SET}`)).toHaveAttribute('title', SET); // The three labels are the line under the title. const note = screen.getByTestId('perm-studio-title-note'); - expect(note).toHaveTextContent(zh('perm.badge.package')); + expect(note).toHaveTextContent(zh('engine.studio.access.origin.app')); expect(note).toHaveTextContent(zh('perm.badge.default')); }); + it('objectstack#35018 — the note and the tab row say it in the builder words: no 包内置, no 本包', async () => { + api.list.mockResolvedValue([ACCEPTED]); + await mountZh(); + const header = screen.getByTestId('access-item-header'); + expect(within(header).getByTestId('perm-studio-title-note')).toHaveTextContent( + `${zh('engine.studio.access.origin.app')}·${zh('perm.badge.default')}`, + ); + expect(header.textContent).not.toContain('包内置'); + expect(header.textContent).not.toContain('本包'); + }); + it('the tabs read in the card words', async () => { api.list.mockResolvedValue([]); await mountZh(false); @@ -208,7 +222,7 @@ describe('objectstack#34795 — the open set: title, tooltip, terms', () => { expect(text).not.toContain('CRUD'); // CONTROL: the scan reads the rendered page — the sentence and the title are in it. expect(text).toContain('所有成员默认拥有这个权限集'); - expect(text).toContain('会议纪要 · 组织成员'); + expect(text).toContain('组织成员'); expect(text).toContain('谁能看到哪些记录'); }); }); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.aiChipLabel.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.aiChipLabel.test.tsx index c6292755d42..06dedbe8bab 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.aiChipLabel.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.aiChipLabel.test.tsx @@ -130,6 +130,9 @@ window.matchMedia = ((query: string) => ({ disconnect() {} }; +const SET = 'b2r4_member_access'; +const FLOW = 'b2r4_new_meeting_alert'; + const NAV = [ { id: 'nav_dash', type: 'dashboard', label: '客户仪表盘', dashboardName: 'b2r4_customer_dashboard' }, // A leaf the author never labelled. @@ -157,6 +160,9 @@ beforeEach(() => { if (path.startsWith('/api/v1/ai/conversations/')) return json({ id: 'conv_8219', messages: [] }); if (path === '/api/v1/meta/_drafts') return json([]); if (path === '/api/v1/meta/app') return json([{ name: 'acme_app', label: '客户管理' }]); + // objectstack#35018 — the Access and Automations rails' items. + if (path === '/api/v1/meta/permission') return json([{ name: SET, label: '组织成员', isDefault: true }]); + if (path === '/api/v1/meta/flow') return json([{ name: FLOW, label: '新会议提醒', type: 'autolaunched' }]); if (path === '/api/v1/meta/app/acme_app/layers') { return json({ code: null, @@ -177,10 +183,10 @@ afterEach(() => { vi.unstubAllGlobals(); }); -function renderStudio() { +function renderStudio(entry = `/studio/${PACKAGE_ID}/interfaces`) { return render( - + } /> @@ -222,3 +228,29 @@ describe('Studio copilot chip reads the selected item label (objectui#8219 item ); }); }); + +// objectstack#35018 — the Access and Automations rails report their open +// item's label too: the chip reads the rail's word and the label, as the Data +// rail's 「会议 · 记录」 does — never the type word (`permission` / `flow`) or +// the machine name, which stay on the tooltip and in the agent's data. +describe('objectstack#35018 — 正在看 on the Access and Automations rails reads a label', () => { + it('Access: 「正在看:权限 · 组织成员」, no type word, no machine name', async () => { + renderStudio(`/studio/${PACKAGE_ID}/access?surface=permission:${SET}`); + await waitFor(() => expect(chip.surfaceContextLabel).toBe('正在看:权限 · 组织成员'), { timeout: 6000 }); + expect(String(chip.surfaceContextLabel)).not.toContain('permission'); + expect(String(chip.surfaceContextLabel)).not.toContain(SET); + // CONTROL: the identity stays reachable on the tooltip, and the agent's data is the URL's. + expect(chip.surfaceContextTitle).toBe(`permission · ${SET}`); + expect(JSON.stringify(agentSurface())).toBe( + JSON.stringify({ pillar: 'access', artifact: { type: 'permission', name: SET } }), + ); + }); + + it('Automations: 「正在看:流程 · 新会议提醒」, no type word, no machine name', async () => { + renderStudio(`/studio/${PACKAGE_ID}/automations?surface=flow:${FLOW}`); + await waitFor(() => expect(chip.surfaceContextLabel).toBe('正在看:流程 · 新会议提醒'), { timeout: 6000 }); + expect(String(chip.surfaceContextLabel)).not.toContain('flow'); + expect(String(chip.surfaceContextLabel)).not.toContain(FLOW); + expect(chip.surfaceContextTitle).toBe(`flow · ${FLOW}`); + }); +}); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx index 5d46241991f..0a11b5c8da7 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx @@ -363,8 +363,9 @@ describe("a card on a kanban leaf's canvas selects the board's card (objectui#12 ); expect(openRecord).not.toHaveBeenCalled(); expect(press).not.toHaveBeenCalled(); - // The copilot stays, folded to the strip at the slot's foot. - expect(slot().lastElementChild).toBe(screen.getByTestId('studio-slot-copilot-strip')); + // The copilot stays, behind the header's switch (objectstack#35018: no strip at the foot). + expect(within(slot()).getByTestId('studio-slot-tab-copilot')).toHaveAttribute('aria-selected', 'false'); + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); // Another card moves the outline; still nothing opens. fireEvent.click(await card('Cyd')); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx index 8c9843fcf0b..f5a060232e7 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx @@ -275,9 +275,9 @@ describe("a column header on an object leaf's canvas selects that column (object ); // Selected, not sorted. expect(drawnTitles()).toEqual(['Bob', 'Ada', 'Cyd']); - // The copilot stays, folded to the strip at the slot's foot. - const strip = screen.getByTestId('studio-slot-copilot-strip'); - expect(slot().lastElementChild).toBe(strip); + // The copilot stays, behind the header's switch (objectstack#35018: no strip at the foot). + expect(within(slot()).getByTestId('studio-slot-tab-copilot')).toHaveAttribute('aria-selected', 'false'); + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); expect(screen.getByTestId('copilot-body')).not.toBeVisible(); // Another listed header moves the selection; still no sort. diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx index 17c6494520d..23a56a167e2 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx @@ -238,7 +238,7 @@ describe('Data: the field inspector is in the right slot (objectui#12725)', () = expect(screen.queryByTestId('data-field-inspector')).toBeNull(); }); - it("selecting a field switches the slot to 属性 with that field's inspector, the copilot a strip at its foot", async () => { + it("selecting a field switches the slot to 属性 with that field's inspector, the copilot behind the header switch", async () => { await selectDataField(); expect(slot()).toHaveAttribute('data-mode', 'props'); @@ -248,8 +248,9 @@ describe('Data: the field inspector is in the right slot (objectui#12725)', () = expect(slotProps().contains(screen.getByTestId('data-field-inspector'))).toBe(true); expect(within(slotProps()).getByTestId('stub-field-inspector')).toBeVisible(); expect(screen.getByTestId('copilot-body')).not.toBeVisible(); - const strip = screen.getByTestId('studio-slot-copilot-strip'); - expect(slot().lastElementChild).toBe(strip); + // objectstack#35018 — no strip at the slot's foot: the header's 属性 | AI 助手 switch leads back. + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); + expect(within(slot()).getByTestId('studio-slot-tab-copilot')).toHaveAttribute('aria-selected', 'false'); }); it('Esc drops the selection and hands the slot back; an Escape another layer took does not', async () => { @@ -281,13 +282,14 @@ describe('Data: the field inspector is in the right slot (objectui#12725)', () = it('a second field selected while the copilot shows asks for the properties again', async () => { await selectDataField(); - fireEvent.click(screen.getByTestId('studio-slot-copilot-strip')); + fireEvent.click(screen.getByTestId('studio-slot-tab-copilot')); expect(slot()).toHaveAttribute('data-mode', 'copilot'); // The selection stands: the copilot stays chosen. expect(within(slotProps()).getByTestId('stub-field-inspector')).toBeInTheDocument(); // The same field again is no new selection: the copilot stays chosen. - fireEvent.click(screen.getByText('Title').closest('[role="button"]') as HTMLElement); + // objectstack#35018 — the rail's header names the field too: the canvas card is the one pressed. + fireEvent.click(within(screen.getByTestId('data-canvas-main')).getByText('Title').closest('[role="button"]') as HTMLElement); expect(slot()).toHaveAttribute('data-mode', 'copilot'); fireEvent.click(screen.getByText('Due').closest('[role="button"]') as HTMLElement); @@ -322,7 +324,7 @@ describe('Automations: the Configuration is in the right slot (objectui#12725)', expect(slotProps()).toHaveTextContent(t('engine.studio.auto.emptyLine1', 'en')); }); - it("selecting a node switches the slot to 属性 with that node's configuration, the copilot a strip at its foot", async () => { + it("selecting a node switches the slot to 属性 with that node's configuration, the copilot behind the header switch", async () => { await openFlow(); fireEvent.click(screen.getByTestId('pick-node')); @@ -331,7 +333,8 @@ describe('Automations: the Configuration is in the right slot (objectui#12725)', expect(screen.getAllByTestId('auto-config-aside')).toHaveLength(1); expect(screen.queryByTestId('auto-config-drawer')).toBeNull(); expect(screen.getByTestId('copilot-body')).not.toBeVisible(); - expect(slot().lastElementChild).toBe(screen.getByTestId('studio-slot-copilot-strip')); + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); + expect(within(slot()).getByTestId('studio-slot-tab-copilot')).toHaveAttribute('aria-selected', 'false'); }); it("Esc returns to the flow's own Configuration; an Escape typed in the inspector is the field's", async () => { @@ -362,7 +365,7 @@ describe('Automations: the Configuration is in the right slot (objectui#12725)', await openFlow(); fireEvent.click(screen.getByTestId('pick-node')); await waitFor(() => expect(slot()).toHaveAttribute('data-mode', 'props')); - fireEvent.click(screen.getByTestId('studio-slot-copilot-strip')); + fireEvent.click(screen.getByTestId('studio-slot-tab-copilot')); expect(slot()).toHaveAttribute('data-mode', 'copilot'); fireEvent.click(screen.getByTestId('pick-other-node')); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.rightSlot-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.rightSlot-12725.test.tsx index 19ffbeb806c..70b89547be8 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.rightSlot-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.rightSlot-12725.test.tsx @@ -191,23 +191,22 @@ describe('Studio right slot: properties OR the copilot (objectui#12725)', () => expect(slotProps().contains(screen.getByTestId('if-inspector'))).toBe(true); }); - it("selecting an element switches the slot to that element's properties, the copilot a strip at its foot", async () => { + it("selecting an element switches the slot to that element's properties, the copilot behind the header switch", async () => { await openDashboard(); await selectBlock(); const inspector = within(slotProps()).getByTestId('stub-inspector'); expect(inspector).toBeVisible(); expect(screen.getByTestId('copilot-body')).not.toBeVisible(); - const strip = screen.getByTestId('studio-slot-copilot-strip'); - expect(strip).toHaveTextContent(t('engine.studio.aiCopilot', 'en')); - expect(strip).toHaveTextContent(t('engine.studio.slot.backToChat', 'en')); - expect(slot().lastElementChild).toBe(strip); + // objectstack#35018 — no strip at the slot's foot; the header's switch leads back. + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); + const copilotTab = within(slot()).getByTestId('studio-slot-tab-copilot'); expect(screen.getByTestId('if-canvas-hint')).toHaveTextContent( tFormat('engine.studio.if.canvasHint.selected', 'en', { label: 'Revenue' }), ); - // The strip leads back to the conversation; the selection stays. - fireEvent.click(strip); + // The switch leads back to the conversation; the selection stays. + fireEvent.click(copilotTab); expect(slot()).toHaveAttribute('data-mode', 'copilot'); expect(screen.getByTestId('copilot-body')).toBeVisible(); expect(within(slotProps()).getByTestId('stub-inspector')).toBeInTheDocument(); @@ -306,26 +305,24 @@ describe('Studio right slot: properties OR the copilot (objectui#12725)', () => }); // objectstack#25943 — 「AI 助手 · N 项待确认」: the count of items the - // copilot proposed, on the tab's badge and in the folded strip. - it('the copilot tab and strip count the items that await approval', async () => { + // copilot proposed, on the tab's badge (objectstack#35018: the strip is gone). + it('the copilot tab counts the items that await approval, while the properties show too', async () => { copilot.planPendingCount = 2; await openDashboard(); await waitFor(() => expect(screen.getByTestId('studio-slot-plan-pending')).toHaveTextContent('2')); const pending = tFormat('engine.studio.slot.pendingCount', 'en', { count: 2 }); expect(within(slot()).getAllByRole('tab')[1]).toHaveAccessibleDescription(pending); await selectBlock(); - expect(screen.getByTestId('studio-slot-strip-plan-pending')).toHaveTextContent(pending); - expect(screen.getByTestId('studio-slot-copilot-strip')).toHaveTextContent( - `${t('engine.studio.aiCopilot', 'en')} · ${pending}`, - ); + expect(within(slot()).getAllByRole('tab')[1]).toHaveAccessibleDescription(pending); + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); }); - it('with nothing awaiting approval, neither the tab nor the strip carries a count', async () => { + it('with nothing awaiting approval, the tab carries no count', async () => { await openDashboard(); expect(screen.queryByTestId('studio-slot-plan-pending')).toBeNull(); expect(within(slot()).getAllByRole('tab')[1]).not.toHaveAttribute('aria-describedby'); await selectBlock(); - expect(screen.getByTestId('studio-slot-copilot-strip')).toBeVisible(); + expect(within(slot()).getAllByRole('tab')[1]).not.toHaveAttribute('aria-describedby'); expect(screen.queryByTestId('studio-slot-strip-plan-pending')).toBeNull(); }); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx index 41f3a980a86..f55bc71521c 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx @@ -1926,6 +1926,7 @@ function StudioDesignSurfaceBody({ aiSlot, area }: StudioDesignSurfaceProps): Re readOnly={readOnly} customization={customization} onHeldEditChange={setHeldEdit} + onSurfaceLabelChange={setSurfaceLabel} /> ) : tab === 'access' ? ( // objectstack#28573 — keyed by package like its siblings: "New @@ -1941,7 +1942,7 @@ function StudioDesignSurfaceBody({ aiSlot, area }: StudioDesignSurfaceProps): Re readOnly={readOnly} customization={customization} onDirtyChange={setPillarDirty} - packageLabel={pkgEntry?.id === packageId ? pkgEntry.name : undefined} + onSurfaceLabelChange={setSurfaceLabel} /> ) : ( // objectui#11203 / objectui#11232 — keyed by package. A package @@ -7030,6 +7031,19 @@ export function DataPillar({ baseOwnedFields !== null && baseOwnedFields.has(String(fieldSel.id)); const addFieldWalledId = React.useId(); + // objectstack#35018 — the field rail draws ONE header: the aside's names the + // field (its label, one close) and the shared field inspector below draws + // none of its own (`InspectorShellHostProvider`, the flow inspector's + // objectui#12488 seam); its actions sit in this header's slot. The field's + // machine name is not in the header: it is the inspector's 开发者信息. + const [fieldHeaderSlot, setFieldHeaderSlot] = React.useState(null); + const fieldRailHosted = fieldSel?.kind === 'field' && Boolean(inspector); + const fieldRailTitle = React.useMemo(() => { + if (fieldSel?.kind !== 'field') return undefined; + const entry = readFields(shownDraft.fields).entries.find((e) => e.name === fieldSel.id); + const label = entry?.def.label; + return typeof label === 'string' && label ? label : String(fieldSel.id); + }, [fieldSel, shownDraft.fields]); // objectui#12725 — the field rail is up exactly when the render below draws // it; that is when the pillar holds the slot's properties half. A selection @@ -7941,11 +7955,21 @@ export function DataPillar({ className={inSlot ? 'w-full flex-1 border-l-0' : undefined} eyebrow={t(fieldSel.kind === 'group' ? 'engine.studio.data.groupProps' : 'engine.studio.data.fieldProps', locale)} eyebrowId={fieldRailTitleId} - id={fieldSel.id} + title={fieldRailHosted ? fieldRailTitle : undefined} + id={fieldRailHosted ? undefined : fieldSel.id} onClose={() => setFieldSel(null)} closeLabel={t('engine.studio.close', locale)} // objectui#12725 — the copilot's 草稿 chip on a field it changed. - actions={fieldAgentMark ? : undefined} + actions={ + fieldAgentMark || fieldRailHosted ? ( + <> + {fieldAgentMark && } + {fieldRailHosted && ( + + )} + + ) : undefined + } // objectui#12453 — a read-only package saves no draft: no footer. footer={fieldRailReadOnly ? null : t('engine.studio.inspector.draftFooter', locale)} bodyClassName="flex min-h-0 flex-1 flex-col" @@ -7967,6 +7991,7 @@ export function DataPillar({ // the pair's extension: its own fields whole, a base field // within the display-property whitelist only. + {React.createElement(inspector, { type: 'object', name: current.name, @@ -7980,6 +8005,7 @@ export function DataPillar({ readOnly: fieldRailReadOnly, locale, })} + ) : ( /* No field inspector registered. ⛔ Not "loading…": the read @@ -8149,6 +8175,7 @@ export function AutomationsPillar({ readOnly: packageReadOnly = false, customization = null, onHeldEditChange, + onSurfaceLabelChange, }: { /** * The package whose flows the rail lists, or `null` for the package-less @@ -8171,6 +8198,11 @@ export function AutomationsPillar({ customization?: StudioBaseCustomization | null; /** objectui#11786 — the clause of the edit the autosave holds unsent, for the surface's Publish. */ onHeldEditChange?: (clause: string | null) => void; + /** + * objectstack#35018 — the open flow's label for the copilot's chip: + * 「正在看:流程 · 新会议提醒」, never the type word and machine name. + */ + onSurfaceLabelChange?: (surface: StudioSurfaceLabel | null) => void; }): React.ReactElement { const client = useMetadataClient(); const locale = useMetadataLocale(); @@ -8325,6 +8357,30 @@ export function AutomationsPillar({ const [selection, setSelection] = React.useState(null); // The package's translations of the flow label and its approval-step labels (flow-label-translations.tsx). const flowLabels = useFlowLabelTranslations(current?.name ?? ''); + // objectstack#35018 — lift the open flow's label to the copilot's chip, the + // pillar's word first: 「正在看:流程 · 新会议提醒」 — the label the canvas + // header reads. Keyed on primitives, the callback read through a ref. + const onSurfaceLabelChangeRef = React.useRef(onSurfaceLabelChange); + React.useEffect(() => { + onSurfaceLabelChangeRef.current = onSurfaceLabelChange; + }); + const currentFlowType = current?.type; + const currentFlowName = current?.name; + const currentFlowLabel = current ? flowLabels?.flowLabel || current.label : undefined; + const flowSubject = t('engine.studio.copilot.subject.flow', locale); + React.useEffect(() => { + onSurfaceLabelChangeRef.current?.( + currentFlowType && currentFlowName && currentFlowLabel + ? { type: currentFlowType, name: currentFlowName, label: `${flowSubject} · ${currentFlowLabel}` } + : null, + ); + }, [currentFlowType, currentFlowName, currentFlowLabel, flowSubject]); + React.useEffect( + () => () => { + onSurfaceLabelChangeRef.current?.(null); + }, + [], + ); const [loading, setLoading] = React.useState(false); const [saving, setSaving] = React.useState(false); const [hasDraft, setHasDraft] = React.useState(false); @@ -10130,7 +10186,7 @@ export function AccessPillar({ readOnly: packageReadOnly = false, customization = null, onDirtyChange, - packageLabel, + onSurfaceLabelChange, }: { packageId: string; publishNonce?: number; @@ -10145,8 +10201,13 @@ export function AccessPillar({ * beforeunload). Reports `false` when the pillar unmounts, same contract as * PermissionMatrixEditPage's own onDirtyChange. */ onDirtyChange?: (dirty: boolean) => void; - /** objectstack#34795 — the open app's name: the open set's title reads "app · set". */ - packageLabel?: string; + /** + * 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(); @@ -10197,6 +10258,35 @@ export function AccessPillar({ 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; @@ -10951,7 +11041,6 @@ export function AccessPillar({ studio={{ tab: accessTab, onTabChange: setAccessTab, - appLabel: packageLabel || undefined, onCloneSourceRead, leading: accessRailToggleEl, chips: currentAddedIn ? ( diff --git a/ui/packages/app-shell/src/views/studio-design/StudioRightSlot.tsx b/ui/packages/app-shell/src/views/studio-design/StudioRightSlot.tsx index 7dd142d8783..9ac7219bad0 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioRightSlot.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioRightSlot.tsx @@ -18,10 +18,11 @@ * and renders into * `propsTarget`. A pillar that claims nothing keeps its own aside, and the * slot shows the copilot alone (the header reads as a title, not a switch). - * - While the properties show, the copilot folds to a 40 px strip at the - * slot's foot that leads back to the conversation. - * - The copilot segment and the strip say how many items the copilot - * proposed await the author's confirmation (「N 项待确认」, objectstack#25943). + * - objectstack#35018 — while the properties show, the header's 属性 | AI 助手 + * switch is the one way back to the conversation: the 40 px 「AI 助手 / + * 回到对话 →」 strip that also stood at the slot's foot is gone. + * - The copilot segment says how many items the copilot proposed await the + * author's confirmation (「N 项待确认」, objectstack#25943). * - Both bodies stay MOUNTED and are hidden by mode: a turn the copilot is * streaming survives a look at the properties, and a pillar's portal target * never disappears under an open editor. @@ -33,7 +34,7 @@ */ import * as React from 'react'; -import { ArrowRight, History, Maximize2, Minimize2, SlidersHorizontal, Sparkles, X } from 'lucide-react'; +import { History, Maximize2, Minimize2, SlidersHorizontal, Sparkles, X } from 'lucide-react'; import { Button, cn } from '@object-ui/components'; import { useObjectTranslation } from '@object-ui/i18n'; import { t, tFormat } from '../metadata-admin/i18n.js'; @@ -267,29 +268,6 @@ export function StudioRightSlot({ > {copilot}
- {showsProps && copilotAvailable && ( - - )} ); diff --git a/ui/packages/app-shell/src/views/studio-design/__tests__/studioRightSlot-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/__tests__/studioRightSlot-12725.test.tsx index 8c5ddd1835c..f29d0238036 100644 --- a/ui/packages/app-shell/src/views/studio-design/__tests__/studioRightSlot-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/__tests__/studioRightSlot-12725.test.tsx @@ -113,13 +113,16 @@ describe('StudioRightSlot', () => { expect(onModeChange).toHaveBeenLastCalledWith('props'); }); - it('folds the copilot into a strip while the properties show; the strip leads back', () => { + it('hides the copilot while the properties show; the header switch leads back, with no strip at the foot', () => { const { onModeChange } = renderSlot({ mode: 'props' }); expect(screen.getByTestId('studio-slot-props')).toBeVisible(); expect(screen.getByTestId('studio-slot-copilot')).not.toBeVisible(); // Still mounted: a turn in flight survives a look at the properties. expect(screen.getByTestId('copilot-body')).toBeInTheDocument(); - fireEvent.click(screen.getByTestId('studio-slot-copilot-strip')); + // objectstack#35018 — the 「AI 助手 / 回到对话 →」 strip repeated the switch; it is gone. + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); + expect(screen.queryByText(t('engine.studio.slot.backToChat', 'en'))).toBeNull(); + fireEvent.click(screen.getByTestId('studio-slot-tab-copilot')); expect(onModeChange).toHaveBeenLastCalledWith('copilot'); }); @@ -153,13 +156,11 @@ describe('StudioRightSlot', () => { expect(onOverlayDismiss).toHaveBeenCalledTimes(1); }); - // objectstack#25943 — the StudioRailProps strip, 「AI 助手 · N 项待确认 · 回到对话 →」 - // (objectstack#34725 named the panel 「AI 助手」, as the console names it). - it('zh: the folded strip reads 「AI 助手 · 3 项待确认」 and the copilot tab carries the 3', () => { + // objectstack#25943 — 「N 项待确认」 on the copilot tab (objectstack#34725 named + // the panel 「AI 助手」; objectstack#35018 dropped the strip that repeated it). + it('zh: while the properties show, the copilot tab carries the 3 and no strip repeats it', () => { renderSlot({ mode: 'props', planPendingCount: 3, locale: 'zh-CN' }); - const strip = screen.getByTestId('studio-slot-copilot-strip'); - expect(strip).toHaveTextContent('AI 助手 · 3 项待确认'); - expect(strip).toHaveTextContent(t('engine.studio.slot.backToChat', 'zh-CN')); + expect(screen.queryByTestId('studio-slot-copilot-strip')).toBeNull(); const copilotTab = screen.getAllByRole('tab')[1]; expect(within(copilotTab).getByTestId('studio-slot-plan-pending')).toHaveTextContent('3'); expect(copilotTab).toHaveAccessibleDescription('3 项待确认'); diff --git a/ui/packages/i18n/src/namespaces/studio/en.ts b/ui/packages/i18n/src/namespaces/studio/en.ts index 90c3d5036ea..8faa43c2193 100644 --- a/ui/packages/i18n/src/namespaces/studio/en.ts +++ b/ui/packages/i18n/src/namespaces/studio/en.ts @@ -2697,15 +2697,20 @@ const STUDIO_EN: Record = { 'engine.studio.access.title': 'Permission matrix', 'engine.studio.access.subtitle': 'Object permissions · field-level read/write', 'engine.studio.access.bannerTitle': - 'This matrix lists only the objects this package declares, and “Save” merges just that slice — grants contributed by other packages are preserved. Edits are saved as package drafts and go live when you Publish the package (top bar), exactly like Data and Interfaces.', - 'engine.studio.access.banner': 'This package’s objects · saved as draft', + 'Only this app’s objects are listed here, and saving changes only this app’s grants — grants from other apps stay as they are. Changes are saved as a draft and go live when you Publish the app (top bar), as in Data and Interfaces.', + 'engine.studio.access.banner': 'This app’s objects · applies on publish', // objectstack#29674 — the note on an open set the base's pair adds: its matrix lists the base's objects too. - 'engine.studio.access.bannerPair': 'This package’s and {package}’s objects · saved as draft', + 'engine.studio.access.bannerPair': 'This app’s and {package}’s objects · applies on publish', + // objectstack#35018 — the open set's origin in the builder's words (the Studio title note). + 'engine.studio.access.origin.app': 'Included with the app', + // objectstack#35018 — the word before the open item's label on the copilot's "Viewing" line. + 'engine.studio.copilot.subject.access': 'Access', + 'engine.studio.copilot.subject.flow': 'Flow', 'engine.studio.access.bannerTitlePair': - 'This permission set is in the customization package for {package}, so the matrix lists {package}’s objects as well as the ones this package declares, and “Save” merges just that slice — grants contributed by other packages are preserved. Edits are saved as package drafts and go live when you Publish the package (top bar).', + 'This permission set is part of the customization of {package}, so {package}’s objects are listed as well as this app’s, and saving changes only these grants — grants from other apps stay as they are. Changes are saved as a draft and go live when you Publish (top bar).', // objectui#11781 — a read-only package saves no draft; objectui#12453 makes this the header link's title. 'engine.studio.access.bannerTitleReadOnly': - 'This matrix lists only the objects this package declares. The package is read-only: its permission sets can be viewed here, but not changed.', + 'Only this app’s objects are listed here. This app is read-only: you can view its permission sets but not change them.', // ADR-0090 D5/D9 — pending suggested audience bindings (isDefault sets // awaiting the admin's confirm; the server never auto-binds). 'engine.studio.access.suggestPromptEveryone': 'Suggested: every member gets “{set}” by default, and new members get it automatically.', diff --git a/ui/packages/i18n/src/namespaces/studio/zh.ts b/ui/packages/i18n/src/namespaces/studio/zh.ts index 8b0e31e3188..23f40be43ed 100644 --- a/ui/packages/i18n/src/namespaces/studio/zh.ts +++ b/ui/packages/i18n/src/namespaces/studio/zh.ts @@ -2408,14 +2408,19 @@ const STUDIO_ZH: Record = { 'engine.studio.access.title': '权限矩阵', 'engine.studio.access.subtitle': '对象权限 · 字段级读写', 'engine.studio.access.bannerTitle': - '此矩阵仅列出本包声明的对象,「Save」只合并本包切片 —— 其他包贡献的授权原样保留。编辑保存为软件包草稿,点击顶栏「发布」后随整个包一起生效(与数据、界面一致)。', - 'engine.studio.access.banner': '仅本包对象 · 保存为草稿', + '这里只列出本应用的对象,保存时只改本应用的授权,其他应用给出的授权保持不变。改动先保存为草稿,点击顶栏「发布」后随应用一起生效(与数据、界面一致)。', + 'engine.studio.access.banner': '本应用的对象 · 发布后生效', // objectstack#29674 — the note on an open set the base's pair adds: its matrix lists the base's objects too. - 'engine.studio.access.bannerPair': '本包及 {package} 的对象 · 保存为草稿', + 'engine.studio.access.bannerPair': '本应用及 {package} 的对象 · 发布后生效', + // objectstack#35018 — the open set's origin in the builder's words (the Studio title note). + 'engine.studio.access.origin.app': '随应用提供', + // objectstack#35018 — the word before the open item's label on the copilot's 「正在看」 line. + 'engine.studio.copilot.subject.access': '权限', + 'engine.studio.copilot.subject.flow': '流程', 'engine.studio.access.bannerTitlePair': - '此权限集位于 {package} 的定制包中,因此矩阵除本包声明的对象外,也列出 {package} 的对象;「Save」只合并这一切片 —— 其他包贡献的授权原样保留。编辑保存为软件包草稿,点击顶栏「发布」后随整个包一起生效。', + '这个权限集属于 {package} 的定制,所以除本应用的对象外也列出 {package} 的对象;保存时只改这部分授权,其他应用给出的授权保持不变。改动先保存为草稿,点击顶栏「发布」后生效。', 'engine.studio.access.bannerTitleReadOnly': - '此矩阵仅列出本包声明的对象。本软件包为只读:其权限集可在此查看,但不能修改。', + '这里只列出本应用的对象。这个应用是只读的:可以查看它的权限集,但不能修改。', // ADR-0090 D5/D9 — 待确认的受众绑定建议(isDefault 权限集,管理员确认后生效,服务端绝不自动绑定) 'engine.studio.access.suggestPromptEveryone': '建议让所有成员默认拥有「{set}」,新加入的人也会自动拥有。', 'engine.studio.access.suggestPromptGuest': '建议让未登录的访客默认拥有「{set}」。', From 992a138c2ccf965819d60c1aba97fd50d085b19f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 01:18:31 +0000 Subject: [PATCH 2/3] test(studio): the badge's Studio wording, and collection-time preloads for the edited slot tests Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzfrh8TiPJf1i2kMSoa --- .../PermissionMatrixEditor.badge.test.tsx | 14 +++++++++++--- ...esignSurface.kanbanCardSelection-12725.test.tsx | 2 ++ ...esignSurface.leafColumnSelection-12725.test.tsx | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.badge.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.badge.test.tsx index 1daade0fbd2..d7a222d3421 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.badge.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.badge.test.tsx @@ -12,10 +12,16 @@ * a stray `managedBy` (an old stored row) must not move the answer. * * Both sites are pinned: the routed page's badge, and the Studio Access - * pillar's kind chip (`studio`). They read one derivation, so they agree. + * pillar's kind chip (`studio`). They read one derivation, so they agree; the + * Studio chip words the package answer for the builder (objectstack#35018: + * "Included with the app"), the page keeps "Package". */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -88,17 +94,19 @@ async function renderWith(site: Site, extra: Record, packageId? } const badgeText = () => screen.getByTestId('perm-provenance-badge').textContent; +/** The package answer as each site words it (objectstack#35018). */ +const PACKAGE_TEXT: Record = { page: 'Package', studio: 'Included with the app' }; describe.each(['page', 'studio'])('the provenance badge (%s site)', (site) => { it('a set opened under a packageId reads "Package"', async () => { await renderWith(site, {}, 'com.example.sales'); - expect(badgeText()).toBe('Package'); + expect(badgeText()).toBe(PACKAGE_TEXT[site]); }); it('a set whose code layer is a package artifact reads "Package"', async () => { codeLayer = { _packageId: 'com.example.sales', name: 'sales_perms' }; await renderWith(site, {}); - expect(badgeText()).toBe('Package'); + expect(badgeText()).toBe(PACKAGE_TEXT[site]); }); it('a set with neither reads "Added"', async () => { diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx index 0a11b5c8da7..323fe561b0d 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.kanbanCardSelection-12725.test.tsx @@ -27,6 +27,8 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches it through dynamic imports: its first load is paid at collection. +import '@objectstack/lint'; import * as React from 'react'; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'; diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx index f5a060232e7..13e9dc3103c 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.leafColumnSelection-12725.test.tsx @@ -26,6 +26,8 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches it through dynamic imports: its first load is paid at collection. +import '@objectstack/lint'; import * as React from 'react'; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'; From adeba0162cf642a80d8cf9489d20a48dcc294074 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 01:41:33 +0000 Subject: [PATCH 3/3] fix(studio): the tab-row note keeps main's width, so it is not cut with the AI panel open Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzfrh8TiPJf1i2kMSoa --- .changeset/35018-studio-names-a.md | 4 ++-- ui/packages/i18n/src/namespaces/studio/en.ts | 4 ++-- ui/packages/i18n/src/namespaces/studio/zh.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.changeset/35018-studio-names-a.md b/.changeset/35018-studio-names-a.md index cbda3cf37fd..4b7e5a0a12e 100644 --- a/.changeset/35018-studio-names-a.md +++ b/.changeset/35018-studio-names-a.md @@ -10,8 +10,8 @@ Metadata-protocol: none Three Studio surfaces still showed internal names. They now use the names the builder gave: -- **Permission page.** The open permission set's title is the set's label alone. The app's name is already in the top bar, so the title no longer starts with it. The line under the title reads 随应用提供 / "Included with the app" instead of 包内置 / "Package". The note at the right of the tab row reads 本应用的对象 · 发布后生效 / "This app’s objects · applies on publish" instead of 仅本包对象 · 保存为草稿. The Setup pages keep their own wording. +- **Permission page.** The open permission set's title is the set's label alone. The app's name is already in the top bar, so the title no longer starts with it. The line under the title reads 随应用提供 / "Included with the app" instead of 包内置 / "Package". The note at the right of the tab row reads 本应用对象 · 发布后生效 / "This app’s objects · live on publish" instead of 仅本包对象 · 保存为草稿. The Setup pages keep their own wording. - **AI panel 正在看 line.** On the Access and Automations rails the line reads the rail's word and the open item's label, for example 「正在看:权限 · 组织成员」 or 「正在看:流程 · 新会议提醒」, as the Data rail's 「正在看:会议 · 记录」 does. It no longer shows `permission · app_…_member_access`. The type and machine name stay on the line's hover title. What the agent receives is unchanged. - **Field properties panel.** One header row: 字段属性 (Field properties), the field's label, the field's actions and one close button. The field's machine name shows only under 开发者信息 (Developer info). The 「AI 助手 / 回到对话 →」 strip at the foot of the right panel is gone, because the 属性 | AI 助手 switch at the top does the same thing and carries the same pending count. -`@object-ui/i18n`: three new `studio` namespace keys (`engine.studio.access.origin.app`, `engine.studio.copilot.subject.access`, `engine.studio.copilot.subject.flow`). The en and zh values of `engine.studio.access.banner` and `engine.studio.access.bannerPair` are reworded. +`@object-ui/i18n`: three new `studio` namespace keys (`engine.studio.access.origin.app`, `engine.studio.copilot.subject.access`, `engine.studio.copilot.subject.flow`). The en and zh values of `engine.studio.access.banner`, `engine.studio.access.bannerPair` and their hover texts (`engine.studio.access.bannerTitle`, `bannerTitlePair`, `bannerTitleReadOnly`) are reworded: they say "app" where they said "package", and no longer name a 「Save」 button. diff --git a/ui/packages/i18n/src/namespaces/studio/en.ts b/ui/packages/i18n/src/namespaces/studio/en.ts index 8faa43c2193..120a593f2b2 100644 --- a/ui/packages/i18n/src/namespaces/studio/en.ts +++ b/ui/packages/i18n/src/namespaces/studio/en.ts @@ -2698,9 +2698,9 @@ const STUDIO_EN: Record = { 'engine.studio.access.subtitle': 'Object permissions · field-level read/write', 'engine.studio.access.bannerTitle': 'Only this app’s objects are listed here, and saving changes only this app’s grants — grants from other apps stay as they are. Changes are saved as a draft and go live when you Publish the app (top bar), as in Data and Interfaces.', - 'engine.studio.access.banner': 'This app’s objects · applies on publish', + 'engine.studio.access.banner': 'This app’s objects · live on publish', // objectstack#29674 — the note on an open set the base's pair adds: its matrix lists the base's objects too. - 'engine.studio.access.bannerPair': 'This app’s and {package}’s objects · applies on publish', + 'engine.studio.access.bannerPair': 'This app’s and {package}’s objects · live on publish', // objectstack#35018 — the open set's origin in the builder's words (the Studio title note). 'engine.studio.access.origin.app': 'Included with the app', // objectstack#35018 — the word before the open item's label on the copilot's "Viewing" line. diff --git a/ui/packages/i18n/src/namespaces/studio/zh.ts b/ui/packages/i18n/src/namespaces/studio/zh.ts index 23f40be43ed..0448e0e30db 100644 --- a/ui/packages/i18n/src/namespaces/studio/zh.ts +++ b/ui/packages/i18n/src/namespaces/studio/zh.ts @@ -2409,9 +2409,9 @@ const STUDIO_ZH: Record = { 'engine.studio.access.subtitle': '对象权限 · 字段级读写', 'engine.studio.access.bannerTitle': '这里只列出本应用的对象,保存时只改本应用的授权,其他应用给出的授权保持不变。改动先保存为草稿,点击顶栏「发布」后随应用一起生效(与数据、界面一致)。', - 'engine.studio.access.banner': '本应用的对象 · 发布后生效', + 'engine.studio.access.banner': '本应用对象 · 发布后生效', // objectstack#29674 — the note on an open set the base's pair adds: its matrix lists the base's objects too. - 'engine.studio.access.bannerPair': '本应用及 {package} 的对象 · 发布后生效', + 'engine.studio.access.bannerPair': '本应用及 {package} 对象 · 发布后生效', // objectstack#35018 — the open set's origin in the builder's words (the Studio title note). 'engine.studio.access.origin.app': '随应用提供', // objectstack#35018 — the word before the open item's label on the copilot's 「正在看」 line.