From d1bcd4c9183b0c51eb392316eaaf1dafd4591863 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 04:56:17 +0000 Subject: [PATCH 01/12] fix(ui): a view a read-only package ships opens a read-only view panel and offers no Manage views writes Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .../src/hooks/useStudioDesignGate.ts | 43 +++ ...ew.readOnlyPackageViewSaves-35974.test.tsx | 248 ++++++++++++++++++ .../app-shell/src/views/ObjectView.tsx | 1 + .../src/views/ViewConfigPanel.test.tsx | 36 ++- .../app-shell/src/views/ViewConfigPanel.tsx | 62 +++-- .../src/views/objectViewTitleSwitcher.tsx | 20 +- 6 files changed, 387 insertions(+), 23 deletions(-) create mode 100644 ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx diff --git a/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts b/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts index efcbf70cdb9..8617115d787 100644 --- a/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts +++ b/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts @@ -207,3 +207,46 @@ export function useStudioDesignGate(path: string | null | undefined): string | n export function usePackageRefusesSaves(packageId: string | null): boolean { return usePackagePosture(packageId) === 'view'; } + +const NO_REFUSING_PACKAGES: ReadonlySet = new Set(); + +/** + * objectstack#35974 — {@link usePackageRefusesSaves} for a list of packages + * at once, for a surface that draws one row per view (Manage views): the ids + * among `packageIds` the package list carries as read-only. The same + * `writable` verdict, the same session-held read (one request, answered per id + * by `fetchSessionPackages`) and the same fail-open: an id still being read, an + * id whose read failed and an id the list leaves out are not in the answer, so + * that row keeps what it offered before this read. + * + * Keyed on the ids themselves, never on the array's identity: callers may hand + * a fresh array each render. + */ +export function usePackagesRefusingSaves(packageIds: readonly string[]): ReadonlySet { + const session = usePackageListSession(); + const key = JSON.stringify([...new Set(packageIds)].sort()); + const [verdict, setVerdict] = useState<{ + key: string; + session: string; + refusing: ReadonlySet; + } | null>(null); + useEffect(() => { + const ids = JSON.parse(key) as string[]; + if (ids.length === 0) return undefined; + let cancelled = false; + void Promise.allSettled(ids.map((id) => fetchSessionPackages(session, id))).then((answers) => { + if (cancelled) return; + const refusing = new Set(); + answers.forEach((answer, i) => { + if (answer.status === 'fulfilled' && packageStudioPosture(answer.value, ids[i]) === 'view') { + refusing.add(ids[i]); + } + }); + setVerdict({ key, session, refusing }); + }); + return () => { + cancelled = true; + }; + }, [key, session]); + return verdict && verdict.key === key && verdict.session === session ? verdict.refusing : NO_REFUSING_PACKAGES; +} diff --git a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx new file mode 100644 index 00000000000..6bbd9436e01 --- /dev/null +++ b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx @@ -0,0 +1,248 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#35974 — on a list view a read-only package ships, the admin's + * "configure view" panel is read-only (no Save) and Manage views offers no + * pin, no set-as-default and no delete for it: the server refuses each of + * those writes ("save it into the customization package"). A shared view the + * console saved into the customization package and the reader's own view are + * unchanged, and while the package's `writable` verdict is unknown (unread, + * failed read) everything stays offered as before. + * + * The verdict is objectstack#35933's: the package the row was served under + * (`listViews()` carries `_packageId`) and the session-held package list + * (`fetchSessionPackages`), stubbed here. + * + * What runs: the real `ObjectView` on a stub data source. `ListView` is a + * stand-in (the list itself is not under test). The real `ManageViewsDialog` + * renders, held open, so the row affordances are read from the DOM. The view + * panel is a stand-in recording the props it is handed: its own read-only face + * is pinned in `ViewConfigPanel.test.tsx`. + */ + +import * as React from 'react'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +import { render, cleanup, act, waitFor, screen } from '@testing-library/react'; +import { MemoryRouter, Routes, Route } from 'react-router-dom'; +// `ObjectView` reaches a dynamic `import('@objectstack/lint')`: pay its load at +// collection, never inside a case's clocked window (`check:test-source-alias`). +import '@objectstack/lint'; + +vi.mock('@object-ui/permissions', async (importOriginal) => { + const actual = await importOriginal(); + // Stable identities: `ListView` names `perms` in its fetch dependencies. + const perms = { + check: () => ({ allowed: true }), + checkField: () => true, + getFieldPermissions: () => [], + getRowFilter: () => undefined, + getObjectApiOperations: () => undefined, + roles: [], + isLoaded: false, + hasCapabilities: () => true, + can: () => true, + cannot: () => false, + }; + const fieldPerms = { canRead: () => true, canWrite: () => true, permissions: [] }; + return { ...actual, usePermissions: () => perms, useFieldPermissions: () => fieldPerms }; +}); + +vi.mock('@object-ui/auth', async (importOriginal) => ({ + ...(await importOriginal>()), + useAuth: () => ({ user: { id: 'u1', name: 'Ada' }, activeOrganization: { id: 'org1', name: 'Acme' } }), + // Manage views and the view panel are an administrator's. + useWorkspaceAdminStatus: () => ({ isAdmin: true, isResolved: true }), + createAuthenticatedFetch: () => vi.fn(), +})); + +vi.mock('@object-ui/collaboration', async (importOriginal) => ({ + ...(await importOriginal>()), + useRealtimeSubscription: () => ({ lastMessage: null }), + useConflictResolution: () => ({ hasConflicts: false, resolveAllConflicts: () => {} }), +})); + +vi.mock('sonner', () => ({ + toast: Object.assign(vi.fn(), { + success: vi.fn(), error: vi.fn(), info: vi.fn(), + warning: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), + }), +})); + +vi.mock('./MetadataInspector', () => ({ + MetadataPanel: () => null, + useMetadataInspector: () => ({ showDebug: false, toggle: () => {} }), +})); +vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); + +vi.mock('@object-ui/plugin-list', async (importOriginal) => ({ + ...(await importOriginal()), + ListView: () => null, +})); + +// The real dialog, held open: the host opens it from the title switcher. +vi.mock('@object-ui/plugin-view', async (importOriginal) => { + const actual = await importOriginal(); + const Dialog = actual.ManageViewsDialog; + return { + ...actual, + ManageViewsDialog: (props: React.ComponentProps) => ( + {}} /> + ), + }; +}); + +/** The props the view panel was last handed. */ +const panelProps = vi.hoisted(() => ({ current: null as Record | null })); +vi.mock('./ViewConfigPanel', () => ({ + ViewConfigPanel: (props: any) => { + panelProps.current = props; + return null; + }, +})); + +/** The session-held package list, as `GET /api/v1/packages` answers it (parsed). */ +const packageList = vi.hoisted(() => ({ answer: (): Promise => Promise.resolve([]) })); +vi.mock('./studio-design/packages-io', async (importOriginal) => ({ + ...(await importOriginal>()), + fetchSessionPackages: vi.fn(() => packageList.answer()), +})); + +import { ObjectView } from './ObjectView'; +import { ExpressionProvider } from '../providers/ExpressionProvider'; + +const OBJECT = 'showcase_task'; +const SHIPPED_PACKAGE = 'com.example.showcase'; +const CUSTOM_PACKAGE = 'com.example.showcase.custom'; + +/** A view the read-only code package ships, as `listViews()` serves it. */ +const SHIPPED = { + name: `${OBJECT}.in_progress`, object: OBJECT, label: 'In progress', type: 'grid', + columns: ['name', 'amount'], _packageId: SHIPPED_PACKAGE, +}; +/** A shared view the console saved: dotted the same way, in the customization package. */ +const CUSTOM = { + name: `${OBJECT}.team_tasks`, object: OBJECT, label: 'Team tasks', type: 'grid', + columns: ['name', 'amount'], _packageId: CUSTOM_PACKAGE, +}; +/** The reader's own view (`sys_personal_view`). */ +const PERSONAL = { + id: 'pv_mine', user_id: 'u1', object_name: OBJECT, label: 'My tasks', + config: { type: 'grid', columns: ['name', 'amount'], data: { provider: 'object', object: OBJECT } }, +}; + +/** The packages row for each id: the server's `writable` verdict. */ +const PACKAGES = [ + { id: SHIPPED_PACKAGE, name: 'Showcase', writable: false, namespace: 'showcase' }, + { id: CUSTOM_PACKAGE, name: 'Showcase (custom)', writable: true, namespace: 'showcase' }, +]; + +function mount(viewId: string) { + const dataSource = { + find: vi.fn(async (resource: string) => + resource === 'sys_personal_view' ? { data: [PERSONAL], total: 1 } : { data: [], total: 0 }), + findOne: vi.fn(async () => null), + create: vi.fn(async () => ({})), + update: vi.fn(async () => ({})), + delete: vi.fn(async () => ({})), + getObjectSchema: vi.fn(async () => ({ name: OBJECT, fields: {} })), + listViews: vi.fn(async () => [SHIPPED, CUSTOM]), + updateView: vi.fn(async () => ({})), + }; + render( + + + + {}} + /> + } + /> + + + , + ); +} + +const settle = () => act(() => new Promise((resolve) => setTimeout(resolve, 300))); + +/** The write affordances Manage views draws on a row: pin, set default, the ⋯ menu (rename, delete). */ +const rowOffers = (id: string) => ({ + pin: screen.queryByTestId(`manage-views-pin-${id}`) !== null, + setDefault: screen.queryByTestId(`manage-views-default-${id}`) !== null, + menu: screen.queryByTestId(`manage-views-actions-${id}`) !== null, +}); + +const OFFERED = { pin: true, setDefault: true, menu: true }; + +beforeEach(() => { + panelProps.current = null; + packageList.answer = () => Promise.resolve(PACKAGES); + localStorage.clear(); +}); + +afterEach(() => { + cleanup(); +}); + +describe('objectstack#35974 — a read-only package\'s view: read-only panel, no Manage views writes', () => { + it('Manage views offers no pin, set default or delete on the shipped view, and keeps them on the custom one', async () => { + mount(CUSTOM.name); + await settle(); + await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); + await waitFor(() => expect(rowOffers(SHIPPED.name)).toEqual({ pin: false, setDefault: false, menu: false })); + expect(screen.getByTestId(`manage-views-readonly-${SHIPPED.name}`)).toBeTruthy(); + expect(rowOffers(CUSTOM.name)).toEqual(OFFERED); + }); + + it('the panel opens on the shipped view read-only', async () => { + mount(SHIPPED.name); + await settle(); + await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(SHIPPED.name)); + await waitFor(() => expect(panelProps.current?.readOnly).toBe(true)); + }); + + it('the panel on a shared view saved into the customization package is not read-only', async () => { + mount(CUSTOM.name); + await settle(); + await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(CUSTOM.name)); + expect(panelProps.current?.readOnly).toBe(false); + }); + + it('on the reader\'s own view the panel is not read-only and Manage views is unchanged', async () => { + mount(PERSONAL.id); + await settle(); + await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(PERSONAL.id)); + expect(panelProps.current?.readOnly).toBe(false); + // My views are no row of Manage views; the shared rows are judged as ever. + expect(screen.queryByTestId(`manage-views-row-${PERSONAL.id}`)).toBeNull(); + await waitFor(() => expect(rowOffers(SHIPPED.name).pin).toBe(false)); + expect(rowOffers(CUSTOM.name)).toEqual(OFFERED); + }); + + it('while the package list is unread, the shipped view keeps every offer (the server still refuses)', async () => { + packageList.answer = () => new Promise(() => {}); + mount(SHIPPED.name); + await settle(); + await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); + expect(rowOffers(SHIPPED.name)).toEqual(OFFERED); + expect(panelProps.current?.readOnly).toBe(false); + }); + + it('a failed package-list read keeps every offer', async () => { + packageList.answer = () => Promise.reject(new Error('offline')); + mount(SHIPPED.name); + await settle(); + await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); + expect(rowOffers(SHIPPED.name)).toEqual(OFFERED); + expect(panelProps.current?.readOnly).toBe(false); + }); +}); diff --git a/ui/packages/app-shell/src/views/ObjectView.tsx b/ui/packages/app-shell/src/views/ObjectView.tsx index 8a1b8a7d2fc..41f05283cc1 100644 --- a/ui/packages/app-shell/src/views/ObjectView.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.tsx @@ -1414,6 +1414,7 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co metadataClient={metadataClient} dataSource={dataSource} onAfterChange={() => setRefreshKey(k => k + 1)} + readOnly={viewConfigPanelMode === 'edit' && activeViewPackageRefusesSaves} /> diff --git a/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx b/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx index c97ab4385f0..cc50d0a09e0 100644 --- a/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx +++ b/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx @@ -14,10 +14,11 @@ import { render, screen, fireEvent } from '@testing-library/react'; // Swap the heavy spec-driven inspector for a light stub that lets a test drive // `onPatch` — the seam ViewConfigPanel mirrors edits back to the host with. vi.mock('./metadata-admin/inspectors/ViewVariantInspector', () => ({ - ViewVariantInspector: ({ draft, onPatch }: any) => ( + ViewVariantInspector: ({ draft, onPatch, readOnly }: any) => ( - + {readOnly ? ( + + ) : ( + <> + + + + )} ); diff --git a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx index 35b35b5071e..1a137c5a496 100644 --- a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx +++ b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx @@ -44,6 +44,8 @@ import type { useObjectLabel, useObjectTranslation } from '@object-ui/i18n'; import { ChevronDown } from 'lucide-react'; import { viewRowId } from '../utils/viewIdentity.js'; import { useRecentItems } from '../hooks/useRecentItems.js'; +import { usePackagesRefusingSaves } from '../hooks/useStudioDesignGate.js'; +import { studioPackageId } from '../utils/appRoute.js'; import { useListViewFavorites, type ListViewFavorites } from '../layout/listViewFavorites.js'; import type { useMetaItemRefusal } from '../hooks/useMetaItemRefusal.js'; import type { useServedViewItems } from '../hooks/useServedViewItems.js'; @@ -354,9 +356,25 @@ export function useObjectViewTitleSwitcher({ } as ViewTabItem; }); + // objectstack#35974 — Manage views offers no pin, default, delete or + // rename on a saved view a read-only package ships: the server refuses + // each (it goes to the customization package). Its row is read-only there, + // by the package the row was served under and the session-held `writable` + // verdict objectstack#35933 reads. Unknown (unread, failed, unlisted) + // keeps the row as it was. Manage views only: the switcher's sections + // above still read `authored` from `isSystem`. + const refusingPackages = usePackagesRefusingSaves(isAdmin + ? savedViews.map((sv: any) => studioPackageId(sv)).filter((id: string | null): id is string => id !== null) + : []); // The reader's own views are switched to here but are no view the admin's // Manage views lists: they are each reader's data, not the object's views. - const viewTabItems = viewItems.filter((item) => !personalViewIds.has(item.id)); + const viewTabItems = viewItems + .filter((item) => !personalViewIds.has(item.id)) + .map((item) => { + if (item.readonly) return item; + const packageId = studioPackageId(savedViews.find((sv: any) => viewRowId(sv) === item.id)); + return packageId !== null && refusingPackages.has(packageId) ? { ...item, readonly: true } : item; + }); const switcherViews: TitleSwitcherView[] = viewItems.map((item) => { const personal = personalViewIds.has(item.id); return { From 5bf14ea755d4c690ac293ecf9ab382ae4ba71d20 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 04:59:19 +0000 Subject: [PATCH 02/12] chore: changeset for the read-only package view panel Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .changeset/35974-read-only-package-view-panel.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .changeset/35974-read-only-package-view-panel.md diff --git a/.changeset/35974-read-only-package-view-panel.md b/.changeset/35974-read-only-package-view-panel.md new file mode 100644 index 00000000000..83d9857f66d --- /dev/null +++ b/.changeset/35974-read-only-package-view-panel.md @@ -0,0 +1,12 @@ +--- +'@object-ui/app-shell': patch +--- + +fix(ui): a view a read-only package ships opens a read-only view panel and offers no Manage views writes + +Clause-②: no +Metadata-protocol: none + +On a list view that ships inside a read-only package (a code or installed package), the admin's view panel ("configure view") now opens read-only: it shows the view's configuration with every control disabled, relays no edit to the list, and offers no Save and no draft publish or discard, only Close. In Manage views such a view's row is read-only too: no pin, no set as default, no rename and no delete, each of which the server refused ("save it into the customization package"). A shared view the console saved into the customization package and the reader's own view are unchanged; the toolbar's personal list changes keep saving to the reader's preferences. + +The verdict is the one the footer calculation menu and Rename already read: the package the view row was served under and the server's `writable` verdict for it, from the package list the console holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. From ffdc17656343d0fab040741f615a93e6befbedce Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 05:22:11 +0000 Subject: [PATCH 03/12] test(ui): pay the view panel's dynamic imports at collection Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx b/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx index cc50d0a09e0..4a94c42061d 100644 --- a/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx +++ b/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx @@ -2,6 +2,11 @@ import { describe, it, expect, vi } from 'vitest'; import { render, screen, fireEvent } from '@testing-library/react'; +// The panel's source reaches dynamic `import('@objectstack/formula')` and +// `import('@objectstack/lint')`: pay their load at collection, never inside a +// case's clocked window (`check:test-source-alias`). +import '@objectstack/formula'; +import '@objectstack/lint'; /** * ViewConfigPanel discard/close behavior (objectui#2320). From a523cdb1652fbb4ec884dea260fbb7fda8610b9e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 05:35:14 +0000 Subject: [PATCH 04/12] fix(ui): a read-only-package view's Manage views row keeps View config, which opens the panel read-only Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- ...ew.readOnlyPackageViewSaves-35974.test.tsx | 45 +++++++++++++++-- .../src/views/objectViewTitleSwitcher.tsx | 10 ++-- ui/packages/i18n/src/locales/ar.ts | 1 + ui/packages/i18n/src/locales/de.ts | 1 + ui/packages/i18n/src/locales/en.ts | 1 + ui/packages/i18n/src/locales/es.ts | 1 + ui/packages/i18n/src/locales/fr.ts | 1 + ui/packages/i18n/src/locales/ja.ts | 1 + ui/packages/i18n/src/locales/ko.ts | 1 + ui/packages/i18n/src/locales/pt-BR.ts | 1 + ui/packages/i18n/src/locales/ru.ts | 1 + ui/packages/i18n/src/locales/zh-Hans.ts | 1 + ui/packages/i18n/src/locales/zh-Hant.ts | 1 + .../plugin-view/src/ManageViewsDialog.tsx | 11 ++++- ui/packages/plugin-view/src/ViewTabBar.tsx | 11 +++++ .../readonlyViewMenus-10209.test.tsx | 49 ++++++++++++++++++- 16 files changed, 125 insertions(+), 12 deletions(-) diff --git a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx index 6bbd9436e01..05ff9732070 100644 --- a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx @@ -15,14 +15,15 @@ * * What runs: the real `ObjectView` on a stub data source. `ListView` is a * stand-in (the list itself is not under test). The real `ManageViewsDialog` - * renders, held open, so the row affordances are read from the DOM. The view - * panel is a stand-in recording the props it is handed: its own read-only face - * is pinned in `ViewConfigPanel.test.tsx`. + * renders, held open, so the row affordances are read from the DOM, and its + * "View config" entry is clicked through to the panel. The view panel is a + * stand-in recording the props it is handed: its own read-only face is pinned + * in `ViewConfigPanel.test.tsx`. */ import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; -import { render, cleanup, act, waitFor, screen } from '@testing-library/react'; +import { render, cleanup, act, waitFor, screen, fireEvent } from '@testing-library/react'; import { MemoryRouter, Routes, Route } from 'react-router-dom'; // `ObjectView` reaches a dynamic `import('@objectstack/lint')`: pay its load at // collection, never inside a case's clocked window (`check:test-source-alias`). @@ -198,11 +199,45 @@ describe('objectstack#35974 — a read-only package\'s view: read-only panel, no mount(CUSTOM.name); await settle(); await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); - await waitFor(() => expect(rowOffers(SHIPPED.name)).toEqual({ pin: false, setDefault: false, menu: false })); + // The ⋯ menu stays, holding only "View config" (next case). + await waitFor(() => expect(rowOffers(SHIPPED.name)).toEqual({ pin: false, setDefault: false, menu: true })); expect(screen.getByTestId(`manage-views-readonly-${SHIPPED.name}`)).toBeTruthy(); expect(rowOffers(CUSTOM.name)).toEqual(OFFERED); }); + it('the shipped row\'s "View config" entry opens the panel on that view, read-only', async () => { + mount(CUSTOM.name); + await settle(); + const trigger = await waitFor(() => screen.getByTestId(`manage-views-actions-${SHIPPED.name}`)); + fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); + fireEvent.click(trigger); + const entry = await waitFor(() => screen.getByTestId(`manage-views-action-config-${SHIPPED.name}`)); + expect(entry.textContent).toContain('View config'); + // Nothing else of the row's menu: no rename, set default, pin or delete. + for (const key of ['rename', 'default', 'pin', 'delete']) { + expect(screen.queryByTestId(`manage-views-action-${key}-${SHIPPED.name}`)).toBeNull(); + } + fireEvent.click(entry); + await waitFor(() => expect(panelProps.current?.open).toBe(true)); + await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(SHIPPED.name)); + await waitFor(() => expect(panelProps.current?.readOnly).toBe(true)); + expect(panelProps.current?.mode).toBe('edit'); + }); + + it('the custom row\'s entry still reads "Edit view config" and opens the panel savable', async () => { + mount(SHIPPED.name); + await settle(); + const trigger = await waitFor(() => screen.getByTestId(`manage-views-actions-${CUSTOM.name}`)); + fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); + fireEvent.click(trigger); + const entry = await waitFor(() => screen.getByTestId(`manage-views-action-config-${CUSTOM.name}`)); + expect(entry.textContent).toContain('Edit view config'); + fireEvent.click(entry); + await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(CUSTOM.name)); + await waitFor(() => expect(panelProps.current?.open).toBe(true)); + expect(panelProps.current?.readOnly).toBe(false); + }); + it('the panel opens on the shipped view read-only', async () => { mount(SHIPPED.name); await settle(); diff --git a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx index 1a137c5a496..2a6a72358bf 100644 --- a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx +++ b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx @@ -360,9 +360,11 @@ export function useObjectViewTitleSwitcher({ // rename on a saved view a read-only package ships: the server refuses // each (it goes to the customization package). Its row is read-only there, // by the package the row was served under and the session-held `writable` - // verdict objectstack#35933 reads. Unknown (unread, failed, unlisted) - // keeps the row as it was. Manage views only: the switcher's sections - // above still read `authored` from `isSystem`. + // verdict objectstack#35933 reads, and its configuration stays offered to + // look at (`readonlyConfigViewable`): the view panel opens read-only. + // Unknown (unread, failed, unlisted) keeps the row as it was. Manage views + // only: the switcher's sections above still read `authored` from + // `isSystem`. const refusingPackages = usePackagesRefusingSaves(isAdmin ? savedViews.map((sv: any) => studioPackageId(sv)).filter((id: string | null): id is string => id !== null) : []); @@ -373,7 +375,7 @@ export function useObjectViewTitleSwitcher({ .map((item) => { if (item.readonly) return item; const packageId = studioPackageId(savedViews.find((sv: any) => viewRowId(sv) === item.id)); - return packageId !== null && refusingPackages.has(packageId) ? { ...item, readonly: true } : item; + return packageId !== null && refusingPackages.has(packageId) ? { ...item, readonly: true, readonlyConfigViewable: true } : item; }); const switcherViews: TitleSwitcherView[] = viewItems.map((item) => { const personal = personalViewIds.has(item.id); diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts index e31875a702f..dfc01bf01b4 100644 --- a/ui/packages/i18n/src/locales/ar.ts +++ b/ui/packages/i18n/src/locales/ar.ts @@ -1341,6 +1341,7 @@ const ar = { }, view: { editViewConfig: "تعديل إعدادات العرض", + showViewConfig: "عرض إعدادات العرض", rename: "إعادة تسمية", duplicateView: "تكرار العرض", shareView: "مشاركة العرض", diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts index c0f85221500..4680e06c550 100644 --- a/ui/packages/i18n/src/locales/de.ts +++ b/ui/packages/i18n/src/locales/de.ts @@ -1208,6 +1208,7 @@ const de = { }, view: { editViewConfig: "Ansichtskonfiguration bearbeiten", + showViewConfig: "Ansichtskonfiguration anzeigen", rename: "Umbenennen", duplicateView: "Ansicht duplizieren", shareView: "Ansicht teilen", diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts index 132d6abf078..1fbfc9fb5fa 100644 --- a/ui/packages/i18n/src/locales/en.ts +++ b/ui/packages/i18n/src/locales/en.ts @@ -1504,6 +1504,7 @@ const en = { }, view: { editViewConfig: 'Edit view config', + showViewConfig: 'View config', rename: 'Rename', duplicateView: 'Duplicate View', shareView: 'Share View', diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts index d152f2fcc11..1b78dd44deb 100644 --- a/ui/packages/i18n/src/locales/es.ts +++ b/ui/packages/i18n/src/locales/es.ts @@ -1244,6 +1244,7 @@ const es = { }, view: { editViewConfig: "Editar configuración de vista", + showViewConfig: "Ver configuración de vista", rename: "Renombrar", duplicateView: "Duplicar vista", shareView: "Compartir vista", diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts index 28a718ddb35..e0f2377979e 100644 --- a/ui/packages/i18n/src/locales/fr.ts +++ b/ui/packages/i18n/src/locales/fr.ts @@ -1239,6 +1239,7 @@ const fr = { }, view: { editViewConfig: "Modifier la configuration de la vue", + showViewConfig: "Voir la configuration de la vue", rename: "Renommer", duplicateView: "Dupliquer la vue", shareView: "Partager la vue", diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts index 9aa74658ec5..8135850c66b 100644 --- a/ui/packages/i18n/src/locales/ja.ts +++ b/ui/packages/i18n/src/locales/ja.ts @@ -1208,6 +1208,7 @@ const ja = { }, view: { editViewConfig: "ビュー設定を編集", + showViewConfig: "ビュー設定を表示", rename: "名前を変更", duplicateView: "ビューを複製", shareView: "ビューを共有", diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts index ae58760627f..cdc39e49482 100644 --- a/ui/packages/i18n/src/locales/ko.ts +++ b/ui/packages/i18n/src/locales/ko.ts @@ -1208,6 +1208,7 @@ const ko = { }, view: { editViewConfig: "보기 구성 편집", + showViewConfig: "보기 구성 보기", rename: "이름 변경", duplicateView: "뷰 복제", shareView: "뷰 공유", diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts index 50f61be8876..531667be5e0 100644 --- a/ui/packages/i18n/src/locales/pt-BR.ts +++ b/ui/packages/i18n/src/locales/pt-BR.ts @@ -1239,6 +1239,7 @@ const pt = { }, view: { editViewConfig: "Editar configuração da vista", + showViewConfig: "Ver configuração da vista", rename: "Renomear", duplicateView: "Duplicar visualização", shareView: "Compartilhar visualização", diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts index f50c1a4af9c..b2b6b1bd10f 100644 --- a/ui/packages/i18n/src/locales/ru.ts +++ b/ui/packages/i18n/src/locales/ru.ts @@ -1276,6 +1276,7 @@ const ru = { }, view: { editViewConfig: "Изменить настройки представления", + showViewConfig: "Просмотреть настройки представления", rename: "Переименовать", duplicateView: "Дублировать представление", shareView: "Поделиться представлением", diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index 7d287f4bf58..1a2555c9f49 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -1235,6 +1235,7 @@ const zh = { }, view: { editViewConfig: '编辑视图配置', + showViewConfig: '查看视图配置', rename: '重命名', duplicateView: '复制视图', shareView: '共享视图', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index 1e071ce7243..0fdef190b63 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -1235,6 +1235,7 @@ const zhHant = { }, view: { editViewConfig: '編輯檢視配置', + showViewConfig: '查看檢視配置', rename: '重新命名', duplicateView: '複製檢視', shareView: '共享檢視', diff --git a/ui/packages/plugin-view/src/ManageViewsDialog.tsx b/ui/packages/plugin-view/src/ManageViewsDialog.tsx index 91f68f617d4..a215acd2fe6 100644 --- a/ui/packages/plugin-view/src/ManageViewsDialog.tsx +++ b/ui/packages/plugin-view/src/ManageViewsDialog.tsx @@ -58,6 +58,7 @@ import { Check, X, Lock, + Eye, } from 'lucide-react'; import { cn } from '@object-ui/components'; import { useObjectTranslation } from '@object-ui/react'; @@ -170,6 +171,10 @@ const SortableRow: React.FC = ({ // default, pin, edit configuration, delete). Duplicate is preserved // because it produces a fresh override that *is* mutable. const isReadonly = !!view.readonly; + // A read-only row whose configuration may still be looked at + // (`ViewTabItem.readonlyConfigViewable`): its configuration entry stays, + // labelled as viewing; nothing else read-only rows hide comes back. + const viewsConfigOnly = isReadonly && !!view.readonlyConfigViewable; /** * The overflow menu's entries, each resolved ONCE to the handler it will @@ -184,7 +189,7 @@ const SortableRow: React.FC = ({ */ const renameAction = isReadonly ? undefined : onStartRename; const duplicateAction = onDuplicate; - const configAction = isReadonly ? undefined : onConfigView; + const configAction = isReadonly && !viewsConfigOnly ? undefined : onConfigView; const setDefaultAction = isReadonly || view.isDefault ? undefined : onSetDefault; const pinAction = isReadonly ? undefined : onSetPinned; const deleteAction = isReadonly ? undefined : onDelete; @@ -380,7 +385,9 @@ const SortableRow: React.FC = ({ data-testid={`manage-views-action-config-${view.id}`} onClick={() => configAction(view.id)} > - {vt('view.editViewConfig', 'Edit view config')} + {viewsConfigOnly + ? <> {vt('view.showViewConfig', 'View config')} + : <> {vt('view.editViewConfig', 'Edit view config')}} )} {setDefaultAction && ( diff --git a/ui/packages/plugin-view/src/ViewTabBar.tsx b/ui/packages/plugin-view/src/ViewTabBar.tsx index 0cc577ff5e6..18a25244f12 100644 --- a/ui/packages/plugin-view/src/ViewTabBar.tsx +++ b/ui/packages/plugin-view/src/ViewTabBar.tsx @@ -196,6 +196,17 @@ export interface ViewTabItem { readonly?: boolean; /** Optional tooltip shown alongside the lock icon when `readonly` is true. */ readonlyReason?: string; + /** + * On a `readonly` row only: the view's configuration may still be LOOKED + * AT. `ManageViewsDialog` then keeps the row's configuration entry, labelled + * as viewing ("View config", not "Edit view config"), and the host's + * `onConfigView` opens it with nothing to save; every other mutation stays + * hidden. Use it for a view the user may read but the server refuses to + * save (e.g. a view a read-only package ships). Ignored when `readonly` is + * not set, and absent ⇒ a read-only row offers no configuration entry, as + * before. `ViewTabBar` does not read it. + */ + readonlyConfigViewable?: boolean; /** * The view's description, already resolved to the viewer's language and * already gated by the host on the view's `appearance.showDescription` diff --git a/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx b/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx index a0395f818e0..95ef922e1bd 100644 --- a/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx +++ b/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx @@ -25,7 +25,7 @@ import React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; -import { render, screen, cleanup, fireEvent, within } from '@testing-library/react'; +import { render, screen, cleanup, fireEvent, within, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ViewTabBar } from '../ViewTabBar'; import type { ViewTabItem } from '../ViewTabBar'; @@ -110,6 +110,53 @@ describe('ManageViewsDialog row menu (#10209)', () => { }); }); +describe('ManageViewsDialog `readonlyConfigViewable` (objectstack#35974)', () => { + /** A saved view the server refuses to save: read-only, its configuration still readable. */ + const VIEWABLE: ViewTabItem = { + id: 'crm_lead.shipped', label: 'Shipped', type: 'grid', readonly: true, readonlyConfigViewable: true, + }; + + it('a read-only row with the flag offers only the configuration entry, labelled as viewing', () => { + const onConfigView = vi.fn(); + renderDialog([VIEWABLE], { onConfigView }); + // No pin, no set default on the row itself. + expect(screen.queryByTestId(`manage-views-pin-${VIEWABLE.id}`)).toBeNull(); + expect(screen.queryByTestId(`manage-views-default-${VIEWABLE.id}`)).toBeNull(); + expect(screen.getByTestId(`manage-views-readonly-${VIEWABLE.id}`)).toBeInTheDocument(); + open(screen.getByTestId(`manage-views-actions-${VIEWABLE.id}`)); + expect(menuShape()).toEqual(['menuitem']); + const entry = screen.getByTestId(`manage-views-action-config-${VIEWABLE.id}`); + expect(entry).toHaveTextContent('View config'); + expect(entry).not.toHaveTextContent('Edit'); + for (const key of ['rename', 'default', 'pin', 'delete']) { + expect(screen.queryByTestId(`manage-views-action-${key}-${VIEWABLE.id}`)).toBeNull(); + } + }); + + it('the entry hands the view to the host\'s `onConfigView`', async () => { + const onConfigView = vi.fn(); + renderDialog([VIEWABLE], { onConfigView }); + open(screen.getByTestId(`manage-views-actions-${VIEWABLE.id}`)); + fireEvent.click(screen.getByTestId(`manage-views-action-config-${VIEWABLE.id}`)); + await waitFor(() => expect(onConfigView).toHaveBeenCalledWith(VIEWABLE.id)); + }); + + it('without the flag a read-only row is as before: no `…` trigger, no configuration entry', () => { + renderDialog([{ ...VIEWABLE, readonlyConfigViewable: undefined }]); + expect(screen.queryByTestId(`manage-views-actions-${VIEWABLE.id}`)).toBeNull(); + expect(screen.queryByTestId(`manage-views-action-config-${VIEWABLE.id}`)).toBeNull(); + }); + + it('on a mutable row the flag changes nothing: every entry, "Edit view config"', () => { + renderDialog([{ ...EDITABLE, readonlyConfigViewable: true }], { onDuplicate: vi.fn() }); + open(screen.getByTestId(`manage-views-actions-${EDITABLE.id}`)); + expect(menuShape()).toEqual([ + 'menuitem', 'menuitem', 'menuitem', 'menuitem', 'menuitem', 'separator', 'menuitem', + ]); + expect(screen.getByTestId(`manage-views-action-config-${EDITABLE.id}`)).toHaveTextContent('Edit view config'); + }); +}); + // --- ViewTabBar -------------------------------------------------------------- /** The console's admin prop set. */ From b381718dce2cc7fff4637b129b1a64f71383016f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 05:37:47 +0000 Subject: [PATCH 05/12] chore: changeset names the plugin-view widening and the new locale key Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .changeset/35974-read-only-package-view-panel.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.changeset/35974-read-only-package-view-panel.md b/.changeset/35974-read-only-package-view-panel.md index 83d9857f66d..35cfd2b649f 100644 --- a/.changeset/35974-read-only-package-view-panel.md +++ b/.changeset/35974-read-only-package-view-panel.md @@ -1,12 +1,16 @@ --- '@object-ui/app-shell': patch +'@object-ui/plugin-view': patch +'@object-ui/i18n': patch --- fix(ui): a view a read-only package ships opens a read-only view panel and offers no Manage views writes -Clause-②: no +Clause-②: yes (widening) Metadata-protocol: none -On a list view that ships inside a read-only package (a code or installed package), the admin's view panel ("configure view") now opens read-only: it shows the view's configuration with every control disabled, relays no edit to the list, and offers no Save and no draft publish or discard, only Close. In Manage views such a view's row is read-only too: no pin, no set as default, no rename and no delete, each of which the server refused ("save it into the customization package"). A shared view the console saved into the customization package and the reader's own view are unchanged; the toolbar's personal list changes keep saving to the reader's preferences. +On a list view that ships inside a read-only package (a code or installed package), the admin's view panel now opens read-only. It shows the view's configuration with every control disabled and relays no edit to the list. It offers no Save and no way to publish or discard a draft, only Close. In Manage views the same view's row is read-only: no pin, no set as default, no rename and no delete, each of which the server refused ("save it into the customization package"). Its menu keeps one entry, "View config", which opens that read-only panel. A shared view the console saved into the customization package and the reader's own view are unchanged. The toolbar's personal list changes keep saving to the reader's preferences. -The verdict is the one the footer calculation menu and Rename already read: the package the view row was served under and the server's `writable` verdict for it, from the package list the console holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. +`@object-ui/plugin-view`: `ViewTabItem` gains an optional `readonlyConfigViewable` field. It is read on a `readonly` row only: `ManageViewsDialog` then keeps the row's configuration entry, labelled "View config" (`view.showViewConfig`, a new key in every locale of `@object-ui/i18n`), and leaves every other mutation hidden. Without the field a read-only row offers no configuration entry, as before, and a mutable row ignores it. `ViewTabBar` does not read it. + +The read-only verdict is the one the footer calculation menu and Rename already use. The console takes the package the view row was served under and reads the server's `writable` verdict for it from the package list it holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. From 8ab622b885d41dc6b5ac869e122124887169f125 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 05:54:12 +0000 Subject: [PATCH 06/12] fix(i18n): generate the zh-Hant View config label from its zh-Hans source Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- ui/packages/i18n/src/locales/zh-Hans.ts | 2 +- ui/packages/i18n/src/locales/zh-Hant.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index 1a2555c9f49..b33a2612b26 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -1235,7 +1235,7 @@ const zh = { }, view: { editViewConfig: '编辑视图配置', - showViewConfig: '查看视图配置', + showViewConfig: '查阅视图配置', rename: '重命名', duplicateView: '复制视图', shareView: '共享视图', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index 0fdef190b63..c5744fb4f59 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -1235,7 +1235,7 @@ const zhHant = { }, view: { editViewConfig: '編輯檢視配置', - showViewConfig: '查看檢視配置', + showViewConfig: '查閱檢視配置', rename: '重新命名', duplicateView: '複製檢視', shareView: '共享檢視', From ec9e7de6d492d45b064382cc4ece9672439ec031 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 08:43:22 +0000 Subject: [PATCH 07/12] fix(ui): a read-only package's view hides only Delete in Manage views; definitionReadonly replaces readonlyConfigViewable Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .../src/views/objectViewTitleSwitcher.tsx | 20 +++++++++--------- .../plugin-view/src/ManageViewsDialog.tsx | 14 ++++++------- ui/packages/plugin-view/src/ViewTabBar.tsx | 21 +++++++++++-------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx index 2a6a72358bf..a5b01d9d201 100644 --- a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx +++ b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx @@ -356,15 +356,15 @@ export function useObjectViewTitleSwitcher({ } as ViewTabItem; }); - // objectstack#35974 — Manage views offers no pin, default, delete or - // rename on a saved view a read-only package ships: the server refuses - // each (it goes to the customization package). Its row is read-only there, - // by the package the row was served under and the session-held `writable` - // verdict objectstack#35933 reads, and its configuration stays offered to - // look at (`readonlyConfigViewable`): the view panel opens read-only. - // Unknown (unread, failed, unlisted) keeps the row as it was. Manage views - // only: the switcher's sections above still read `authored` from - // `isSystem`. + // objectstack#35974 — a saved view a read-only package ships: its + // definition is read-only in Manage views (`definitionReadonly`). The + // server refuses its delete and its panel save, so Delete is not offered + // and the panel opens read-only ("View config"); rename, pin and set as + // default stay, since `updateView` writes those into the package's + // customization pair. Judged by the package the row was served under and + // the session-held `writable` verdict objectstack#35933 reads. Unknown + // (unread, failed, unlisted) keeps the row as it was. Manage views only: + // the switcher's sections above still read `authored` from `isSystem`. const refusingPackages = usePackagesRefusingSaves(isAdmin ? savedViews.map((sv: any) => studioPackageId(sv)).filter((id: string | null): id is string => id !== null) : []); @@ -375,7 +375,7 @@ export function useObjectViewTitleSwitcher({ .map((item) => { if (item.readonly) return item; const packageId = studioPackageId(savedViews.find((sv: any) => viewRowId(sv) === item.id)); - return packageId !== null && refusingPackages.has(packageId) ? { ...item, readonly: true, readonlyConfigViewable: true } : item; + return packageId !== null && refusingPackages.has(packageId) ? { ...item, definitionReadonly: true } : item; }); const switcherViews: TitleSwitcherView[] = viewItems.map((item) => { const personal = personalViewIds.has(item.id); diff --git a/ui/packages/plugin-view/src/ManageViewsDialog.tsx b/ui/packages/plugin-view/src/ManageViewsDialog.tsx index a215acd2fe6..840a3220513 100644 --- a/ui/packages/plugin-view/src/ManageViewsDialog.tsx +++ b/ui/packages/plugin-view/src/ManageViewsDialog.tsx @@ -171,10 +171,10 @@ const SortableRow: React.FC = ({ // default, pin, edit configuration, delete). Duplicate is preserved // because it produces a fresh override that *is* mutable. const isReadonly = !!view.readonly; - // A read-only row whose configuration may still be looked at - // (`ViewTabItem.readonlyConfigViewable`): its configuration entry stays, - // labelled as viewing; nothing else read-only rows hide comes back. - const viewsConfigOnly = isReadonly && !!view.readonlyConfigViewable; + // A row whose definition is read-only but whose row state is not + // (`ViewTabItem.definitionReadonly`): no Delete, and its configuration is + // offered to look at. `readonly` wins. + const definitionReadonly = !isReadonly && !!view.definitionReadonly; /** * The overflow menu's entries, each resolved ONCE to the handler it will @@ -189,10 +189,10 @@ const SortableRow: React.FC = ({ */ const renameAction = isReadonly ? undefined : onStartRename; const duplicateAction = onDuplicate; - const configAction = isReadonly && !viewsConfigOnly ? undefined : onConfigView; + const configAction = isReadonly ? undefined : onConfigView; const setDefaultAction = isReadonly || view.isDefault ? undefined : onSetDefault; const pinAction = isReadonly ? undefined : onSetPinned; - const deleteAction = isReadonly ? undefined : onDelete; + const deleteAction = isReadonly || definitionReadonly ? undefined : onDelete; const hasEntryAboveDelete = !!(renameAction || duplicateAction || configAction || setDefaultAction || pinAction); const hasMenuEntry = hasEntryAboveDelete || !!deleteAction; @@ -385,7 +385,7 @@ const SortableRow: React.FC = ({ data-testid={`manage-views-action-config-${view.id}`} onClick={() => configAction(view.id)} > - {viewsConfigOnly + {definitionReadonly ? <> {vt('view.showViewConfig', 'View config')} : <> {vt('view.editViewConfig', 'Edit view config')}} diff --git a/ui/packages/plugin-view/src/ViewTabBar.tsx b/ui/packages/plugin-view/src/ViewTabBar.tsx index 18a25244f12..4c7537fbfc1 100644 --- a/ui/packages/plugin-view/src/ViewTabBar.tsx +++ b/ui/packages/plugin-view/src/ViewTabBar.tsx @@ -197,16 +197,19 @@ export interface ViewTabItem { /** Optional tooltip shown alongside the lock icon when `readonly` is true. */ readonlyReason?: string; /** - * On a `readonly` row only: the view's configuration may still be LOOKED - * AT. `ManageViewsDialog` then keeps the row's configuration entry, labelled - * as viewing ("View config", not "Edit view config"), and the host's - * `onConfigView` opens it with nothing to save; every other mutation stays - * hidden. Use it for a view the user may read but the server refuses to - * save (e.g. a view a read-only package ships). Ignored when `readonly` is - * not set, and absent ⇒ a read-only row offers no configuration entry, as - * before. `ViewTabBar` does not read it. + * The view's DEFINITION is read-only while its row state is not: e.g. a + * view a read-only package ships, whose label, pin and default the host + * still writes (into that package's customization), but whose definition + * cannot be saved and which cannot be deleted. + * + * When `true`, `ManageViewsDialog` hides Delete and labels the + * configuration entry as viewing ("View config", not "Edit view config"): + * the host's `onConfigView` opens the configuration with nothing to save. + * Rename, pin and set as default stay offered, and no lock icon is drawn + * (the row is not read-only). `readonly` wins when both are set. Absent ⇒ + * the row behaves as before. `ViewTabBar` does not read it. */ - readonlyConfigViewable?: boolean; + definitionReadonly?: boolean; /** * The view's description, already resolved to the viewer's language and * already gated by the host on the view's `appearance.showDescription` From 3f5c9478da4e3e3777222fd05a4a92abde221b63 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 08:52:15 +0000 Subject: [PATCH 08/12] fix(app-shell): a read-only package's view keeps Rename in the options menu; tests follow ruling B Rename lands in the package's customization pair through updateView (ensure-customization, then PUT ...?package=BASE.custom -> 200, read back after reload), so the options-menu Rename hidden for such a view is offered again. The calculation-menu gate is unchanged. Tests: the factory row offers rename, pin and set default, not Delete; View config opens the panel read-only; custom rows and the unread or failed package list keep every action. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- ...ectView.readOnlyPackageView-35933.test.tsx | 11 ++- ...ew.readOnlyPackageViewSaves-35974.test.tsx | 99 +++++++++++-------- .../app-shell/src/views/ObjectView.tsx | 4 +- .../readonlyViewMenus-10209.test.tsx | 69 +++++++------ 4 files changed, 101 insertions(+), 82 deletions(-) diff --git a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageView-35933.test.tsx b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageView-35933.test.tsx index caa7c0ac37b..973b4904547 100644 --- a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageView-35933.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageView-35933.test.tsx @@ -2,8 +2,9 @@ /** * objectstack#35933 — a view a read-only package ships offers an admin no save - * of its own: no footer calculation menu (objectstack#35702) and no Rename in - * the list's options menu. A shared view the console saved into the + * of its own: no footer calculation menu (objectstack#35702). Its Rename in + * the list's options menu stays (objectstack#35974): the label is written into + * the package's customization pair. A shared view the console saved into the * customization package, and the reader's own view, still offer the menu. * * A dotted view name cannot tell the two apart: every stored view is named @@ -176,12 +177,14 @@ afterEach(() => { }); describe('objectstack#35933 — a read-only package\'s view offers no save of its own', () => { - it('a view a read-only package ships: no calculation menu, no Rename', async () => { + it('a view a read-only package ships: no calculation menu; Rename stays (objectstack#35974)', async () => { mount(SHIPPED.name); await settle(); await waitFor(() => expect(listProps.current).not.toBeNull()); expect(offersMenu()).toBe(false); - expect(listProps.current?.onRenameView).toBeUndefined(); + // objectstack#35974 — the rename lands in the package's customization + // pair (`updateView`), so it is offered. + expect(typeof listProps.current?.onRenameView).toBe('function'); }); it('a shared view saved into the customization package keeps the menu and Rename', async () => { diff --git a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx index 05ff9732070..df11b8808df 100644 --- a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. /** - * objectstack#35974 — on a list view a read-only package ships, the admin's - * "configure view" panel is read-only (no Save) and Manage views offers no - * pin, no set-as-default and no delete for it: the server refuses each of - * those writes ("save it into the customization package"). A shared view the - * console saved into the customization package and the reader's own view are - * unchanged, and while the package's `writable` verdict is unknown (unread, - * failed read) everything stays offered as before. + * objectstack#35974 (ruling record 7058654416) — on a list view a read-only + * package ships, Manage views hides only Delete and offers its configuration + * as "View config", which opens the panel read-only (no Save): the server + * refuses that view's delete and its panel save. Rename, pin and set as + * default stay: `updateView` writes them into the package's customization + * pair. A shared view the console saved into the customization package and + * the reader's own view are unchanged, and while the package's `writable` + * verdict is unknown (unread, failed read) everything stays offered as before. * * The verdict is objectstack#35933's: the package the row was served under * (`listViews()` carries `_packageId`) and the session-held package list @@ -175,14 +176,43 @@ function mount(viewId: string) { const settle = () => act(() => new Promise((resolve) => setTimeout(resolve, 300))); -/** The write affordances Manage views draws on a row: pin, set default, the ⋯ menu (rename, delete). */ -const rowOffers = (id: string) => ({ - pin: screen.queryByTestId(`manage-views-pin-${id}`) !== null, - setDefault: screen.queryByTestId(`manage-views-default-${id}`) !== null, - menu: screen.queryByTestId(`manage-views-actions-${id}`) !== null, -}); +/** The row's own affordances (pin, set default star, lock) and its `…` menu's entries, read by opening it. */ +async function rowOffers(id: string) { + const row = { + pin: screen.queryByTestId(`manage-views-pin-${id}`) !== null, + setDefault: screen.queryByTestId(`manage-views-default-${id}`) !== null, + lock: screen.queryByTestId(`manage-views-readonly-${id}`) !== null, + }; + const trigger = screen.getByTestId(`manage-views-actions-${id}`); + fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); + fireEvent.click(trigger); + await waitFor(() => expect(screen.getByRole('menu')).toBeTruthy()); + const entries = ['rename', 'config', 'default', 'pin', 'delete'] + .filter((key) => screen.queryByTestId(`manage-views-action-${key}-${id}`) !== null); + const configLabel = screen.queryByTestId(`manage-views-action-config-${id}`)?.textContent?.trim() ?? null; + fireEvent.keyDown(screen.getByRole('menu'), { key: 'Escape' }); + await waitFor(() => expect(screen.queryByRole('menu')).toBeNull()); + return { ...row, entries, configLabel }; +} -const OFFERED = { pin: true, setDefault: true, menu: true }; +/** A row as every savable view is offered: everything, Delete included, "Edit view config". */ +const OFFERED = { + pin: true, setDefault: true, lock: false, + entries: ['rename', 'config', 'default', 'pin', 'delete'], configLabel: 'Edit view config', +}; +/** A factory row of a read-only package: everything but Delete, "View config", no lock. */ +const FACTORY_OFFERS = { + pin: true, setDefault: true, lock: false, + entries: ['rename', 'config', 'default', 'pin'], configLabel: 'View config', +}; + +/** Open a row's `…` and click its configuration entry. */ +async function clickConfig(id: string) { + const trigger = await waitFor(() => screen.getByTestId(`manage-views-actions-${id}`)); + fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); + fireEvent.click(trigger); + fireEvent.click(await waitFor(() => screen.getByTestId(`manage-views-action-config-${id}`))); +} beforeEach(() => { panelProps.current = null; @@ -194,45 +224,30 @@ afterEach(() => { cleanup(); }); -describe('objectstack#35974 — a read-only package\'s view: read-only panel, no Manage views writes', () => { - it('Manage views offers no pin, set default or delete on the shipped view, and keeps them on the custom one', async () => { +describe('objectstack#35974 — a read-only package\'s view: no Delete, a read-only panel', () => { + it('Manage views: the shipped row offers everything but Delete and "View config"; the custom row is unchanged', async () => { mount(CUSTOM.name); await settle(); await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); - // The ⋯ menu stays, holding only "View config" (next case). - await waitFor(() => expect(rowOffers(SHIPPED.name)).toEqual({ pin: false, setDefault: false, menu: true })); - expect(screen.getByTestId(`manage-views-readonly-${SHIPPED.name}`)).toBeTruthy(); - expect(rowOffers(CUSTOM.name)).toEqual(OFFERED); + await waitFor(async () => expect(await rowOffers(SHIPPED.name)).toEqual(FACTORY_OFFERS)); + expect(await rowOffers(CUSTOM.name)).toEqual(OFFERED); }); - it('the shipped row\'s "View config" entry opens the panel on that view, read-only', async () => { + it('the shipped row\'s "View config" opens the panel on that view, read-only', async () => { mount(CUSTOM.name); await settle(); - const trigger = await waitFor(() => screen.getByTestId(`manage-views-actions-${SHIPPED.name}`)); - fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); - fireEvent.click(trigger); - const entry = await waitFor(() => screen.getByTestId(`manage-views-action-config-${SHIPPED.name}`)); - expect(entry.textContent).toContain('View config'); - // Nothing else of the row's menu: no rename, set default, pin or delete. - for (const key of ['rename', 'default', 'pin', 'delete']) { - expect(screen.queryByTestId(`manage-views-action-${key}-${SHIPPED.name}`)).toBeNull(); - } - fireEvent.click(entry); + await waitFor(async () => expect((await rowOffers(SHIPPED.name)).configLabel).toBe('View config')); + await clickConfig(SHIPPED.name); await waitFor(() => expect(panelProps.current?.open).toBe(true)); await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(SHIPPED.name)); await waitFor(() => expect(panelProps.current?.readOnly).toBe(true)); expect(panelProps.current?.mode).toBe('edit'); }); - it('the custom row\'s entry still reads "Edit view config" and opens the panel savable', async () => { + it('the custom row\'s "Edit view config" opens the panel savable', async () => { mount(SHIPPED.name); await settle(); - const trigger = await waitFor(() => screen.getByTestId(`manage-views-actions-${CUSTOM.name}`)); - fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); - fireEvent.click(trigger); - const entry = await waitFor(() => screen.getByTestId(`manage-views-action-config-${CUSTOM.name}`)); - expect(entry.textContent).toContain('Edit view config'); - fireEvent.click(entry); + await clickConfig(CUSTOM.name); await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(CUSTOM.name)); await waitFor(() => expect(panelProps.current?.open).toBe(true)); expect(panelProps.current?.readOnly).toBe(false); @@ -259,8 +274,8 @@ describe('objectstack#35974 — a read-only package\'s view: read-only panel, no expect(panelProps.current?.readOnly).toBe(false); // My views are no row of Manage views; the shared rows are judged as ever. expect(screen.queryByTestId(`manage-views-row-${PERSONAL.id}`)).toBeNull(); - await waitFor(() => expect(rowOffers(SHIPPED.name).pin).toBe(false)); - expect(rowOffers(CUSTOM.name)).toEqual(OFFERED); + await waitFor(async () => expect(await rowOffers(SHIPPED.name)).toEqual(FACTORY_OFFERS)); + expect(await rowOffers(CUSTOM.name)).toEqual(OFFERED); }); it('while the package list is unread, the shipped view keeps every offer (the server still refuses)', async () => { @@ -268,7 +283,7 @@ describe('objectstack#35974 — a read-only package\'s view: read-only panel, no mount(SHIPPED.name); await settle(); await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); - expect(rowOffers(SHIPPED.name)).toEqual(OFFERED); + expect(await rowOffers(SHIPPED.name)).toEqual(OFFERED); expect(panelProps.current?.readOnly).toBe(false); }); @@ -277,7 +292,7 @@ describe('objectstack#35974 — a read-only package\'s view: read-only panel, no mount(SHIPPED.name); await settle(); await waitFor(() => expect(screen.getByTestId(`manage-views-row-${SHIPPED.name}`)).toBeTruthy()); - expect(rowOffers(SHIPPED.name)).toEqual(OFFERED); + expect(await rowOffers(SHIPPED.name)).toEqual(OFFERED); expect(panelProps.current?.readOnly).toBe(false); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.tsx b/ui/packages/app-shell/src/views/ObjectView.tsx index 67f39519c60..bf1d7247ae5 100644 --- a/ui/packages/app-shell/src/views/ObjectView.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.tsx @@ -1134,7 +1134,9 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co listViewActions: { rename: activeView && activeIsPersonal && personalViewsReady && personalGrant('update') ? (label: string) => handleRenamePersonalView(String(activeView.id), label) - : activeView && isAdmin && !activeViewPackageRefusesSaves && savedViews.some((sv: any) => viewRowId(sv) === activeView.id) + // A read-only package's view is renamed too (objectstack#35974): + // `updateView` writes the label into its customization pair. + : activeView && isAdmin && savedViews.some((sv: any) => viewRowId(sv) === activeView.id) ? async (label: string) => { await handleRenameView(String(activeView.id), label); return true; } : undefined, save: !isEnvironmentList && canUpdatePersonalView && listPersonalizedParts.length > 0 ? () => { void handleSaveToPersonalView(); } : undefined, diff --git a/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx b/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx index 95ef922e1bd..514adf868f1 100644 --- a/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx +++ b/ui/packages/plugin-view/src/__tests__/readonlyViewMenus-10209.test.tsx @@ -110,50 +110,49 @@ describe('ManageViewsDialog row menu (#10209)', () => { }); }); -describe('ManageViewsDialog `readonlyConfigViewable` (objectstack#35974)', () => { - /** A saved view the server refuses to save: read-only, its configuration still readable. */ - const VIEWABLE: ViewTabItem = { - id: 'crm_lead.shipped', label: 'Shipped', type: 'grid', readonly: true, readonlyConfigViewable: true, - }; - - it('a read-only row with the flag offers only the configuration entry, labelled as viewing', () => { - const onConfigView = vi.fn(); - renderDialog([VIEWABLE], { onConfigView }); - // No pin, no set default on the row itself. - expect(screen.queryByTestId(`manage-views-pin-${VIEWABLE.id}`)).toBeNull(); - expect(screen.queryByTestId(`manage-views-default-${VIEWABLE.id}`)).toBeNull(); - expect(screen.getByTestId(`manage-views-readonly-${VIEWABLE.id}`)).toBeInTheDocument(); - open(screen.getByTestId(`manage-views-actions-${VIEWABLE.id}`)); - expect(menuShape()).toEqual(['menuitem']); - const entry = screen.getByTestId(`manage-views-action-config-${VIEWABLE.id}`); - expect(entry).toHaveTextContent('View config'); - expect(entry).not.toHaveTextContent('Edit'); - for (const key of ['rename', 'default', 'pin', 'delete']) { - expect(screen.queryByTestId(`manage-views-action-${key}-${VIEWABLE.id}`)).toBeNull(); +describe('ManageViewsDialog `definitionReadonly` (objectstack#35974)', () => { + /** A factory view of a read-only package: its definition is read-only, its row state is not. */ + const FACTORY: ViewTabItem = { id: 'crm_lead.shipped', label: 'Shipped', type: 'grid', definitionReadonly: true }; + + it('a definition-read-only row hides only Delete: rename, pin, set default and "View config" stay', () => { + renderDialog([FACTORY]); + // No lock: the row is not read-only. + expect(screen.queryByTestId(`manage-views-readonly-${FACTORY.id}`)).toBeNull(); + expect(screen.getByTestId(`manage-views-pin-${FACTORY.id}`)).toBeInTheDocument(); + expect(screen.getByTestId(`manage-views-default-${FACTORY.id}`)).toBeInTheDocument(); + open(screen.getByTestId(`manage-views-actions-${FACTORY.id}`)); + expect(menuShape()).toEqual(['menuitem', 'menuitem', 'menuitem', 'menuitem']); + for (const key of ['rename', 'config', 'default', 'pin']) { + expect(screen.getByTestId(`manage-views-action-${key}-${FACTORY.id}`)).toBeInTheDocument(); } + expect(screen.queryByTestId(`manage-views-action-delete-${FACTORY.id}`)).toBeNull(); + const config = screen.getByTestId(`manage-views-action-config-${FACTORY.id}`); + expect(config).toHaveTextContent('View config'); + expect(config).not.toHaveTextContent('Edit'); }); - it('the entry hands the view to the host\'s `onConfigView`', async () => { + it('its "View config" hands the view to the host\'s `onConfigView`', async () => { const onConfigView = vi.fn(); - renderDialog([VIEWABLE], { onConfigView }); - open(screen.getByTestId(`manage-views-actions-${VIEWABLE.id}`)); - fireEvent.click(screen.getByTestId(`manage-views-action-config-${VIEWABLE.id}`)); - await waitFor(() => expect(onConfigView).toHaveBeenCalledWith(VIEWABLE.id)); - }); - - it('without the flag a read-only row is as before: no `…` trigger, no configuration entry', () => { - renderDialog([{ ...VIEWABLE, readonlyConfigViewable: undefined }]); - expect(screen.queryByTestId(`manage-views-actions-${VIEWABLE.id}`)).toBeNull(); - expect(screen.queryByTestId(`manage-views-action-config-${VIEWABLE.id}`)).toBeNull(); + renderDialog([FACTORY], { onConfigView }); + open(screen.getByTestId(`manage-views-actions-${FACTORY.id}`)); + fireEvent.click(screen.getByTestId(`manage-views-action-config-${FACTORY.id}`)); + await waitFor(() => expect(onConfigView).toHaveBeenCalledWith(FACTORY.id)); }); - it('on a mutable row the flag changes nothing: every entry, "Edit view config"', () => { - renderDialog([{ ...EDITABLE, readonlyConfigViewable: true }], { onDuplicate: vi.fn() }); - open(screen.getByTestId(`manage-views-actions-${EDITABLE.id}`)); + it('without the flag a row is as before: all six entries, "Edit view config", Delete under a separator', () => { + renderDialog([{ ...FACTORY, definitionReadonly: undefined }], { onDuplicate: vi.fn() }); + open(screen.getByTestId(`manage-views-actions-${FACTORY.id}`)); expect(menuShape()).toEqual([ 'menuitem', 'menuitem', 'menuitem', 'menuitem', 'menuitem', 'separator', 'menuitem', ]); - expect(screen.getByTestId(`manage-views-action-config-${EDITABLE.id}`)).toHaveTextContent('Edit view config'); + expect(screen.getByTestId(`manage-views-action-config-${FACTORY.id}`)).toHaveTextContent('Edit view config'); + expect(screen.getByTestId(`manage-views-action-delete-${FACTORY.id}`)).toBeInTheDocument(); + }); + + it('`readonly` wins: a read-only row with the flag is as any read-only row (no `…`, lock drawn)', () => { + renderDialog([{ ...READONLY, definitionReadonly: true }]); + expect(screen.queryByTestId(`manage-views-actions-${READONLY.id}`)).toBeNull(); + expect(screen.getByTestId(`manage-views-readonly-${READONLY.id}`)).toBeInTheDocument(); }); }); From c17e284d57372bdce24f4566545887f5d0392b5f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 09:02:06 +0000 Subject: [PATCH 09/12] refactor(plugin-view): drop the unobservable readonly check on definitionReadonly readonly already removes both Manage views entries the flag changes (Delete and the configuration entry), so the check could not fail a test (ablated: the suites stayed green). Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- ui/packages/plugin-view/src/ManageViewsDialog.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/packages/plugin-view/src/ManageViewsDialog.tsx b/ui/packages/plugin-view/src/ManageViewsDialog.tsx index 840a3220513..a7fcad6afc6 100644 --- a/ui/packages/plugin-view/src/ManageViewsDialog.tsx +++ b/ui/packages/plugin-view/src/ManageViewsDialog.tsx @@ -173,8 +173,9 @@ const SortableRow: React.FC = ({ const isReadonly = !!view.readonly; // A row whose definition is read-only but whose row state is not // (`ViewTabItem.definitionReadonly`): no Delete, and its configuration is - // offered to look at. `readonly` wins. - const definitionReadonly = !isReadonly && !!view.definitionReadonly; + // offered to look at. `readonly` wins without a check here: it already + // drops both entries this flag changes. + const definitionReadonly = !!view.definitionReadonly; /** * The overflow menu's entries, each resolved ONCE to the handler it will From 2e34976cd9d1b6a7710568624a055d96abc53e8f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 09:03:15 +0000 Subject: [PATCH 10/12] chore(changeset): describe ruling B for objectstack#35974 and list the console Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .changeset/35974-read-only-package-view-panel.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.changeset/35974-read-only-package-view-panel.md b/.changeset/35974-read-only-package-view-panel.md index 35cfd2b649f..bacee11403e 100644 --- a/.changeset/35974-read-only-package-view-panel.md +++ b/.changeset/35974-read-only-package-view-panel.md @@ -1,16 +1,22 @@ --- '@object-ui/app-shell': patch +'@object-ui/console': patch '@object-ui/plugin-view': patch '@object-ui/i18n': patch --- -fix(ui): a view a read-only package ships opens a read-only view panel and offers no Manage views writes +fix(ui): a view a read-only package ships hides only Delete in Manage views and opens its view panel read-only Clause-②: yes (widening) Metadata-protocol: none -On a list view that ships inside a read-only package (a code or installed package), the admin's view panel now opens read-only. It shows the view's configuration with every control disabled and relays no edit to the list. It offers no Save and no way to publish or discard a draft, only Close. In Manage views the same view's row is read-only: no pin, no set as default, no rename and no delete, each of which the server refused ("save it into the customization package"). Its menu keeps one entry, "View config", which opens that read-only panel. A shared view the console saved into the customization package and the reader's own view are unchanged. The toolbar's personal list changes keep saving to the reader's preferences. +This applies to a list view that ships inside a read-only package (a code or installed package). The console no longer offers that view the two writes the server refuses: -`@object-ui/plugin-view`: `ViewTabItem` gains an optional `readonlyConfigViewable` field. It is read on a `readonly` row only: `ManageViewsDialog` then keeps the row's configuration entry, labelled "View config" (`view.showViewConfig`, a new key in every locale of `@object-ui/i18n`), and leaves every other mutation hidden. Without the field a read-only row offers no configuration entry, as before, and a mutable row ignores it. `ViewTabBar` does not read it. +- Manage views hides Delete on its row. +- The row's configuration entry reads "View config". It opens the admin's view panel read-only: the configuration is shown read-only, no edit reaches the list, and there is nothing to save. The panel has no Save, no draft bar to publish or discard, and only Close. -The read-only verdict is the one the footer calculation menu and Rename already use. The console takes the package the view row was served under and reads the server's `writable` verdict for it from the package list it holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. +Rename, pin and set as default stay offered. They land in that package's customization (the console creates it on first use), so no lock icon is drawn on the row. The list's options menu offers Rename on such a view again. A shared view the console saved into the customization package, and the reader's own view, are unchanged. The toolbar's personal list changes keep saving to the reader's preferences. + +`@object-ui/plugin-view`: `ViewTabItem` gains an optional `definitionReadonly` field. When it is `true`, `ManageViewsDialog` hides Delete and labels the configuration entry "View config" (`view.showViewConfig`, a new key in every locale of `@object-ui/i18n`). Rename, pin, set as default and the configuration entry stay. `readonly` still wins when both are set. Without the field a row behaves as before. `ViewTabBar` does not read it. + +The read-only verdict is the one the footer calculation menu already uses. The console takes the package the view row was served under and reads the server's `writable` verdict for it from the package list it holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. From 60a4b3b7c1bba2babef229f38d5561c857517a5f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 10:58:16 +0000 Subject: [PATCH 11/12] fix(app-shell): the view panel's read-only verdict is the one that drew its Manage views row The panel read a second, per-view package verdict that answers "not read-only" until its own read settles. A shipped row's "View config" opened from another package's view could draw an editable frame, and a verdict landing after an edit stranded that edit with no Discard. - ObjectView judges the panel from the same refusingPackages set the rows are flagged from, for the open view and for the view the panel was opened for (the view switch lands in a transition, after the panel opens). - ViewConfigPanel discards unsaved edits when it turns read-only: the list's preview is restored and the panel shows the stored view. - usePackagesRefusingSaves keeps each package's answer as it lands, so a change to the list of ids never makes an open panel savable again. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .../src/hooks/useStudioDesignGate.ts | 47 ++++++++++------- ...ew.readOnlyPackageViewSaves-35974.test.tsx | 50 +++++++++++++++++-- .../app-shell/src/views/ObjectView.tsx | 28 +++++++++-- .../src/views/ViewConfigPanel.test.tsx | 40 +++++++++++++++ .../app-shell/src/views/ViewConfigPanel.tsx | 43 ++++++++++------ .../src/views/objectViewTitleSwitcher.tsx | 2 +- 6 files changed, 170 insertions(+), 40 deletions(-) diff --git a/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts b/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts index 8617115d787..07103b53585 100644 --- a/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts +++ b/ui/packages/app-shell/src/hooks/useStudioDesignGate.ts @@ -77,7 +77,7 @@ * @module */ -import { useEffect, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { useAuth, useWorkspaceAdminStatus } from '@object-ui/auth'; import { useCanAuthorMetadata } from './useCanAuthorMetadata.js'; import { fetchSessionPackages, type PkgEntry } from '../views/studio-design/packages-io.js'; @@ -214,39 +214,50 @@ const NO_REFUSING_PACKAGES: ReadonlySet = new Set(); * objectstack#35974 — {@link usePackageRefusesSaves} for a list of packages * at once, for a surface that draws one row per view (Manage views): the ids * among `packageIds` the package list carries as read-only. The same - * `writable` verdict, the same session-held read (one request, answered per id - * by `fetchSessionPackages`) and the same fail-open: an id still being read, an + * `writable` verdict, the same session-held read (`fetchSessionPackages`: at + * most one `GET /api/v1/packages` per new package id per session, concurrent + * asks sharing it) and the same fail-open: an id still being read, an * id whose read failed and an id the list leaves out are not in the answer, so * that row keeps what it offered before this read. * * Keyed on the ids themselves, never on the array's identity: callers may hand - * a fresh array each render. + * a fresh array each render. Each id's answer is kept for the session as it + * lands, so a change to the list of ids (a refetch that brings a view of a new + * package) never takes back what is already known: a surface reading this + * while open, such as the view panel, cannot flip back to savable. */ export function usePackagesRefusingSaves(packageIds: readonly string[]): ReadonlySet { const session = usePackageListSession(); const key = JSON.stringify([...new Set(packageIds)].sort()); - const [verdict, setVerdict] = useState<{ - key: string; + const [answers, setAnswers] = useState<{ session: string; - refusing: ReadonlySet; + refuses: ReadonlyMap; } | null>(null); useEffect(() => { const ids = JSON.parse(key) as string[]; - if (ids.length === 0) return undefined; let cancelled = false; - void Promise.allSettled(ids.map((id) => fetchSessionPackages(session, id))).then((answers) => { - if (cancelled) return; - const refusing = new Set(); - answers.forEach((answer, i) => { - if (answer.status === 'fulfilled' && packageStudioPosture(answer.value, ids[i]) === 'view') { - refusing.add(ids[i]); - } + for (const id of ids) { + fetchSessionPackages(session, id).then((list) => { + if (cancelled) return; + const refuses = packageStudioPosture(list, id) === 'view'; + setAnswers((prev) => { + const known = prev && prev.session === session ? prev.refuses : new Map(); + if (known.get(id) === refuses) return prev; + const next = new Map(known); + next.set(id, refuses); + return { session, refuses: next }; + }); + }, () => { + // A failed read answers nothing: the id keeps what it offered. }); - setVerdict({ key, session, refusing }); - }); + } return () => { cancelled = true; }; }, [key, session]); - return verdict && verdict.key === key && verdict.session === session ? verdict.refusing : NO_REFUSING_PACKAGES; + return useMemo(() => { + if (!answers || answers.session !== session) return NO_REFUSING_PACKAGES; + const refusing = (JSON.parse(key) as string[]).filter((id) => answers.refuses.get(id) === true); + return refusing.length === 0 ? NO_REFUSING_PACKAGES : new Set(refusing); + }, [answers, key, session]); } diff --git a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx index df11b8808df..3923624e214 100644 --- a/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.readOnlyPackageViewSaves-35974.test.tsx @@ -12,7 +12,9 @@ * * The verdict is objectstack#35933's: the package the row was served under * (`listViews()` carries `_packageId`) and the session-held package list - * (`fetchSessionPackages`), stubbed here. + * (`fetchSessionPackages`), stubbed here. The panel's read-only verdict is + * the very answer that drew the row (`usePackagesRefusingSaves`), so the two + * cannot disagree, and that answer is kept per package as it lands. * * What runs: the real `ObjectView` on a stub data source. `ListView` is a * stand-in (the list itself is not under test). The real `ManageViewsDialog` @@ -93,11 +95,12 @@ vi.mock('@object-ui/plugin-view', async (importOriginal) => { }; }); -/** The props the view panel was last handed. */ -const panelProps = vi.hoisted(() => ({ current: null as Record | null })); +/** The props the view panel was last handed, and every render's, in order. */ +const panelProps = vi.hoisted(() => ({ current: null as Record | null, renders: [] as Record[] })); vi.mock('./ViewConfigPanel', () => ({ ViewConfigPanel: (props: any) => { panelProps.current = props; + panelProps.renders.push(props); return null; }, })); @@ -111,6 +114,7 @@ vi.mock('./studio-design/packages-io', async (importOriginal) => ({ import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; +import { usePackagesRefusingSaves } from '../hooks/useStudioDesignGate'; const OBJECT = 'showcase_task'; const SHIPPED_PACKAGE = 'com.example.showcase'; @@ -216,6 +220,7 @@ async function clickConfig(id: string) { beforeEach(() => { panelProps.current = null; + panelProps.renders = []; packageList.answer = () => Promise.resolve(PACKAGES); localStorage.clear(); }); @@ -244,6 +249,21 @@ describe('objectstack#35974 — a read-only package\'s view: no Delete, a read-o expect(panelProps.current?.mode).toBe('edit'); }); + it('"View config" on a shipped row while another package\'s view is open: no render of the open panel is editable', async () => { + mount(CUSTOM.name); + await settle(); + await waitFor(async () => expect((await rowOffers(SHIPPED.name)).configLabel).toBe('View config')); + const before = panelProps.renders.length; + await clickConfig(SHIPPED.name); + await waitFor(() => expect(panelProps.current?.activeView?.id).toBe(SHIPPED.name)); + await waitFor(() => expect(panelProps.current?.open).toBe(true)); + const opened = panelProps.renders.slice(before).filter((props) => props.open); + expect(opened.length).toBeGreaterThan(0); + // The first render after the click already reads the row's own verdict: + // no switch-first answer for the newly open view is waited for. + expect(opened.map((props) => props.readOnly)).toEqual(opened.map(() => true)); + }); + it('the custom row\'s "Edit view config" opens the panel savable', async () => { mount(SHIPPED.name); await settle(); @@ -296,3 +316,27 @@ describe('objectstack#35974 — a read-only package\'s view: no Delete, a read-o expect(panelProps.current?.readOnly).toBe(false); }); }); + +describe('objectstack#35974 — the verdict is kept per package as it lands', () => { + function Probe({ ids }: { ids: string[] }) { + const refusing = usePackagesRefusingSaves(ids); + return {[...refusing].sort().join(',')}; + } + + it('a new package id joining the list takes back none of what is known', async () => { + const pending: Array<(rows: any[]) => void> = []; + packageList.answer = () => Promise.resolve(PACKAGES); + const view = render(); + await waitFor(() => expect(screen.getByTestId('refusing').textContent).toBe(SHIPPED_PACKAGE)); + // A refetch brings a view of a package whose answer is still on the wire. + packageList.answer = () => new Promise((resolve) => { pending.push(resolve); }); + view.rerender(); + expect(screen.getByTestId('refusing').textContent).toBe(SHIPPED_PACKAGE); + await settle(); + expect(screen.getByTestId('refusing').textContent).toBe(SHIPPED_PACKAGE); + expect(pending.length).toBeGreaterThan(0); + const rows = [...PACKAGES, { id: 'com.example.other', name: 'Other', writable: false }]; + await act(async () => { pending.forEach((resolve) => resolve(rows)); }); + await waitFor(() => expect(screen.getByTestId('refusing').textContent).toBe(`com.example.other,${SHIPPED_PACKAGE}`)); + }); +}); diff --git a/ui/packages/app-shell/src/views/ObjectView.tsx b/ui/packages/app-shell/src/views/ObjectView.tsx index bf1d7247ae5..8f33a7b0015 100644 --- a/ui/packages/app-shell/src/views/ObjectView.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.tsx @@ -1020,7 +1020,7 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co // objectstack#27594: the list title is the view switcher, which replaced the // view tab strip; the view items `ManageViewsDialog` lists come with it. - const { viewTabItems, titleSwitcher } = useObjectViewTitleSwitcher({ + const { viewTabItems, titleSwitcher, refusingPackages } = useObjectViewTitleSwitcher({ views, savedViews, objectDef, @@ -1061,6 +1061,28 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co onDeletePersonalView: personalViewsReady ? (id: string) => { void handleDeletePersonalView(id); } : undefined, }); + // objectstack#35974 — the view panel is read-only on a view a read-only + // package ships, judged from the SAME answer that drew its Manage views + // row (`refusingPackages`), so the row's "View config" never opens an + // editable panel. The view it was opened for counts as well as the open + // one: a row of another view switches views in a transition, and the + // panel opens before the switch lands. + const [configTargetId, setConfigTargetId] = useState(null); + useEffect(() => { + if (!showViewConfigPanel) setConfigTargetId(null); + }, [showViewConfigPanel]); + const viewRefusesSaves = (id: string | null | undefined): boolean => { + if (!isAdmin || !id) return false; + const packageId = studioPackageId(savedViews.find((sv: any) => viewRowId(sv) === id)); + return packageId !== null && refusingPackages.has(packageId); + }; + const viewConfigPanelReadOnly = viewConfigPanelMode === 'edit' + && (viewRefusesSaves(activeView?.id) || viewRefusesSaves(configTargetId)); + const handleConfigViewFromRow = (id: string) => { + setConfigTargetId(id); + handleConfigView(id); + }; + // objectstack#35878 — the page bar's props, for the view bar's right end // (`viewBarTrailing` below). Filled on every render once the header chrome // is known; the end reads it when it draws, after this render. @@ -1402,7 +1424,7 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co onSetPinned={handlePinView} onReorder={handleReorderViews} onAddView={handleAddView} - onConfigView={handleConfigView} + onConfigView={handleConfigViewFromRow} /> )} @@ -1448,7 +1470,7 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co metadataClient={metadataClient} dataSource={dataSource} onAfterChange={() => setRefreshKey(k => k + 1)} - readOnly={viewConfigPanelMode === 'edit' && activeViewPackageRefusesSaves} + readOnly={viewConfigPanelReadOnly} /> diff --git a/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx b/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx index 4a94c42061d..52f034e219f 100644 --- a/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx +++ b/ui/packages/app-shell/src/views/ViewConfigPanel.test.tsx @@ -24,6 +24,7 @@ vi.mock('./metadata-admin/inspectors/ViewVariantInspector', () => ({ type="button" data-testid="mock-inspector-edit" data-readonly={String(!!readOnly)} + data-columns={JSON.stringify(draft?.config?.columns ?? null)} onClick={() => onPatch({ config: { ...(draft?.config ?? {}), columns: ['a', 'b', 'c'] } }) } @@ -119,6 +120,45 @@ describe('ViewConfigPanel — read-only (objectstack#35974)', () => { expect(props.onSave).not.toHaveBeenCalled(); }); + it('a verdict that lands after an edit: the edit is discarded, the panel stays open and shows the view', () => { + const props = makeProps({ mode: 'edit' }); + const view = render(); + const opened = screen.getByTestId('mock-inspector-edit').getAttribute('data-columns'); + + // Opened editable while the package list was still being read; edited. + fireEvent.click(screen.getByTestId('mock-inspector-edit')); + expect(props.onViewUpdate).toHaveBeenCalledWith('columns', ['a', 'b', 'c']); + expect(screen.getByTestId('mock-inspector-edit').getAttribute('data-columns')).not.toBe(opened); + props.onViewUpdate.mockClear(); + + // The read-only verdict lands. + view.rerender(); + + // The host's list is told to restore the opening view, as Discard would. + expect(props.onViewUpdate).toHaveBeenCalledWith('columns', ['a', 'b']); + expect(props.onViewUpdate).not.toHaveBeenCalledWith('columns', ['a', 'b', 'c']); + // The panel shows the view, not the edit, and stays open, read-only. + expect(screen.getByTestId('mock-inspector-edit').getAttribute('data-columns')).toBe(opened); + expect(screen.getByTestId('mock-inspector-edit').getAttribute('data-readonly')).toBe('true'); + expect(screen.queryByTestId('view-config-discard')).toBeNull(); + expect(screen.queryByTestId('view-config-save')).toBeNull(); + expect(props.onClose).not.toHaveBeenCalled(); + + // Nothing more is relayed: a later edit is taken by no one. + props.onViewUpdate.mockClear(); + fireEvent.click(screen.getByTestId('mock-inspector-edit')); + expect(props.onViewUpdate).not.toHaveBeenCalled(); + expect(props.onSave).not.toHaveBeenCalled(); + }); + + it('a verdict that lands before any edit relays nothing', () => { + const props = makeProps({ mode: 'edit' }); + const view = render(); + view.rerender(); + expect(props.onViewUpdate).not.toHaveBeenCalled(); + expect(screen.getByTestId('mock-inspector-edit').getAttribute('data-readonly')).toBe('true'); + }); + it('a savable view (the default) keeps its editable controls, Save, Discard and the draft bar', () => { const props = makeProps({ mode: 'edit' }); render(); diff --git a/ui/packages/app-shell/src/views/ViewConfigPanel.tsx b/ui/packages/app-shell/src/views/ViewConfigPanel.tsx index de3f84b467e..23db9e8385d 100644 --- a/ui/packages/app-shell/src/views/ViewConfigPanel.tsx +++ b/ui/packages/app-shell/src/views/ViewConfigPanel.tsx @@ -351,24 +351,37 @@ export function ViewConfigPanel({ open, onClose, mode = 'edit', activeView, obje // reach the list only through `onViewUpdate` (see `handlePatch`), so we // replay the panel's opening values — and clear any keys the edits // introduced — through the same seam, then reset the local draft. - const handleDiscard = useCallback(() => { - if (mode === 'edit') { - if (onViewUpdate) { - const original = inspectorDraftToRuntimeView(openingDraft); - const edited = inspectorDraftToRuntimeView(draftRef.current); - const fields = new Set([...Object.keys(edited), ...Object.keys(original)]); - for (const field of fields) { - if (field === 'id') continue; - onViewUpdate(field, original[field]); - } + const revertEdits = useCallback(() => { + if (onViewUpdate) { + const original = inspectorDraftToRuntimeView(openingDraft); + const edited = inspectorDraftToRuntimeView(draftRef.current); + const fields = new Set([...Object.keys(edited), ...Object.keys(original)]); + for (const field of fields) { + if (field === 'id') continue; + onViewUpdate(field, original[field]); } - draftRef.current = initialDraft; - relayedRef.current = new Set(); - setDraft(initialDraft); - setIsDirty(false); } + draftRef.current = initialDraft; + relayedRef.current = new Set(); + setDraft(initialDraft); + setIsDirty(false); + }, [initialDraft, openingDraft, onViewUpdate]); + const handleDiscard = useCallback(() => { + if (mode === 'edit') revertEdits(); onClose(); - }, [initialDraft, openingDraft, mode, onClose, onViewUpdate]); + }, [mode, onClose, revertEdits]); + + // objectstack#35974 — the host's read-only verdict can land after the + // panel opened editable (the package list was still being read) and after + // an edit. A read-only panel offers no Discard, so the edit would be + // stranded on the host's list and shown here in place of the stored view. + // It is discarded instead, the panel staying open. + const wasReadOnlyRef = useRef(readOnly); + useEffect(() => { + const turnedReadOnly = readOnly && !wasReadOnlyRef.current; + wasReadOnlyRef.current = readOnly; + if (turnedReadOnly && mode === 'edit' && (isDirty || relayedRef.current.size > 0)) revertEdits(); + }, [readOnly, mode, isDirty, revertEdits]); // A publish or a discard from the draft bar changes what is stored: the // buffer is read again (objectstack#35054), then the host refreshes. diff --git a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx index a5b01d9d201..45cda91ba8e 100644 --- a/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx +++ b/ui/packages/app-shell/src/views/objectViewTitleSwitcher.tsx @@ -430,5 +430,5 @@ export function useObjectViewTitleSwitcher({ /> ) : null; - return { viewTabItems, titleSwitcher, titleLabel }; + return { viewTabItems, titleSwitcher, titleLabel, refusingPackages }; } From 224cb17fc2f71d24a4d77d0ca2a70475a7518780 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 11:59:09 +0000 Subject: [PATCH 12/12] chore(changeset): note the late read-only verdict on objectstack#35974's panel Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .changeset/35974-read-only-package-view-panel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/35974-read-only-package-view-panel.md b/.changeset/35974-read-only-package-view-panel.md index bacee11403e..35f61ce3aca 100644 --- a/.changeset/35974-read-only-package-view-panel.md +++ b/.changeset/35974-read-only-package-view-panel.md @@ -19,4 +19,4 @@ Rename, pin and set as default stay offered. They land in that package's customi `@object-ui/plugin-view`: `ViewTabItem` gains an optional `definitionReadonly` field. When it is `true`, `ManageViewsDialog` hides Delete and labels the configuration entry "View config" (`view.showViewConfig`, a new key in every locale of `@object-ui/i18n`). Rename, pin, set as default and the configuration entry stay. `readonly` still wins when both are set. Without the field a row behaves as before. `ViewTabBar` does not read it. -The read-only verdict is the one the footer calculation menu already uses. The console takes the package the view row was served under and reads the server's `writable` verdict for it from the package list it holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. +The read-only verdict is the one the footer calculation menu already uses. The console takes the package the view row was served under and reads the server's `writable` verdict for it from the package list it holds for the session. While that list is unread, or when the read fails or does not name the package, everything stays offered as before and the server's refusal still applies. The view panel reads the same answer that drew the Manage views row, so a row's "View config" never opens an editable panel. If the answer arrives after the admin has started editing, the panel turns read-only and discards the edit: the list's preview goes back to the stored view.