diff --git a/.changeset/36906-studio-dashboard-report-app-edit.md b/.changeset/36906-studio-dashboard-report-app-edit.md
new file mode 100644
index 00000000000..2c55336b781
--- /dev/null
+++ b/.changeset/36906-studio-dashboard-report-app-edit.md
@@ -0,0 +1,19 @@
+---
+'@object-ui/app-shell': patch
+'@object-ui/i18n': patch
+---
+
+feat(app-shell): a dashboard or a report opened from a Studio list opens in its app's edit state, and × goes back to the list
+
+Clause-②: no
+Metadata-protocol: none
+
+Studio redesign (epic #36890), decisions 3, 6, 13 and 15.
+
+- **Opening a dashboard or a report from a Studio list** opens its page in an app, with the dashboard's edit state or the report's builder already open, as the page's own Edit opens them. The app is the one the author came from, when that app is one of the package's published apps or its menu opens the item; otherwise it is the package's first published app. The item keeps opening Studio's own item page when the package has no published app, on the list of every package, when the item has no published version yet (a draft only), or when the link asks for one of the item page's tabs or its draft review.
+- **× back to Studio.** The page's address remembers the Studio list it was opened from, so the dashboard page and the report page draw a × that goes back to that list with its filters and sort, after a reload too. The report builder's own × does the same. Leaving unsaved edits asks first.
+- **New report from Studio's report list** opens the app's New report page. The report is saved in the package the list shows, or, for an installed app, in its customization package, so it appears in the list × goes back to. Where the installed app's customization package cannot be used, New goes back to the list, as before. If that package becomes unusable between opening the page and saving, the report is saved outside any package, and a notice says the Studio list does not show it. Closing the page goes back to the Studio list, and the saved report's page keeps the way back. With no app to open, the list creates as before.
+- **A dashboard made in Studio** opens in its app once saved, and the browser's Back from there goes to the list, not to an empty New page.
+- **The report builder's ×, and the New report page's ×,** now ask before dropping unsaved edits everywhere, not only when Studio opened them.
+- **No dashboard edit on a phone.** The dashboard edit state is no longer offered in a phone-width window (narrower than 640 px). A link that asks for it, from Studio or the design mode, is ignored there and the page stays a viewer. The Edit button was already hidden at that width.
+- New console strings under `studioReturn`, and `report.builder.savedOutsideApp`, in every bundled locale.
diff --git a/content/docs/frontend/plugins/plugin-dashboard.mdx b/content/docs/frontend/plugins/plugin-dashboard.mdx
index 3afdc083c72..dbabe2f1860 100644
--- a/content/docs/frontend/plugins/plugin-dashboard.mdx
+++ b/content/docs/frontend/plugins/plugin-dashboard.mdx
@@ -172,7 +172,24 @@ The console's dashboard page uses both in its in-page edit state: an admin
who may design the dashboard's package opens it with **Edit**, changes it with
Studio's own dashboard panels at the right, and **Save** publishes that one
dashboard (into the package, or into the app's customization package for an
-installed app), so everyone sees it at once.
+installed app), so everyone sees it at once. The edit state needs its side
+panel, so it is not offered on a window narrower than Tailwind's `sm`
+breakpoint (640 px).
+
+A dashboard opened from Studio's dashboard list lands on this page with the
+edit state already open, in the app the author came from when it is one of
+the package's apps (or its menu opens the dashboard), else in the package's
+first published app. The page's address then carries `?studio=` with the
+Studio list, and the header draws a **×** that goes back to it, after a
+reload too. A report opened from Studio's report list lands the same way,
+with its builder open, and the report list's **New** opens the app's
+`reports/new` page, which saves the new report in the package (or, for an
+installed app, in its customization package), so it is in the list the
+**×** goes back to. If neither package can be used when the report is
+saved, it is saved outside any package, and a notice says the Studio list
+does not show it. A package with no published app, and a dashboard or a
+report that has no published version yet (a draft only), keep Studio's
+generic item page.
## TypeScript Support
diff --git a/ui/packages/app-shell/src/layout/designModeArrival.ts b/ui/packages/app-shell/src/layout/designModeArrival.ts
index 421fd0f915c..574f8d3b023 100644
--- a/ui/packages/app-shell/src/layout/designModeArrival.ts
+++ b/ui/packages/app-shell/src/layout/designModeArrival.ts
@@ -4,7 +4,8 @@
* The landing of a dashboard the design mode just created (objectstack#36364):
* the design mode navigates to the new dashboard with this in the navigation
* state, and the dashboard's page opens its edit state on arrival
- * (objectstack#36372), as its Edit button does.
+ * (objectstack#36372), as its Edit button does. A dashboard opened from a
+ * Studio list lands the same way (objectstack#36906, `StudioAreaAppOpen`).
*
* Navigation state, not a URL parameter: it is a one-time instruction, not a
* place anyone links to, so a shared or reloaded address never opens the edit
diff --git a/ui/packages/app-shell/src/urlParams.ts b/ui/packages/app-shell/src/urlParams.ts
index 2d1acc4fefd..1e37e0ef14a 100644
--- a/ui/packages/app-shell/src/urlParams.ts
+++ b/ui/packages/app-shell/src/urlParams.ts
@@ -7,6 +7,7 @@
*/
import { NAV_RUN_ACTION_PARAM } from '@object-ui/layout';
+import { STUDIO_RETURN_PARAM } from './views/studio-design/studioAddress.js';
/**
* urlParams — the single registry of RESERVED console URL query params
@@ -61,6 +62,9 @@ import { NAV_RUN_ACTION_PARAM } from '@object-ui/layout';
* | `from` | Ancestor breadcrumb trail for a record route, | push (with |
* | | so drilling record→related-record keeps a | the drill-in) |
* | | clickable path back (`Account → #p → Invoice`).| |
+ * | `studio` | The Studio list an app page was opened from | with the |
+ * | | (objectstack#36906): the page draws × back to | Studio open |
+ * | | it. Defined by `studioAddress.ts`. | |
*
* Push-vs-replace rule of thumb: an overlay the user OPENED (form, drawer)
* pushes one entry so browser Back closes it; passive state that tracks an
@@ -71,9 +75,10 @@ import { NAV_RUN_ACTION_PARAM } from '@object-ui/layout';
* `package`, …) belong to their page's own contract and are NOT reserved
* here — but they must not collide with the names above.
*
- * One reserved param is DEFINED ELSEWHERE and only re-exported here:
- * `runAction` (see {@link NAV_RUN_ACTION_PARAM}). It is the wire encoding of a
- * spec-declared nav slot, written by `@object-ui/layout`'s `resolveHref`, which
+ * Two reserved params are DEFINED ELSEWHERE and only re-exported here.
+ * `studio` ({@link STUDIO_RETURN_PARAM}) belongs to Studio's one address
+ * builder, `studioAddress.ts`. `runAction` (see {@link NAV_RUN_ACTION_PARAM})
+ * is the wire encoding of a spec-declared nav slot, written by `@object-ui/layout`'s `resolveHref`, which
* sits below this package — so the constant lives there and this registry
* references it rather than restating it. Restating would give the console's
* hottest collision check a second spelling to drift from, which is the exact
@@ -190,6 +195,14 @@ export const RECORD_TRAIL_PARAM = 'from';
*/
export { NAV_RUN_ACTION_PARAM };
+/**
+ * The Studio address an app page returns to (`?studio=
`,
+ * objectstack#36906, epic #36890 decision 15). Re-exported, not restated:
+ * `studioAddress.ts` owns the Studio vocabulary and its builders
+ * (`withStudioReturn`, `readStudioReturn`); read it through them.
+ */
+export { STUDIO_RETURN_PARAM };
+
/**
* All reserved params, for collision checks (e.g. a lint or a dev-time
* assertion that a page-scoped param doesn't shadow the console contract).
@@ -208,6 +221,7 @@ export const RESERVED_URL_PARAMS: readonly string[] = [
KEYBOARD_SHORTCUTS_PARAM,
RECORD_TRAIL_PARAM,
NAV_RUN_ACTION_PARAM,
+ STUDIO_RETURN_PARAM,
];
/**
diff --git a/ui/packages/app-shell/src/views/DashboardInPageEditor.tsx b/ui/packages/app-shell/src/views/DashboardInPageEditor.tsx
index df5d81ef192..1c8cdebb0c0 100644
--- a/ui/packages/app-shell/src/views/DashboardInPageEditor.tsx
+++ b/ui/packages/app-shell/src/views/DashboardInPageEditor.tsx
@@ -206,6 +206,36 @@ export function filtersSectionLabel(locale: SupportedLocale): string | null {
return typeof section?.label === 'string' ? section.label : null;
}
+/**
+ * The narrowest window the edit state is offered in: Tailwind's `sm`, from
+ * which the page draws the side panel the edit state needs.
+ */
+export const DASHBOARD_EDIT_MIN_WIDTH = 640;
+
+/** Is the window at least {@link DASHBOARD_EDIT_MIN_WIDTH} wide right now? */
+function dashboardEditFitsNow(): boolean {
+ return typeof window === 'undefined' || window.innerWidth >= DASHBOARD_EDIT_MIN_WIDTH;
+}
+
+/**
+ * Whether the window is wide enough for the edit state (objectstack#36906).
+ * Read synchronously on the first render, as `usePhoneViewport` reads its
+ * answer, so a landing that asks for the edit state never sees a phone as wide.
+ */
+export function useDashboardEditFits(): boolean {
+ const [fits, setFits] = React.useState(dashboardEditFitsNow);
+ React.useEffect(() => {
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;
+ const mql = window.matchMedia(`(min-width: ${DASHBOARD_EDIT_MIN_WIDTH}px)`);
+ const onChange = () => setFits(dashboardEditFitsNow());
+ mql.addEventListener('change', onChange);
+ // A width that moved between the first render and this effect.
+ onChange();
+ return () => mql.removeEventListener('change', onChange);
+ }, []);
+ return fits;
+}
+
/**
* Whether this principal is offered the Edit button for a dashboard
* `ownerPackageId` owns: the gate of the app → Studio entries
@@ -213,13 +243,17 @@ export function filtersSectionLabel(locale: SupportedLocale): string | null {
* package Studio lists, writable or not; never a kernel package). A
* read-only package's dashboard is edited through its customization package.
* Not while the shell's design mode is on (objectstack#36692): the two are
- * separate entries, never open together.
+ * separate entries, never open together. Not on a phone either
+ * (objectstack#36906): the edit state needs its side panel, so a window
+ * narrower than {@link DASHBOARD_EDIT_MIN_WIDTH} is offered no edit, and a
+ * landing that asks for one (from Studio, from the design mode) opens none.
*/
export function useDashboardEditOffered(ownerPackageId: string | null | undefined): boolean {
const path = ownerPackageId ? studioPackagePath(ownerPackageId) : null;
const gated = useStudioEntryGate(path) !== null;
const designing = useDesignModeActive();
- return gated && !designing;
+ const fits = useDashboardEditFits();
+ return gated && !designing && fits;
}
/** The page header's Edit button. */
diff --git a/ui/packages/app-shell/src/views/DashboardView.inPageEdit-36372.test.tsx b/ui/packages/app-shell/src/views/DashboardView.inPageEdit-36372.test.tsx
index f46abc4f9d8..b759367524d 100644
--- a/ui/packages/app-shell/src/views/DashboardView.inPageEdit-36372.test.tsx
+++ b/ui/packages/app-shell/src/views/DashboardView.inPageEdit-36372.test.tsx
@@ -51,14 +51,14 @@ const packages = vi.hoisted(() => ({
ensured: [] as string[],
}));
/** objectstack#36364 — the navigation state the page is reached with, and its replaces. */
-const route = vi.hoisted(() => ({ state: null as unknown, navigate: null as null | ((...a: unknown[]) => void) }));
+const route = vi.hoisted(() => ({ state: null as unknown, search: '', navigate: null as null | ((...a: unknown[]) => void) }));
const toasts = vi.hoisted(() => ({ success: [] as unknown[], error: [] as unknown[] }));
vi.mock('../providers/MetadataProvider', () => ({ useMetadata: () => meta.value }));
vi.mock('react-router-dom', () => ({
useParams: () => ({ dashboardName: 'ops_board' }),
useNavigate: () => route.navigate ?? (() => {}),
- useLocation: () => ({ pathname: '/apps/crm/dashboard/ops_board', search: '', hash: '', key: 'landing', state: route.state }),
+ useLocation: () => ({ pathname: '/apps/crm/dashboard/ops_board', search: route.search, hash: '', key: 'landing', state: route.state }),
}));
vi.mock('./useOpenRecordList', () => ({
useRecordListDrillNavigation: () => ({ openRecordList: vi.fn(), canOpenRecordList: () => true }),
@@ -187,6 +187,7 @@ beforeEach(() => {
toasts.success = [];
toasts.error = [];
route.state = null;
+ route.search = '';
route.navigate = null;
});
@@ -401,6 +402,90 @@ describe('DashboardView arrival from the design mode (objectstack#36364)', () =>
});
});
+describe('DashboardView opened from a Studio list (objectstack#36906)', () => {
+ const studioList = '/studio/crm/metadata/dashboard?q=ops';
+ const fromStudio = `?studio=${encodeURIComponent(studioList)}`;
+
+ let widthBefore = 0;
+ beforeEach(() => {
+ widthBefore = window.innerWidth;
+ });
+ afterEach(() => {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, writable: true, value: widthBefore });
+ });
+
+ it('lands in the edit state, and x goes back to the Studio list', async () => {
+ const navigate = vi.fn();
+ route.navigate = navigate;
+ route.state = { designModeNewDashboard: 'ops_board' };
+ route.search = fromStudio;
+ mount();
+ expect(await screen.findByTestId('dashboard-editing-badge')).toBeInTheDocument();
+ // The landing is cleared, and the address keeps the way back.
+ expect(navigate).toHaveBeenCalledWith(`/apps/crm/dashboard/ops_board${fromStudio}`, { replace: true, state: null });
+ const close = screen.getByTestId('studio-return');
+ expect(close).toHaveAttribute('data-target', studioList);
+ fireEvent.click(close);
+ expect(navigate).toHaveBeenLastCalledWith(studioList);
+ });
+
+ it('after a reload (no landing), the viewer still draws x back to the Studio list', async () => {
+ route.search = fromStudio;
+ mount();
+ await screen.findByTestId('dashboard-edit');
+ expect(screen.queryByTestId('dashboard-editing-badge')).not.toBeInTheDocument();
+ expect(screen.getByTestId('studio-return')).toHaveAttribute('data-target', studioList);
+ });
+
+ it('x over unsaved edits asks first, and staying keeps the edit state', async () => {
+ const navigate = vi.fn();
+ route.navigate = navigate;
+ route.search = fromStudio;
+ // This DOM ships no window.confirm: install one, and put back what was there.
+ const before = window.confirm;
+ const confirm = vi.fn(() => false);
+ window.confirm = confirm as unknown as typeof window.confirm;
+ try {
+ mount();
+ await openEdit();
+ fireEvent.keyDown(screen.getByTestId('dashboard-widget-resize-handle'), { key: 'ArrowRight' });
+ fireEvent.click(screen.getByTestId('studio-return'));
+ expect(confirm).toHaveBeenCalledTimes(1);
+ expect(navigate).not.toHaveBeenCalledWith(studioList);
+ expect(screen.getByTestId('dashboard-editing-badge')).toBeInTheDocument();
+ confirm.mockReturnValue(true);
+ fireEvent.click(screen.getByTestId('studio-return'));
+ expect(navigate).toHaveBeenLastCalledWith(studioList);
+ } finally {
+ window.confirm = before;
+ }
+ });
+
+ it('on a phone, the landing opens no edit state: it is cleared and the page stays a viewer', async () => {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, writable: true, value: 390 });
+ const navigate = vi.fn();
+ route.navigate = navigate;
+ route.state = { designModeNewDashboard: 'ops_board' };
+ route.search = fromStudio;
+ mount();
+ await screen.findAllByText('Total (served)');
+ await act(async () => { await new Promise((r) => setTimeout(r, 0)); });
+ expect(navigate).toHaveBeenCalledWith(`/apps/crm/dashboard/ops_board${fromStudio}`, { replace: true, state: null });
+ expect(screen.queryByTestId('dashboard-editing-badge')).not.toBeInTheDocument();
+ expect(screen.queryByTestId('dashboard-edit')).not.toBeInTheDocument();
+ expect(client.value.layered).not.toHaveBeenCalled();
+ // The way back is still there.
+ expect(screen.getByTestId('studio-return')).toBeInTheDocument();
+ });
+
+ it('a ?studio= value that is not a Studio address draws no x', async () => {
+ route.search = `?studio=${encodeURIComponent('https://example.com/studio/crm')}`;
+ mount();
+ await screen.findByTestId('dashboard-edit');
+ expect(screen.queryByTestId('studio-return')).not.toBeInTheDocument();
+ });
+});
+
describe('DashboardView with no cards yet (objectstack#36364)', () => {
it('a dashboard with no cards says so instead of drawing a blank page; one with cards does not', async () => {
mount({ name: 'ops_board', label: 'Payment analysis', _packageId: 'crm', widgets: [] });
diff --git a/ui/packages/app-shell/src/views/DashboardView.tsx b/ui/packages/app-shell/src/views/DashboardView.tsx
index bc94fc28d29..dc6abc492d8 100644
--- a/ui/packages/app-shell/src/views/DashboardView.tsx
+++ b/ui/packages/app-shell/src/views/DashboardView.tsx
@@ -46,9 +46,11 @@ import {
DashboardEditButton,
DashboardEditingBadge,
DashboardEditPanel,
+ useDashboardEditFits,
useDashboardEditOffered,
useDashboardInPageEdit,
} from './DashboardInPageEditor.js';
+import { StudioReturnButton, useStudioReturnPath } from './StudioReturnButton.js';
import { useInSetupApp } from '../console/setupApp.js';
import { useCustomizeDoorWalled } from './studio-design/StudioCustomizeControls.js';
import { readDashboardEditArrival, withoutDashboardEditArrival } from '../layout/designModeArrival.js';
@@ -304,21 +306,29 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
// objectstack#36364 — a dashboard the design mode just created arrives with
// its page asked to open the edit state, once the Edit button is offered;
// the landing is cleared as it is read, so Back or a reload opens nothing.
+ // objectstack#36906 — a dashboard opened from a Studio list lands the same
+ // way. On a phone the edit state is never offered, so the landing is
+ // cleared there and the page stays a viewer.
const location = useLocation();
const navigate = useNavigate();
+ const editFits = useDashboardEditFits();
const arrivedToEdit = readDashboardEditArrival(location.state, dashboardName);
const landedRef = useRef(null);
useEffect(() => {
- if (!arrivedToEdit || !dashboard || !editOffered || editing) return;
+ if (!arrivedToEdit || !dashboard || editing) return;
+ if (!editOffered && editFits) return;
if (landedRef.current === location.key) return;
landedRef.current = location.key;
navigate(`${location.pathname}${location.search}${location.hash}`, {
replace: true,
state: withoutDashboardEditArrival(location.state),
});
- void startEdit();
+ if (editOffered) void startEdit();
// eslint-disable-next-line react-hooks/exhaustive-deps -- runs once per landing; `startEdit` is a fresh closure each render
- }, [arrivedToEdit, dashboard, editOffered, editing, location.key]);
+ }, [arrivedToEdit, dashboard, editOffered, editFits, editing, location.key]);
+ // objectstack#36906 — opened from a Studio list: × goes back to it.
+ const studioReturn = useStudioReturnPath();
+ const studioReturnButton = studioReturn ? : null;
const previewSchema = useMemo(() => {
if (!dashboard || !unregistered) return dashboard;
@@ -456,6 +466,7 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
icon={}
badge={editing ? : undefined}
actions={editing ? (
+
) : undefined}
/>
diff --git a/ui/packages/app-shell/src/views/StudioReturnButton.tsx b/ui/packages/app-shell/src/views/StudioReturnButton.tsx
new file mode 100644
index 00000000000..106a12597a4
--- /dev/null
+++ b/ui/packages/app-shell/src/views/StudioReturnButton.tsx
@@ -0,0 +1,62 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * The × of an app page that Studio opened (objectstack#36906, epic #36890
+ * decision 15): a dashboard, a report, or the new-report page that a Studio
+ * list opened in its app. The page's address carries the Studio list
+ * (`?studio=`, `STUDIO_RETURN_PARAM`), so the × is still there after a
+ * reload and still goes back to that list, with its filters and sort.
+ *
+ * A page that holds edits it would drop says so with `dirty`: the × asks
+ * first, as Studio's own × does (decision 12).
+ *
+ * @module
+ */
+
+import { useLocation, useNavigate } from 'react-router-dom';
+import { X } from 'lucide-react';
+import { Button } from '@object-ui/components';
+import { useSafeTranslate } from '@object-ui/i18n';
+import { confirmUnsavedLeave } from '../chrome/unsavedEdits.js';
+import { readStudioReturn } from './studio-design/studioAddress.js';
+
+/** The Studio address this app page returns to, or `null` when Studio did not open it. */
+export function useStudioReturnPath(): string | null {
+ const { search } = useLocation();
+ return readStudioReturn(search);
+}
+
+/** The ask a dirty page's × makes before it drops the edits. */
+export function useStudioReturnLeaveMessage(): string {
+ const tt = useSafeTranslate();
+ return tt('studioReturn.leaveConfirm', 'Leave without saving? Your unsaved changes will be lost.');
+}
+
+export function StudioReturnButton({ to, dirty = false }: { to: string; dirty?: boolean }) {
+ const tt = useSafeTranslate();
+ const navigate = useNavigate();
+ const leaveMessage = useStudioReturnLeaveMessage();
+ const label = tt('studioReturn.closeLabel', 'Close and go back to the Studio list');
+ return (
+ {
+ if (dirty) {
+ if (window.confirm(leaveMessage)) navigate(to);
+ return;
+ }
+ confirmUnsavedLeave(() => navigate(to));
+ }}
+ >
+
+ {tt('studioReturn.close', 'Back to Studio')}
+
+ );
+}
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.createLandingReplace-36906.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.createLandingReplace-36906.test.tsx
new file mode 100644
index 00000000000..5aa72730198
--- /dev/null
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.createLandingReplace-36906.test.tsx
@@ -0,0 +1,168 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * objectstack#36906 — the create landing's history entry, at the REAL call site.
+ *
+ * A create's Save navigates to the new item. In a Studio package's area, a
+ * dashboard's or a report's item address leaves for the app at once, so that
+ * landing REPLACES the create page's history entry (`studioCreateLandsInApp`,
+ * read by `MetadataResourceEditPage`): Back from the app lands on the list,
+ * not on an empty create form. Every other type, and Setup (no area host),
+ * land as before, with a PUSH.
+ *
+ * `StudioAreaAppOpen-36906.test.tsx` drives the area's routes over a create
+ * stub; this file drives the real page, so the call site itself is pinned.
+ * The REAL page over a REAL `MetadataClient`, whose transport is an in-memory
+ * server holding drafts and publishes, as in
+ * `ResourceEditPage.createFirstWritePin-11773.test.tsx`.
+ */
+
+import '@testing-library/jest-dom/vitest';
+// The source under test reaches a dynamic import of this module: its first load is paid here, at collection, never inside a case's clock (`check:test-source-alias`).
+import '@objectstack/lint';
+import * as React from 'react';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { MemoryRouter, Route, Routes, useLocation, useNavigationType } from 'react-router-dom';
+import { MetadataClient } from '@object-ui/data-objectstack';
+import { MetadataAreaHostContext, type MetadataAreaHost } from './metadataAreaHost';
+
+const server = {
+ drafts: new Map>(),
+ active: new Map>(),
+ puts: [] as Array<{ key: string; packageId: string | null }>,
+ seq: 0,
+};
+
+const json = (status: number, body: unknown) =>
+ new Response(JSON.stringify(body), { status, headers: { 'Content-Type': 'application/json' } });
+
+async function serve(input: RequestInfo | URL, init?: RequestInit): Promise {
+ const method = (init?.method ?? 'GET').toUpperCase();
+ const url = new URL(String(input), 'http://console.test');
+ const meta = url.pathname.match(/^\/api\/v1\/meta\/(.+)$/);
+ if (!meta) return json(200, []);
+ const seg = meta[1].split('/').map(decodeURIComponent);
+ const key = `${seg[0]}/${seg[1]}`;
+ if (seg[0] === '_drafts') return json(200, { drafts: [] });
+ if (seg.length === 1) return json(200, { items: [] });
+ if (seg.length === 3 && seg[2] === 'publish' && method === 'POST') {
+ const body = server.drafts.get(key);
+ if (!body) return json(404, { error: { code: 'NO_DRAFT', message: 'absent' } });
+ server.active.set(key, body);
+ server.drafts.delete(key);
+ return json(200, { success: true, version: `sha256:${key}`, message: 'published' });
+ }
+ if (seg.length === 3) return json(404, { error: { code: 'NOT_FOUND', message: 'absent' } });
+ if (method === 'PUT') {
+ server.puts.push({ key, packageId: url.searchParams.get('package') });
+ server.seq += 1;
+ server.drafts.set(key, JSON.parse(String(init?.body ?? '{}')) as Record);
+ return json(200, { success: true, version: `hmac-sha256:v${server.seq}`, seq: server.seq, state: 'draft', message: `Saved ${key}` });
+ }
+ return json(404, { error: { code: 'NO_DRAFT', message: 'absent' } });
+}
+
+const client = vi.hoisted(() => ({ current: null as unknown }));
+
+const NAMED_SCHEMA = {
+ type: 'object',
+ required: ['name'],
+ properties: { name: { type: 'string' }, label: { type: 'string' } },
+};
+
+vi.mock('./useMetadata', async (importOriginal) => {
+ const mod = await importOriginal();
+ return {
+ ...mod,
+ useMetadataClient: () => client.current,
+ useMetadataTypes: () => ({
+ loading: false,
+ entries: [
+ { type: 'dashboard', label: 'Dashboard', domain: 'ui', allowEnvironmentOverlay: false, allowRuntimeCreate: true, schema: NAMED_SCHEMA },
+ { type: 'view', label: 'View', domain: 'ui', allowEnvironmentOverlay: false, allowRuntimeCreate: true, schema: NAMED_SCHEMA },
+ ],
+ }),
+ };
+});
+
+import { MetadataResourceEditPage } from './ResourceEditPage';
+import { registerDefaultMetadataSchemas } from './default-schemas';
+
+client.current = new MetadataClient({ baseUrl: '', fetch: vi.fn(serve) as unknown as typeof fetch });
+registerDefaultMetadataSchemas();
+
+const PKG = 'com.acme.crm';
+const AREA: MetadataAreaHost = { packageId: PKG, readOnly: false, basePath: `/studio/${PKG}/metadata` };
+
+beforeEach(() => {
+ server.drafts.clear();
+ server.active.clear();
+ server.puts = [];
+ server.seq = 0;
+ window.localStorage.setItem('metadata-admin:autosave', '0');
+});
+afterEach(() => {
+ cleanup();
+ window.localStorage.removeItem('metadata-admin:autosave');
+ window.history.replaceState(null, '', '/');
+});
+
+/** Where the create landed, and whether that landing pushed or replaced the history entry. */
+function Landed() {
+ return (
+
+ );
+}
+
+/**
+ * Open `type`'s create form (under `host` when one is given, else as Setup
+ * mounts it), name it `pipeline`, and press Save.
+ */
+async function createAndSave(type: 'dashboard' | 'view', host: MetadataAreaHost | null) {
+ const base = host ? host.basePath : '/apps/setup/metadata';
+ // The page binds its saves to `?package=` (`readActivePackageBinding`), as the area's address does.
+ if (host?.packageId) window.history.replaceState(null, '', `/?package=${host.packageId}`);
+ const tree = (
+
+
+ } />
+ } />
+ } />
+
+
+ );
+ render(host ? {tree} : tree);
+ const label = await waitFor(() => {
+ const el = document.getElementById('mdf-label') as HTMLInputElement | null;
+ expect(el).not.toBeNull();
+ return el!;
+ }, { timeout: 8000 });
+ fireEvent.change(label, { target: { value: 'Pipeline' } });
+ fireEvent.change(document.getElementById('mdf-name') as HTMLInputElement, { target: { value: 'pipeline' } });
+ await waitFor(() => expect((document.getElementById('mdf-name') as HTMLInputElement).value).toBe('pipeline'));
+ fireEvent.click(screen.getByRole('button', { name: /Save \(⌘S\)/ }));
+ return `${base}/${type}/pipeline`;
+}
+
+describe("the create landing's history entry, at the real page (objectstack#36906)", () => {
+ it("in a package's area, a dashboard's create landing REPLACES the create page's entry", async () => {
+ const item = await createAndSave('dashboard', AREA);
+ await waitFor(() => expect(screen.getByTestId('landed')).toHaveTextContent(`${item} REPLACE`), { timeout: 8000 });
+ expect(server.puts).toEqual([{ key: 'dashboard/pipeline', packageId: PKG }]);
+ });
+
+ it("CONTROL: in the same area, a view's create landing PUSHES, as before", async () => {
+ const item = await createAndSave('view', AREA);
+ await waitFor(() => expect(screen.getByTestId('landed')).toHaveTextContent(`${item} PUSH`), { timeout: 8000 });
+ expect(server.puts).toEqual([{ key: 'view/pipeline', packageId: PKG }]);
+ });
+
+ it("CONTROL: with no area host (Setup), a dashboard's create landing PUSHES, as before", async () => {
+ const item = await createAndSave('dashboard', null);
+ await waitFor(() => expect(screen.getByTestId('landed')).toHaveTextContent(`${item} PUSH`), { timeout: 8000 });
+ expect(server.puts).toEqual([{ key: 'dashboard/pipeline', packageId: null }]);
+ });
+});
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx
index 0e24467a033..8552b4b6fcf 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx
@@ -174,6 +174,7 @@ import { FlowLedgerSwitch } from '../studio-design/FlowLedgerSwitch.js';
import { useActionLedger } from '../setup/packagedActionLedger.js';
import { standaloneActionObjectName } from '../setup/packagedActions.js';
import { useMetadataAreaHost } from './metadataAreaHost.js';
+import { studioCreateLandsInApp } from '../studio-design/studioAppEdit.js';
import { declarationOnlyAuthoredObject } from './sharing-rule-catalog.js';
import { useRegisterUnsavedEdits } from '../../chrome/unsavedEdits.js';
import { useNavigationWrites } from '../../hooks/useNavigationSync.js';
@@ -2264,6 +2265,11 @@ function MetadataResourceEditPageImpl({
const qs = searchParams.toString();
navigate(`../${encodeURIComponent(savedName)}${qs ? `?${qs}` : ''}`, {
relative: 'path',
+ // objectstack#36906 — in a Studio package's area a new dashboard or
+ // report opens in its app at once, so the create's own entry is
+ // replaced: Back from the app lands on the list, not on an empty
+ // create page.
+ replace: studioCreateLandsInApp(areaHost?.packageId, type),
});
}
} catch (err: any) {
diff --git a/ui/packages/app-shell/src/views/reportBuilderArrival.ts b/ui/packages/app-shell/src/views/reportBuilderArrival.ts
index ce35e76e990..bcb2ee1bfe0 100644
--- a/ui/packages/app-shell/src/views/reportBuilderArrival.ts
+++ b/ui/packages/app-shell/src/views/reportBuilderArrival.ts
@@ -4,7 +4,9 @@
* The landing that opens a report's builder on arrival (objectstack#36374): a
* door that has just made a report (the design mode's Add menu item,
* objectstack#36364) navigates to the report's page with this in the
- * navigation state, and the page opens the builder as its 「Edit」 does.
+ * navigation state, and the page opens the builder as its 「Edit」 does. A
+ * report opened from a Studio list lands the same way (objectstack#36906,
+ * `StudioAreaAppOpen`).
*
* Navigation state, not a URL parameter: it is a one-time instruction, not a
* place anyone links to, so a shared or reloaded address never opens the
diff --git a/ui/packages/app-shell/src/views/runtime-metadata-persistence.ts b/ui/packages/app-shell/src/views/runtime-metadata-persistence.ts
index 300d0af40fe..55f90e5435f 100644
--- a/ui/packages/app-shell/src/views/runtime-metadata-persistence.ts
+++ b/ui/packages/app-shell/src/views/runtime-metadata-persistence.ts
@@ -200,6 +200,8 @@ const PACKAGE_DOORS: RuntimeCreatePackageDoors = {
*/
export async function resolveRuntimeCreatePackage(
appPackageId: string | null | undefined,
+ /** The metadata type being created, named in the warning when the package-less fallback is taken. */
+ type: string,
doors: RuntimeCreatePackageDoors = PACKAGE_DOORS,
): Promise {
if (!appPackageId) return null;
@@ -211,7 +213,7 @@ export async function resolveRuntimeCreatePackage(
return pair.writable ? pair.packageId : null;
} catch (err) {
console.warn(
- `[runtime-metadata] the customization package of "${appPackageId}" could not be had; the view is saved naming no package:`,
+ `[runtime-metadata] the customization package of "${appPackageId}" could not be had; the ${type} is saved naming no package:`,
err,
);
return null;
@@ -469,7 +471,7 @@ export async function createRuntimeMetadata(
);
}
const app = type === 'view' ? ctx.app : null;
- const packageId = app?.packageId ? await resolveRuntimeCreatePackage(app.packageId) : null;
+ const packageId = app?.packageId ? await resolveRuntimeCreatePackage(app.packageId, type) : null;
// objectstack#36137 — the first-write pin: a create over a name that already
// holds a pending draft is refused `409 METADATA_CONFLICT`, never written over it.
await ctx.metadataClient.save(
@@ -572,7 +574,7 @@ export async function saveAndPublishRuntimeMetadata(
ctx: RuntimePersistCtx,
): Promise {
const app = type === 'view' ? ctx.app : null;
- const packageId = app?.packageId ? await resolveRuntimeCreatePackage(app.packageId) : null;
+ const packageId = app?.packageId ? await resolveRuntimeCreatePackage(app.packageId, type) : null;
try {
await ctx.metadataClient.save(
type,
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen-36906.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen-36906.test.tsx
new file mode 100644
index 00000000000..8ee94b85744
--- /dev/null
+++ b/ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen-36906.test.tsx
@@ -0,0 +1,352 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * objectstack#36906 — a dashboard or a report opened from a Studio list opens
+ * in its app's edit state; the report list's New opens the app's new-report
+ * page; with no app, the generic item page (or the area's own create).
+ *
+ * Through the real `StudioMetadataArea` and its routes, with the metadata
+ * pages stubbed to their names and the metadata client answering the
+ * package's apps, this file pins:
+ * - the app the item opens in (decision 6) and the arrival it carries;
+ * - the address the app page returns to (`?studio=`, decision 15): the list
+ * the author left, with its filters, never the item's own params;
+ * - the Studio address is replaced, so Back from the app page skips it;
+ * - which opens keep the generic item page (a tab, the draft review, no app,
+ * the cross-package leg, any other type, an item with no published version);
+ * - a read-only base: its own rows open in its app, a pair row keeps the
+ * generic page, and its report New opens the app page only where the pair
+ * door is open;
+ * - a dashboard made by the area's own create opens in its app, and Back
+ * from there lands on the list, not on an empty create page.
+ */
+
+import '@testing-library/jest-dom/vitest';
+import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest';
+import * as React from 'react';
+import { render, screen, cleanup, fireEvent } from '@testing-library/react';
+import { MemoryRouter, Route, Routes, useLocation, useNavigate, useNavigationType, useParams } from 'react-router-dom';
+
+/**
+ * The area's create, reduced to its Save: it publishes (the server's half is
+ * `published` below) and lands on the item exactly as `ResourceEditPage` does,
+ * with the same `replace` rule.
+ */
+function CreateStub() {
+ const navigate = useNavigate();
+ const { type = '' } = useParams<{ type: string }>();
+ const { search } = useLocation();
+ const host = useMetadataAreaHost();
+ return (
+
+ {
+ published.add(`${type}/made_here`);
+ navigate(`../made_here${search}`, { relative: 'path', replace: studioCreateLandsInApp(host?.packageId, type) });
+ }}
+ >
+ save the new item
+
+
+ );
+}
+
+vi.mock('../metadata-admin/index.js', () => ({
+ MetadataDirectoryPage: () => ,
+ MetadataDiagnosticsPage: () => ,
+ MetadataResourceListPage: () => ,
+ MetadataResourceEditPage: ({ createMode }: { createMode?: boolean }) =>
+ createMode ? : ,
+ MetadataResourceHistoryPage: () => ,
+}));
+
+const listed = vi.hoisted(() => ({ value: new Map() }));
+vi.mock('./packages-io.js', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ fetchListedPackageManifests: vi.fn(async () => listed.value),
+}));
+
+/** The package's published apps, and the apps the client reads by name. */
+const apps = vi.hoisted(() => ({
+ byPackage: new Map>>(),
+ byName: new Map>(),
+ listCalls: [] as Array<[string, unknown]>,
+}));
+/** The dashboards and reports that have a published version (`type/name`); every other one is a draft only. */
+const published = vi.hoisted(() => new Set());
+/** The item reads asked, as `[type, name, options]`; `failing` makes them refuse. */
+const itemReads = vi.hoisted(() => ({ calls: [] as Array<[string, string, unknown]>, failing: false }));
+vi.mock('../metadata-admin/useMetadata.js', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ useMetadataClient: () => ({
+ list: async (type: string, options: { packageId?: string }) => {
+ apps.listCalls.push([type, options]);
+ return apps.byPackage.get(options.packageId ?? '') ?? [];
+ },
+ get: async (type: string, name: string, options?: unknown) => {
+ if (type === 'app') return apps.byName.get(name) ?? null;
+ itemReads.calls.push([type, name, options]);
+ if (itemReads.failing) throw new Error('503 Service Unavailable');
+ // Without draft preview the door answers the published version, or 404 (`null`).
+ return published.has(`${type}/${name}`) ? { name } : null;
+ },
+ }),
+}));
+
+import { StudioMetadataArea } from './StudioMetadataArea';
+import { studioCreateLandsInApp } from './studioAppEdit';
+import { useMetadataAreaHost } from '../metadata-admin/metadataAreaHost';
+import { rememberAppReturnPage, resetAppReturnPageForTests } from '../../utils/appReturnPage';
+// The source under test reaches dynamic imports of `@objectstack/lint`; their first
+// load is paid here, at collection, never inside a case's clock (`check:test-source-alias`).
+import '@objectstack/lint';
+
+const PKG = 'com.example.crm';
+
+beforeEach(() => {
+ listed.value = new Map([[PKG, { id: PKG, name: 'CRM', writable: true, manifest: {} }]]);
+ apps.byPackage = new Map([[PKG, [{ name: 'crm_app', label: 'CRM' }]]]);
+ apps.byName = new Map();
+ apps.listCalls = [];
+ published.clear();
+ for (const item of ['dashboard/ops_board', 'report/pipeline']) published.add(item);
+ itemReads.calls = [];
+ itemReads.failing = false;
+ resetAppReturnPageForTests();
+});
+afterEach(() => {
+ cleanup();
+ resetAppReturnPageForTests();
+});
+
+/** The app page the area hands over to: its address, its landing and how it was reached; and the browser's Back. */
+function AppPage() {
+ const { pathname, search, state } = useLocation();
+ const how = useNavigationType();
+ const navigate = useNavigate();
+ return (
+
+ navigate(-1)}>
+ back
+
+
+ );
+}
+
+function PackageArea() {
+ const { pathname } = useLocation();
+ const packageId = decodeURIComponent(pathname.split('/')[2] ?? '');
+ return ;
+}
+
+function mount(url: string, earlier: string[] = []) {
+ return render(
+
+
+ } />
+ } />
+ } />
+
+ ,
+ );
+}
+
+async function appPage() {
+ const el = await screen.findByTestId('app-page');
+ return {
+ at: el.getAttribute('data-at') ?? '',
+ state: JSON.parse(el.getAttribute('data-state') ?? 'null'),
+ how: el.getAttribute('data-how'),
+ };
+}
+
+const studioOf = (at: string) => new URLSearchParams(at.slice(at.indexOf('?'))).get('studio');
+
+describe('a Studio dashboard or report opens in its app (objectstack#36906)', () => {
+ it("a dashboard opens the package app's page in its edit state; the address returns to the list as left", async () => {
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}&q=ops&tab=`);
+ // `tab=` (empty) still asks the item page for a tool: that open keeps it.
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ cleanup();
+
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}&q=ops`);
+ const opened = await appPage();
+ // One app in the package: its address is the package id (ADR-0048 option A).
+ expect(opened.at.split('?')[0]).toBe(`/apps/${PKG}/dashboard/ops_board`);
+ expect(opened.state).toEqual({ designModeNewDashboard: 'ops_board' });
+ expect(studioOf(opened.at)).toBe(`/studio/${PKG}/metadata/dashboard?package=${PKG}&q=ops`);
+ // Replaced: Back from the app page lands on the list, not on this address.
+ expect(opened.how).toBe('REPLACE');
+ expect(apps.listCalls).toEqual([['app', { packageId: PKG }]]);
+ // The one read of the item, asked of the open package.
+ expect(itemReads.calls).toEqual([['dashboard', 'ops_board', { packageId: PKG }]]);
+ });
+
+ it('a report opens its builder on arrival, in the app the author came from when it is one of the package apps', async () => {
+ apps.byPackage.set(PKG, [{ name: 'sales' }, { name: 'service' }]);
+ rememberAppReturnPage({ path: '/apps/service/home', app: 'service', label: 'Service' });
+ mount(`/studio/${PKG}/metadata/report/pipeline?package=${PKG}`);
+ const opened = await appPage();
+ expect(opened.at.split('?')[0]).toBe('/apps/service/report/pipeline');
+ expect(opened.state).toEqual({ openReportBuilder: 'pipeline' });
+ });
+
+ it("the remembered app of another package counts when its menu opens the item; Setup's, without it, does not", async () => {
+ rememberAppReturnPage({ path: '/apps/ops_console/home', app: 'ops_console', label: 'Ops' });
+ apps.byName.set('ops_console', { name: 'ops_console', navigation: [{ id: 'n', type: 'dashboard', dashboardName: 'ops_board' }] });
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}`);
+ expect((await appPage()).at.split('?')[0]).toBe('/apps/ops_console/dashboard/ops_board');
+ cleanup();
+
+ resetAppReturnPageForTests();
+ rememberAppReturnPage({ path: '/apps/setup/system', app: 'setup', label: 'Setup' });
+ apps.byName.set('setup', { name: 'setup', navigation: [{ id: 'n', type: 'object', objectName: 'sys_user' }] });
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}`);
+ expect((await appPage()).at.split('?')[0]).toBe(`/apps/${PKG}/dashboard/ops_board`);
+ });
+
+ it('a package with no published app keeps the generic item page (decision 3)', async () => {
+ apps.byPackage.set(PKG, []);
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ expect(screen.queryByTestId('app-page')).toBeNull();
+ });
+
+ it('the History tab and the draft review keep the generic item page', async () => {
+ mount(`/studio/${PKG}/metadata/report/pipeline/history?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ cleanup();
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}&review=1`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ expect(apps.listCalls).toEqual([]);
+ });
+
+ it('the cross-package leg and every other type keep the generic item page', async () => {
+ // The cross-package leg itself (with `?package=` the area moves the open to that package's leg).
+ mount('/studio/~all/metadata/dashboard/ops_board');
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ cleanup();
+ mount(`/studio/${PKG}/metadata/view/account.all?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ expect(apps.listCalls).toEqual([]);
+ });
+});
+
+describe("the report list's New opens the app's new-report page (objectstack#36906, decision 13)", () => {
+ it('opens /apps/APP/reports/new, returning to the report list', async () => {
+ mount(`/studio/${PKG}/metadata/report/new?package=${PKG}`);
+ const opened = await appPage();
+ expect(opened.at.split('?')[0]).toBe(`/apps/${PKG}/reports/new`);
+ expect(opened.state).toBeNull();
+ expect(studioOf(opened.at)).toBe(`/studio/${PKG}/metadata/report?package=${PKG}`);
+ });
+
+ it('with no app to open, the area creates as before; a dashboard New is not this card', async () => {
+ apps.byPackage.set(PKG, []);
+ mount(`/studio/${PKG}/metadata/report/new?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('create');
+ cleanup();
+ apps.byPackage.set(PKG, [{ name: 'crm_app' }]);
+ mount(`/studio/${PKG}/metadata/dashboard/new?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('create');
+ });
+});
+
+describe('an item with no published version keeps the generic item page (objectstack#36906)', () => {
+ it('a draft-only dashboard row keeps the item page, and no app is read', async () => {
+ mount(`/studio/${PKG}/metadata/dashboard/ai_drafted?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ expect(screen.queryByTestId('app-page')).toBeNull();
+ expect(itemReads.calls).toEqual([['dashboard', 'ai_drafted', { packageId: PKG }]]);
+ expect(apps.listCalls).toEqual([]);
+ });
+
+ it('so does a draft-only report, and an item whose read fails', async () => {
+ mount(`/studio/${PKG}/metadata/report/refused_publish?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ cleanup();
+ itemReads.failing = true;
+ mount(`/studio/${PKG}/metadata/dashboard/ops_board?package=${PKG}`);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ expect(screen.queryByTestId('app-page')).toBeNull();
+ });
+
+ it("a dashboard made by the area's create opens in its app, and Back from there lands on the list", async () => {
+ const list = `/studio/${PKG}/metadata/dashboard?package=${PKG}`;
+ mount(`/studio/${PKG}/metadata/dashboard/new?package=${PKG}`, [list]);
+ fireEvent.click(await screen.findByText('save the new item'));
+ const opened = await appPage();
+ expect(opened.at.split('?')[0]).toBe(`/apps/${PKG}/dashboard/made_here`);
+ expect(opened.state).toEqual({ designModeNewDashboard: 'made_here' });
+ expect(studioOf(opened.at)).toBe(list);
+ fireEvent.click(screen.getByText('back'));
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('list');
+ });
+
+ it('the create landing is replaced only where the item opens in an app', () => {
+ expect(studioCreateLandsInApp(PKG, 'dashboard')).toBe(true);
+ expect(studioCreateLandsInApp(PKG, 'report')).toBe(true);
+ expect(studioCreateLandsInApp(PKG, 'view')).toBe(false);
+ expect(studioCreateLandsInApp(null, 'dashboard')).toBe(false);
+ expect(studioCreateLandsInApp(undefined, 'report')).toBe(false);
+ });
+});
+
+describe('a read-only base (objectstack#36906)', () => {
+ const BASE = 'com.example.hr';
+ const PAIR = `${BASE}.custom`;
+ const customizationOf = (walled: boolean) =>
+ ({ base: BASE, baseLabel: 'HR', basedOn: null, walled, pairId: null, ensure: async () => PAIR, ensurePackage: vi.fn() }) as any;
+
+ beforeEach(() => {
+ listed.value.set(BASE, { id: BASE, name: 'HR', writable: false, manifest: {} });
+ listed.value.set(PAIR, { id: PAIR, name: 'HR (customizations)', writable: true, manifest: {} });
+ apps.byPackage.set(BASE, [{ name: 'hr_app', label: 'HR' }]);
+ published.add('dashboard/headcount');
+ });
+
+ function mountBase(url: string, customization: unknown) {
+ return render(
+
+
+ } />
+ } />
+ } />
+
+ ,
+ );
+ }
+
+ it("a base dashboard row opens in the base's app", async () => {
+ mountBase(`/studio/${BASE}/metadata/dashboard/headcount?package=${BASE}`, customizationOf(false));
+ const opened = await appPage();
+ expect(opened.at.split('?')[0]).toBe(`/apps/${BASE}/dashboard/headcount`);
+ expect(opened.state).toEqual({ designModeNewDashboard: 'headcount' });
+ expect(studioOf(opened.at)).toBe(`/studio/${BASE}/metadata/dashboard?package=${BASE}`);
+ });
+
+ it('a pair row keeps the generic item page: the pair has no published app of its own', async () => {
+ mountBase(`/studio/${PAIR}/metadata/dashboard/headcount?package=${PAIR}`, null);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('item');
+ expect(screen.queryByTestId('app-page')).toBeNull();
+ expect(apps.listCalls).toEqual([['app', { packageId: PAIR }]]);
+ });
+
+ it("report New opens the base app's new-report page (it saves in the pair), returning to the list", async () => {
+ mountBase(`/studio/${BASE}/metadata/report/new?package=${BASE}`, customizationOf(false));
+ const opened = await appPage();
+ expect(opened.at.split('?')[0]).toBe(`/apps/${BASE}/reports/new`);
+ expect(studioOf(opened.at)).toBe(`/studio/${BASE}/metadata/report?package=${BASE}`);
+ });
+
+ it('where the pair door is closed, report New goes back to the list, as every create there does', async () => {
+ mountBase(`/studio/${BASE}/metadata/report/new?package=${BASE}`, customizationOf(true));
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('list');
+ expect(screen.queryByTestId('app-page')).toBeNull();
+ cleanup();
+ mountBase(`/studio/${BASE}/metadata/report/new?package=${BASE}`, null);
+ expect((await screen.findByTestId('area-page')).getAttribute('data-page')).toBe('list');
+ expect(apps.listCalls).toEqual([]);
+ });
+});
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen.tsx b/ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen.tsx
new file mode 100644
index 00000000000..26bc0f95915
--- /dev/null
+++ b/ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen.tsx
@@ -0,0 +1,182 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * A dashboard or a report opened from a Studio list opens in the app's own
+ * edit state (objectstack#36906, epic #36890), and a report's New opens the
+ * app's new-report page (decision 13). This component is the one step between
+ * the two places:
+ *
+ * 1. It reads the open package's published apps and, when the author came
+ * from an app outside the package, that app's menu.
+ * 2. It picks the app (decision 6, `studioAppEditSegment`).
+ * 3. It replaces the Studio address with the app's. A dashboard or a report
+ * carries its arrival in the navigation state, so the page opens the
+ * dashboard's edit state or the report's builder as its Edit does, and
+ * the address carries the Studio list (`?studio=`, decision 15), so the
+ * page's × goes back to the list, after a reload too.
+ *
+ * With no app to open in, it renders `fallback`: the generic item page, or
+ * the area's own create (decision 3). So does an item with no published
+ * version (a draft only, such as an AI draft or a create whose publish was
+ * refused): the app page reads the published world, so it would answer
+ * 「not found」, and the generic item page is the one that opens the draft.
+ * That is one read of the item, asked as the app asks it (no draft preview).
+ * An item with a published version and a pending draft over it opens in the
+ * app on the published version; the draft stays Studio's to publish or
+ * discard, and the app's in-page Save refuses while it is pending.
+ *
+ * The Studio address is replaced, not stacked, so the browser's Back from the
+ * app page lands on the list, as × does.
+ */
+
+import * as React from 'react';
+import { Navigate, useLocation } from 'react-router-dom';
+import { readAppReturnPage } from '../../utils/appReturnPage.js';
+import { dashboardEditArrival } from '../../layout/designModeArrival.js';
+import { reportBuilderArrival } from '../reportBuilderArrival.js';
+import { useMetadataClient } from '../metadata-admin/useMetadata.js';
+import { ITEM_ONLY_PARAMS, detailListHref } from '../metadata-admin/ResourceDetailHeader.js';
+import { useMetadataAreaHost } from '../metadata-admin/metadataAreaHost.js';
+import { t, useMetadataLocale } from '../metadata-admin/i18n.js';
+import { withStudioReturn } from './studioAddress.js';
+import {
+ appItemPath,
+ appNewReportPath,
+ isStudioAppEditType,
+ rememberedPackageApp,
+ studioAppCreateSegment,
+ studioAppEditSegment,
+ type StudioAppEditType,
+ type StudioAppTarget,
+} from './studioAppEdit.js';
+
+/** What opens in the app: an item's page, or the new-report page. */
+export type StudioAreaAppTarget = { kind: 'item'; type: StudioAppEditType; name: string } | { kind: 'new-report' };
+
+type Answer = { to: string; state: Record | null } | 'fallback';
+
+export function StudioAreaAppOpen({
+ packageId,
+ target,
+ fallback,
+}: {
+ /** The open package. */
+ packageId: string;
+ target: StudioAreaAppTarget;
+ /** What renders when no app can open it. */
+ fallback: React.ReactElement;
+}): React.ReactElement {
+ const client = useMetadataClient();
+ const locale = useMetadataLocale();
+ const { pathname, search } = useLocation();
+ // Read once per open, as the back link reads it: nothing in Studio is an app page.
+ const [remembered] = React.useState(readAppReturnPage);
+ const [answer, setAnswer] = React.useState(null);
+ // The address it opened on: the list it returns to is read from it.
+ const openedAt = React.useRef({ pathname, search });
+
+ React.useEffect(() => {
+ let cancelled = false;
+ const type: StudioAppEditType = target.kind === 'item' ? target.type : 'report';
+ const name = target.kind === 'item' ? target.name : '';
+ void (async () => {
+ // An item the app cannot show (no published version, or the read
+ // failed) keeps the generic item page.
+ if (target.kind === 'item') {
+ let published: unknown;
+ try {
+ published = await client.get(type, name, { packageId });
+ } catch {
+ published = null;
+ }
+ if (cancelled) return;
+ if (!published) {
+ setAnswer('fallback');
+ return;
+ }
+ }
+ let apps: StudioAppTarget[];
+ try {
+ const listed = (await client.list('app', { packageId })) as Array>;
+ apps = (listed || [])
+ .filter((a) => typeof a?.name === 'string' && a.name)
+ .map((a) => ({ name: String(a.name), label: (a.label ?? a.name) as StudioAppTarget['label'] }));
+ } catch {
+ apps = [];
+ }
+ // The remembered app's own menu counts only for an item, and only when
+ // the app is not one of the package's: the package's own apps win first.
+ let rememberedMenu: unknown;
+ if (target.kind === 'item' && remembered && !rememberedPackageApp(remembered, packageId, apps)) {
+ try {
+ const app = (await client.get('app', remembered.app)) as { navigation?: unknown } | null;
+ rememberedMenu = app?.navigation;
+ } catch {
+ rememberedMenu = undefined;
+ }
+ }
+ if (cancelled) return;
+ const segment =
+ target.kind === 'item'
+ ? studioAppEditSegment({ packageId, apps, remembered, rememberedMenu, type, name })
+ : studioAppCreateSegment({ packageId, apps, remembered });
+ if (!segment) {
+ setAnswer('fallback');
+ return;
+ }
+ const opened = openedAt.current;
+ const list = detailListHref(opened.pathname, new URLSearchParams(opened.search));
+ if (target.kind === 'item') {
+ setAnswer({
+ to: withStudioReturn(appItemPath(segment, type, name), list),
+ state: type === 'dashboard' ? dashboardEditArrival(name) : reportBuilderArrival(name),
+ });
+ } else {
+ setAnswer({ to: withStudioReturn(appNewReportPath(segment), list), state: null });
+ }
+ })();
+ return () => {
+ cancelled = true;
+ };
+ // Decided once per open: the component is keyed by the item.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ if (answer === 'fallback') return fallback;
+ if (answer) return ;
+ return (
+
+ {t('engine.studio.loading', locale)}
+
+ );
+}
+
+/**
+ * `/:type/:name` in the area: a dashboard or a report on a plain open
+ * opens in its app (`StudioAreaAppOpen`), and its generic item page is the
+ * fallback; every other item renders `children`, the area's own open.
+ *
+ * An address that asks the item page for one of its own tools (a tab, the
+ * draft review, a selection: `ITEM_ONLY_PARAMS`) keeps the item page, so the
+ * History tab and the draft door's review links still land there. So does an
+ * item on the cross-package leg, which has no package to pick an app from.
+ * Decided once per item, when it opens: the area keys this by the item.
+ */
+export function StudioAreaAppGate({
+ type,
+ name,
+ children,
+}: {
+ type: string;
+ name: string;
+ children: React.ReactElement;
+}): React.ReactElement {
+ const host = useMetadataAreaHost();
+ const { search } = useLocation();
+ const [inApp] = React.useState(() => {
+ const params = new URLSearchParams(search);
+ return isStudioAppEditType(type) && !!host?.packageId && !ITEM_ONLY_PARAMS.some((key) => params.has(key));
+ });
+ if (!inApp || !host?.packageId || !isStudioAppEditType(type)) return children;
+ return ;
+}
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx b/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx
index 0d7f257dea1..c8ca1691b35 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioBackToApp.tsx
@@ -32,17 +32,13 @@
import * as React from 'react';
import { ChevronLeft } from 'lucide-react';
-import type { I18nLabel } from '@objectstack/spec/ui';
import { useHomePath } from '../../hooks/useHomePath.js';
import { readAppReturnPage, type AppReturnPage } from '../../utils/appReturnPage.js';
import { navItemLabelText } from '../metadata-admin/previews/navItemLabel.js';
import { t, tFormat } from '../metadata-admin/i18n.js';
+import { packageAppSegment, rememberedPackageApp, type StudioAppTarget } from './studioAppEdit.js';
-/** A published app of the open package. */
-export interface StudioAppTarget {
- name: string;
- label: I18nLabel;
-}
+export type { StudioAppTarget } from './studioAppEdit.js';
/** Where the back link goes, and the app it names (`null`: none). */
export interface StudioBackTarget {
@@ -75,11 +71,9 @@ export function studioBackTarget({
const labelOf = (app: StudioAppTarget) => navItemLabelText(app.label, locale) || app.name;
// The page the author came from, when it is one of this package's apps: its
// record names the app by its route key, the app's name or the package id.
- const cameFrom = remembered
- ? (apps.find((a) => a.name === remembered.app) ?? (remembered.app === packageId ? first : undefined))
- : undefined;
+ const cameFrom = rememberedPackageApp(remembered, packageId, apps);
if (remembered && cameFrom) return { path: remembered.path, appLabel: labelOf(cameFrom) };
- const segment = encodeURIComponent(apps.length > 1 ? first.name : packageId);
+ const segment = encodeURIComponent(packageAppSegment(packageId, apps, first));
return { path: `/apps/${segment}`, appLabel: labelOf(first) };
}
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.tsx b/ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.tsx
index 4a9a303c2f5..a04f6d33290 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.tsx
@@ -38,6 +38,7 @@
import * as React from 'react';
import { Navigate, Route, Routes, useLocation, useParams, useSearchParams } from 'react-router-dom';
+import { StudioAreaAppGate, StudioAreaAppOpen } from './StudioAreaAppOpen.js';
import {
MetadataAreaHostContext,
SETUP_DATASOURCES_PATH,
@@ -162,8 +163,13 @@ function AreaItem({ editor }: { editor: AreaEditorProps }): React.ReactElement {
const [search] = useSearchParams();
// One editor buffer per member: two locales of one template are two items.
const member = search.get(BUNDLE_MEMBER_PARAM) ?? '';
- // A type never holds a `/`, so this names one item.
- return ;
+ // A type never holds a `/`, so this names one item. objectstack#36906 — a
+ // dashboard or a report opens in its app instead (`StudioAreaAppGate`).
+ return (
+
+
+
+ );
}
function AreaItemOpen({
@@ -277,6 +283,22 @@ function AreaHistoryRedirect(): React.ReactElement {
* the create URL lands on the list, as before.
*/
function AreaCreate({ customization }: { customization: StudioBaseCustomization | null }): React.ReactElement {
+ const { type = '' } = useParams<{ type: string }>();
+ const host = useMetadataAreaHost();
+ // objectstack#36906, decision 13 — a report is made on its app's
+ // new-report page, which saves it in the package, or in a read-only base's
+ // pair. Where the pair door is closed, or with no app to open, the area's
+ // own create (which on a read-only base goes back to the list).
+ if (type === 'report' && host?.packageId && (!host.readOnly || host.pairCreate)) {
+ return (
+ } />
+ );
+ }
+ return ;
+}
+
+/** The area's own create: in the package, in a read-only base's pair, or none. */
+function AreaOwnCreate({ customization }: { customization: StudioBaseCustomization | null }): React.ReactElement {
const { type = '' } = useParams<{ type: string }>();
const { search } = useLocation();
const host = useMetadataAreaHost();
diff --git a/ui/packages/app-shell/src/views/studio-design/studioAddress.test.ts b/ui/packages/app-shell/src/views/studio-design/studioAddress.test.ts
index 15a62981f0f..70ad96a2173 100644
--- a/ui/packages/app-shell/src/views/studio-design/studioAddress.test.ts
+++ b/ui/packages/app-shell/src/views/studio-design/studioAddress.test.ts
@@ -10,8 +10,12 @@
*/
import { describe, expect, it } from 'vitest';
+import { RESERVED_URL_PARAMS } from '../../urlParams.js';
import {
STUDIO_ITEM_PILLAR,
+ STUDIO_RETURN_PARAM,
+ readStudioReturn,
+ withStudioReturn,
studioChangesReviewPath,
studioHomePath,
studioItemPath,
@@ -235,3 +239,45 @@ describe('the mapping table agrees with the code (objectstack#36895)', () => {
expect(retiredInterfacesTarget('crm', '?surface=page%3Ahome')).toBe('/studio/crm/data');
});
});
+
+describe('the "came from Studio" param (objectstack#36906, decision 15)', () => {
+ it('carries a Studio list address on an app path, keeping its own query and fragment', () => {
+ expect(STUDIO_RETURN_PARAM).toBe('studio');
+ const list = '/studio/crm/metadata/dashboard?q=ops&sort=-changed';
+ expect(withStudioReturn('/apps/crm/dashboard/ops_board', list)).toBe(
+ '/apps/crm/dashboard/ops_board?studio=%2Fstudio%2Fcrm%2Fmetadata%2Fdashboard%3Fq%3Dops%26sort%3D-changed',
+ );
+ expect(withStudioReturn('/apps/crm/report/r1?x=1#top', '/studio/crm/metadata/report')).toBe(
+ '/apps/crm/report/r1?x=1&studio=%2Fstudio%2Fcrm%2Fmetadata%2Freport#top',
+ );
+ });
+
+ it('reads back exactly what it carried', () => {
+ const list = '/studio/crm/metadata/dashboard?q=a%20b&package=crm';
+ const path = withStudioReturn('/apps/crm/dashboard/d', list);
+ expect(readStudioReturn(path.slice(path.indexOf('?')))).toBe(list);
+ expect(readStudioReturn(new URLSearchParams({ studio: '/studio' }))).toBe('/studio');
+ });
+
+ it('refuses anything that is not a Studio address on this origin, both ways', () => {
+ for (const value of [
+ 'https://evil.example/studio/crm',
+ '//evil.example/studio',
+ '/studiox/crm',
+ '/apps/crm',
+ 'studio/crm',
+ '/studio\\..\\apps',
+ 'javascript:alert(1)',
+ '',
+ ]) {
+ expect(readStudioReturn(new URLSearchParams({ studio: value }))).toBeNull();
+ expect(withStudioReturn('/apps/crm/dashboard/d', value)).toBe('/apps/crm/dashboard/d');
+ }
+ expect(readStudioReturn('')).toBeNull();
+ expect(readStudioReturn('?other=1')).toBeNull();
+ });
+
+ it('is one of the console reserved URL params', () => {
+ expect(RESERVED_URL_PARAMS).toContain(STUDIO_RETURN_PARAM);
+ });
+});
diff --git a/ui/packages/app-shell/src/views/studio-design/studioAddress.ts b/ui/packages/app-shell/src/views/studio-design/studioAddress.ts
index 8c7e2110bb2..69de1e73c7c 100644
--- a/ui/packages/app-shell/src/views/studio-design/studioAddress.ts
+++ b/ui/packages/app-shell/src/views/studio-design/studioAddress.ts
@@ -345,3 +345,62 @@ export function studioItemReviewPath(packageId: string, type: string, name: stri
query: `${STUDIO_ITEM_REVIEW_PARAM}=${STUDIO_ITEM_REVIEW_VALUE}`,
});
}
+
+// ---------------------------------------------------------------------------
+// "Came from Studio": an app page opened from a Studio list
+// ---------------------------------------------------------------------------
+
+/**
+ * The query key an app page carries when Studio opened it (objectstack#36906,
+ * epic #36890 decision 15). Its value is the Studio address to return to: the
+ * list the author left, with its filters and sort. It lives in the address,
+ * not in navigation state, so after a reload the page's × still goes back to
+ * Studio.
+ *
+ * Registered with the console's reserved params (`urlParams.ts`).
+ */
+export const STUDIO_RETURN_PARAM = 'studio';
+
+/**
+ * `appPath` (an app address; its own query and fragment are kept) with
+ * {@link STUDIO_RETURN_PARAM} set to `studioAddress`. A value that is not a
+ * Studio address is not carried: `appPath` comes back unchanged.
+ */
+export function withStudioReturn(appPath: string, studioAddress: string): string {
+ if (!isStudioAddress(studioAddress)) return appPath;
+ const hashAt = appPath.indexOf('#');
+ const hash = hashAt >= 0 ? appPath.slice(hashAt) : '';
+ const beforeHash = hashAt >= 0 ? appPath.slice(0, hashAt) : appPath;
+ const queryAt = beforeHash.indexOf('?');
+ const path = queryAt >= 0 ? beforeHash.slice(0, queryAt) : beforeHash;
+ const params = new URLSearchParams(queryAt >= 0 ? beforeHash.slice(queryAt + 1) : '');
+ params.set(STUDIO_RETURN_PARAM, studioAddress);
+ return `${path}?${params.toString()}${hash}`;
+}
+
+/**
+ * The Studio address that an app page's {@link STUDIO_RETURN_PARAM} names.
+ * Returns `null` when the param is missing, or when its value is anything
+ * other than a Studio address on this origin. The value comes from the
+ * address bar, so it is untrusted and is never followed outside Studio.
+ */
+export function readStudioReturn(search: string | URLSearchParams | null | undefined): string | null {
+ if (!search) return null;
+ const params = typeof search === 'string' ? new URLSearchParams(search) : search;
+ const value = params.get(STUDIO_RETURN_PARAM);
+ return value && isStudioAddress(value) ? value : null;
+}
+
+/** Whether `value` is a Studio address on this origin: `/studio` or a path below it, nothing else. */
+function isStudioAddress(value: string): boolean {
+ if (!value.startsWith(STUDIO_ROOT_PATH) || value.includes('\\')) return false;
+ const next = value.charAt(STUDIO_ROOT_PATH.length);
+ if (next !== '' && next !== '/' && next !== '?' && next !== '#') return false;
+ try {
+ const base = 'http://studio.invalid';
+ const url = new URL(value, base);
+ return url.origin === base && (url.pathname === STUDIO_ROOT_PATH || url.pathname.startsWith(`${STUDIO_ROOT_PATH}/`));
+ } catch {
+ return false;
+ }
+}
diff --git a/ui/packages/app-shell/src/views/studio-design/studioAppEdit.test.ts b/ui/packages/app-shell/src/views/studio-design/studioAppEdit.test.ts
new file mode 100644
index 00000000000..631567a1201
--- /dev/null
+++ b/ui/packages/app-shell/src/views/studio-design/studioAppEdit.test.ts
@@ -0,0 +1,97 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * objectstack#36906 — which app a dashboard or a report opened from a Studio
+ * list opens in (epic #36890 decision 6), and the app addresses it opens.
+ */
+
+import { describe, expect, it } from 'vitest';
+import {
+ appItemPath,
+ appNewReportPath,
+ isStudioAppEditType,
+ menuOpensItem,
+ studioAppCreateSegment,
+ studioAppEditSegment,
+ type StudioAppTarget,
+} from './studioAppEdit.js';
+import { studioBackTarget } from './StudioBackToApp.js';
+
+const one: StudioAppTarget[] = [{ name: 'crm_app', label: 'CRM' }];
+const two: StudioAppTarget[] = [
+ { name: 'sales', label: 'Sales' },
+ { name: 'service', label: 'Service' },
+];
+const page = (app: string) => ({ path: `/apps/${app}/home`, app, label: app });
+
+describe('studioAppEditSegment — decision 6', () => {
+ it('opens only dashboards and reports in an app', () => {
+ expect(isStudioAppEditType('dashboard')).toBe(true);
+ expect(isStudioAppEditType('report')).toBe(true);
+ for (const type of ['view', 'page', 'app', 'object', 'flow', 'reports']) expect(isStudioAppEditType(type)).toBe(false);
+ });
+
+ it('1. the remembered app, when it is one of the package apps (by name, or by the package id)', () => {
+ const base = { packageId: 'crm', type: 'dashboard' as const, name: 'ops' };
+ expect(studioAppEditSegment({ ...base, apps: two, remembered: page('service') })).toBe('service');
+ // The package id is the route key of a one-app package.
+ expect(studioAppEditSegment({ ...base, apps: one, remembered: page('crm') })).toBe('crm');
+ expect(studioAppEditSegment({ ...base, apps: one, remembered: page('crm_app') })).toBe('crm');
+ });
+
+ it('1. the remembered app of another package, when its menu opens the item, at any depth', () => {
+ const base = { packageId: 'crm', apps: one, remembered: page('setup'), type: 'dashboard' as const, name: 'ops' };
+ const menu = [{ id: 'g', type: 'group', label: 'G', children: [{ id: 'd', type: 'dashboard', dashboardName: 'ops' }] }];
+ expect(studioAppEditSegment({ ...base, rememberedMenu: menu })).toBe('setup');
+ // A menu that opens another item, or the report of the same name, does not count.
+ expect(studioAppEditSegment({ ...base, rememberedMenu: [{ id: 'd', type: 'dashboard', dashboardName: 'other' }] })).toBe('crm');
+ expect(studioAppEditSegment({ ...base, rememberedMenu: [{ id: 'r', type: 'report', reportName: 'ops' }] })).toBe('crm');
+ });
+
+ it("2. otherwise the package's first published app, never the remembered app of another package", () => {
+ const base = { packageId: 'crm', type: 'report' as const, name: 'pipeline' };
+ expect(studioAppEditSegment({ ...base, apps: one, remembered: null })).toBe('crm');
+ expect(studioAppEditSegment({ ...base, apps: two, remembered: page('setup') })).toBe('sales');
+ expect(studioAppEditSegment({ ...base, apps: two, remembered: page('setup'), rememberedMenu: undefined })).toBe('sales');
+ });
+
+ it('3. none: no published app, or no package (the generic item page)', () => {
+ expect(studioAppEditSegment({ packageId: 'crm', apps: [], remembered: page('crm'), type: 'dashboard', name: 'ops' })).toBeNull();
+ expect(studioAppEditSegment({ packageId: null, apps: one, remembered: page('crm_app'), type: 'dashboard', name: 'ops' })).toBeNull();
+ expect(studioAppEditSegment({ packageId: 'crm', apps: one, remembered: null, type: 'dashboard', name: '' })).toBeNull();
+ });
+
+ it('a new report opens in the remembered app of the package, else the first, else none; a foreign menu never counts', () => {
+ expect(studioAppCreateSegment({ packageId: 'crm', apps: two, remembered: page('service') })).toBe('service');
+ expect(studioAppCreateSegment({ packageId: 'crm', apps: two, remembered: page('setup') })).toBe('sales');
+ expect(studioAppCreateSegment({ packageId: 'crm', apps: [], remembered: page('crm') })).toBeNull();
+ expect(studioAppCreateSegment({ packageId: null, apps: one, remembered: null })).toBeNull();
+ });
+
+ it('agrees with the back link on the app of the package (the rule they share)', () => {
+ for (const [apps, remembered] of [
+ [one, null],
+ [one, page('crm')],
+ [two, page('service')],
+ [two, page('setup')],
+ ] as const) {
+ const back = studioBackTarget({ remembered, packageId: 'crm', apps, locale: 'en', landingPath: '/home' });
+ const segment = studioAppCreateSegment({ packageId: 'crm', apps, remembered });
+ // The back link returns to the remembered page itself, or to the app's first screen.
+ expect(back.path === remembered?.path || back.path === `/apps/${segment}`).toBe(true);
+ }
+ });
+
+ it('menuOpensItem reads no menu that is not one', () => {
+ expect(menuOpensItem(undefined, 'dashboard', 'ops')).toBe(false);
+ expect(menuOpensItem({ type: 'dashboard', dashboardName: 'ops' }, 'dashboard', 'ops')).toBe(false);
+ });
+});
+
+describe('the app addresses', () => {
+ it('spell the item page and the new-report page, encoded', () => {
+ expect(appItemPath('crm', 'dashboard', 'ops_board')).toBe('/apps/crm/dashboard/ops_board');
+ expect(appItemPath('com.acme.crm', 'report', 'a b')).toBe('/apps/com.acme.crm/report/a%20b');
+ expect(appNewReportPath('crm')).toBe('/apps/crm/reports/new');
+ });
+});
diff --git a/ui/packages/app-shell/src/views/studio-design/studioAppEdit.ts b/ui/packages/app-shell/src/views/studio-design/studioAppEdit.ts
new file mode 100644
index 00000000000..eb8e8b5bd33
--- /dev/null
+++ b/ui/packages/app-shell/src/views/studio-design/studioAppEdit.ts
@@ -0,0 +1,145 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * Where a dashboard or a report that the author opens from a Studio list opens:
+ * the app's own edit state (objectstack#36906, epic #36890), not Studio's
+ * generic item page.
+ *
+ * The app it opens in (decision 6), first match wins ({@link studioAppEditSegment}):
+ *
+ * 1. the app the author came from (`utils/appReturnPage.ts`), when it is one
+ * of the open package's published apps, or when its menu opens this item;
+ * 2. otherwise the package's first published app;
+ * 3. none: the package has no published app, or the item is in no package
+ * (the package-less scope and the cross-package leg). The item then opens
+ * the generic item page (decision 3).
+ *
+ * Rule 1's first half and rule 2 are the rule Studio's 「‹ Back to app」
+ * applies (`studioBackTarget`), so both share {@link rememberedPackageApp} and
+ * {@link packageAppSegment}. An app's segment is the one the console resolves:
+ * the package id when the package ships one app, else the app's name
+ * (ADR-0048 option A, `appAddressSegment`).
+ *
+ * Pure: no React and no router. The reads happen in `StudioMetadataArea`.
+ *
+ * @module
+ */
+
+import type { I18nLabel } from '@objectstack/spec/ui';
+import type { AppReturnPage } from '../../utils/appReturnPage.js';
+import { menuTargets, targetKeyFor, type Menu } from '../../layout/designModeMenuModel.js';
+
+/** A published app of the open package. */
+export interface StudioAppTarget {
+ name: string;
+ label: I18nLabel;
+}
+
+/** The types that open in an app's edit state, not in Studio's generic item page. */
+export const STUDIO_APP_EDIT_TYPES = ['dashboard', 'report'] as const;
+export type StudioAppEditType = (typeof STUDIO_APP_EDIT_TYPES)[number];
+
+/** Whether an item of `type` opens in an app's edit state. */
+export function isStudioAppEditType(type: string): type is StudioAppEditType {
+ return (STUDIO_APP_EDIT_TYPES as readonly string[]).includes(type);
+}
+
+/**
+ * The app segment of one of the package's published apps: the package id when
+ * the package ships one app, else the app's name. With several apps, all of
+ * them share the package id, and that id opens only the first one.
+ */
+export function packageAppSegment(packageId: string, apps: readonly StudioAppTarget[], app: StudioAppTarget): string {
+ return apps.length > 1 ? app.name : packageId;
+}
+
+/**
+ * The published app of the package that the remembered page belongs to, or
+ * `undefined`. The page's record names its app by its route key, which is the
+ * app's name or the package id.
+ */
+export function rememberedPackageApp(
+ remembered: AppReturnPage | null,
+ packageId: string,
+ apps: readonly StudioAppTarget[],
+): StudioAppTarget | undefined {
+ if (!remembered) return undefined;
+ const [first] = apps;
+ return apps.find((a) => a.name === remembered.app) ?? (remembered.app === packageId ? first : undefined);
+}
+
+/** Whether the app `menu` (its `navigation`) opens the item `name` of `type`, at any depth. */
+export function menuOpensItem(menu: unknown, type: StudioAppEditType, name: string): boolean {
+ if (!Array.isArray(menu)) return false;
+ return menuTargets(menu as Menu).has(targetKeyFor(type, name));
+}
+
+/**
+ * The app segment that the item opens in, or `null` when there is none
+ * (rule 3: the generic item page).
+ *
+ * `rememberedMenu` is the `navigation` of the remembered app when that app is
+ * not one of the package's own. It is the app's own read; pass `undefined`
+ * when there is no such app or the read failed.
+ */
+export function studioAppEditSegment({
+ packageId,
+ apps,
+ remembered,
+ rememberedMenu,
+ type,
+ name,
+}: {
+ packageId: string | null;
+ apps: readonly StudioAppTarget[];
+ remembered: AppReturnPage | null;
+ rememberedMenu?: unknown;
+ type: StudioAppEditType;
+ name: string;
+}): string | null {
+ if (packageId === null || !name) return null;
+ const own = rememberedPackageApp(remembered, packageId, apps);
+ if (own) return packageAppSegment(packageId, apps, own);
+ if (remembered && menuOpensItem(rememberedMenu, type, name)) return remembered.app;
+ const [first] = apps;
+ return first ? packageAppSegment(packageId, apps, first) : null;
+}
+
+/**
+ * The app segment that a new report opens in (decision 13), or `null` when
+ * there is none. A new report has no menu entry yet, so this is
+ * {@link studioAppEditSegment} without the menu half of rule 1.
+ */
+export function studioAppCreateSegment({
+ packageId,
+ apps,
+ remembered,
+}: {
+ packageId: string | null;
+ apps: readonly StudioAppTarget[];
+ remembered: AppReturnPage | null;
+}): string | null {
+ if (packageId === null) return null;
+ const app = rememberedPackageApp(remembered, packageId, apps) ?? apps[0];
+ return app ? packageAppSegment(packageId, apps, app) : null;
+}
+
+/**
+ * Whether a create made in a Studio package's area lands on an item that opens
+ * in an app (`StudioAreaAppGate`): a dashboard or a report, in a package. The
+ * create page's own history entry is then replaced by the item, so Back from
+ * the app page lands on the list, not on an empty create page.
+ */
+export function studioCreateLandsInApp(areaPackageId: string | null | undefined, type: string): boolean {
+ return !!areaPackageId && isStudioAppEditType(type);
+}
+
+/** The item's page in the app at `segment`: `/apps//dashboard/` or `/apps//report/`. */
+export function appItemPath(segment: string, type: StudioAppEditType, name: string): string {
+ return `/apps/${encodeURIComponent(segment)}/${type}/${encodeURIComponent(name)}`;
+}
+
+/** The app's new-report page, `/apps//reports/new` (decision 13). */
+export function appNewReportPath(segment: string): string {
+ return `/apps/${encodeURIComponent(segment)}/reports/new`;
+}
diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts
index 98b7563b35f..8624fe09faf 100644
--- a/ui/packages/i18n/src/locales/ar.ts
+++ b/ui/packages/i18n/src/locales/ar.ts
@@ -2005,6 +2005,12 @@ const ar = {
noCategoryAxis: "محور فئات الرسم البياني مطلوب — الرسم البياني المرتبط بكائن لا يخترع محورًا. أعلن أحد التالي:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'العودة إلى Studio',
+ closeLabel: 'إغلاق والعودة إلى قائمة Studio',
+ leaveConfirm: 'هل تريد المغادرة دون حفظ؟ ستفقد التغييرات غير المحفوظة.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4492,6 +4498,8 @@ const ar = {
settings: "إعدادات التقرير",
pendingDraft: "يحتوي هذا التقرير على تغييرات غير منشورة. انشرها أو تجاهلها في الأعلى، ثم احفظ.",
nameTaken: "كل المعرّفات المشتقة من هذا الاسم مستخدمة بالفعل. أعطِ التقرير اسمًا آخر ثم احفظ.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "حُفظ هذا التقرير خارج حزمة التطبيق، لأنه لا يمكن استخدام حزمة تخصيص التطبيق هنا، لذا لا تعرضه قائمة Studio.",
adminOnlyTitle: "يمكن لمسؤولي مساحة العمل فقط إنشاء التقارير",
adminOnly: "التقرير مشترك مع الجميع في مساحة العمل، لذا ينشئه مسؤول.",
designModeOnTitle: "أنهِ تصميم التخطيط أولاً",
diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts
index 526d637a43f..2ca9438f750 100644
--- a/ui/packages/i18n/src/locales/de.ts
+++ b/ui/packages/i18n/src/locales/de.ts
@@ -1773,6 +1773,12 @@ const de = {
noCategoryAxis: "Kategorieachse des Diagramms erforderlich — ein objektgebundenes Diagramm erfindet keine. Deklarieren Sie eine davon:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Zurück zu Studio',
+ closeLabel: 'Schließen und zur Studio-Liste zurückkehren',
+ leaveConfirm: 'Ohne Speichern verlassen? Nicht gespeicherte Änderungen gehen verloren.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4134,6 +4140,8 @@ const de = {
settings: "Berichtseinstellungen",
pendingDraft: "Dieser Bericht hat unveröffentlichte Änderungen. Veröffentlichen oder verwerfen Sie sie oben und speichern Sie dann.",
nameTaken: "Alle aus diesem Namen gebildeten Kennungen sind bereits vergeben. Geben Sie dem Bericht einen anderen Namen und speichern Sie dann erneut.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "Dieser Bericht wurde außerhalb des App-Pakets gespeichert, weil das Anpassungspaket der App hier nicht verwendet werden kann. Die Studio-Liste zeigt ihn daher nicht.",
adminOnlyTitle: "Nur Workspace-Administratoren können Berichte erstellen",
adminOnly: "Ein Bericht gilt für alle im Workspace, daher erstellt ihn ein Administrator.",
designModeOnTitle: "Schließen Sie zuerst die Layoutgestaltung ab",
diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts
index a55b72512b1..43b91407374 100644
--- a/ui/packages/i18n/src/locales/en.ts
+++ b/ui/packages/i18n/src/locales/en.ts
@@ -2220,6 +2220,8 @@ const en = {
settings: 'Report settings',
pendingDraft: 'This report has unpublished changes. Publish or discard them above, then save.',
nameTaken: 'Every name made from this one is already taken. Give the report another name, then save.',
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: 'This report was saved outside the app’s package, because the app’s customization package cannot be used here, so the Studio list does not show it.',
adminOnlyTitle: 'Only workspace admins can build reports',
adminOnly: 'A report is shared with everyone in the workspace, so an admin builds it.',
designModeOnTitle: 'Finish designing the layout first',
@@ -2274,6 +2276,12 @@ const en = {
redo: 'Redo',
canvasMinimap: 'Canvas minimap',
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Back to Studio',
+ closeLabel: 'Close and go back to the Studio list',
+ leaveConfirm: 'Leave without saving? Your unsaved changes will be lost.',
+ },
dashboard: {
total: 'Total',
noDataSourceFor: 'No data source available for',
diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts
index b4b7f69770b..318e33e415f 100644
--- a/ui/packages/i18n/src/locales/es.ts
+++ b/ui/packages/i18n/src/locales/es.ts
@@ -1833,6 +1833,12 @@ const es = {
noCategoryAxis: "Se requiere el eje de categorías del gráfico — un gráfico vinculado a un objeto no lo inventa. Declare uno de:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Volver a Studio',
+ closeLabel: 'Cerrar y volver a la lista de Studio',
+ leaveConfirm: '¿Salir sin guardar? Se perderán los cambios no guardados.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4224,6 +4230,8 @@ const es = {
settings: "Configuración del informe",
pendingDraft: "Este informe tiene cambios sin publicar. Publícalos o descártalos arriba y luego guarda.",
nameTaken: "Todos los identificadores derivados de este nombre ya están en uso. Ponle otro nombre al informe y guarda.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "Este informe se guardó fuera del paquete de la app, porque aquí no se puede usar el paquete de personalización de la app, así que la lista de Studio no lo muestra.",
adminOnlyTitle: "Solo los administradores del espacio de trabajo pueden crear informes",
adminOnly: "Un informe se comparte con todo el espacio de trabajo, así que lo crea un administrador.",
designModeOnTitle: "Termina primero de diseñar la disposición",
diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts
index 8db238ee123..d40a2fa34cc 100644
--- a/ui/packages/i18n/src/locales/fr.ts
+++ b/ui/packages/i18n/src/locales/fr.ts
@@ -1829,6 +1829,12 @@ const fr = {
noCategoryAxis: "Axe de catégories requis — un graphique lié à un objet n’en invente pas. Déclarez l’un des suivants :",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Retour à Studio',
+ closeLabel: 'Fermer et revenir à la liste de Studio',
+ leaveConfirm: 'Quitter sans enregistrer ? Les modifications non enregistrées seront perdues.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4220,6 +4226,8 @@ const fr = {
settings: "Paramètres du rapport",
pendingDraft: "Ce rapport a des modifications non publiées. Publiez-les ou supprimez-les ci-dessus, puis enregistrez.",
nameTaken: "Tous les identifiants dérivés de ce nom sont déjà pris. Donnez un autre nom au rapport, puis enregistrez.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "Ce rapport a été enregistré hors du package de l’application, car le package de personnalisation de l’application ne peut pas être utilisé ici. La liste Studio ne l’affiche donc pas.",
adminOnlyTitle: "Seuls les administrateurs de l’espace de travail peuvent créer des rapports",
adminOnly: "Un rapport est partagé avec tout l’espace de travail ; c’est donc un administrateur qui le crée.",
designModeOnTitle: "Terminez d’abord la conception de la mise en page",
diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts
index 7900bf77b44..328291a9da6 100644
--- a/ui/packages/i18n/src/locales/ja.ts
+++ b/ui/packages/i18n/src/locales/ja.ts
@@ -1773,6 +1773,12 @@ const ja = {
noCategoryAxis: "チャートのカテゴリ軸が必要です — オブジェクト連携チャートは軸を推測しません。次のいずれかを宣言してください:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Studio に戻る',
+ closeLabel: '閉じて Studio の一覧に戻る',
+ leaveConfirm: '保存せずに移動しますか?保存していない変更は失われます。',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4136,6 +4142,8 @@ const ja = {
settings: "レポート設定",
pendingDraft: "このレポートには未公開の変更があります。上で公開または破棄してから保存してください。",
nameTaken: "この名前から作れる識別子はすべて使用済みです。レポートに別の名前を付けてから保存してください。",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "アプリのカスタマイズパッケージをここでは使用できないため、このレポートはアプリのパッケージの外に保存されました。そのため Studio の一覧には表示されません。",
adminOnlyTitle: "レポートを作成できるのはワークスペース管理者のみです",
adminOnly: "レポートはワークスペースの全員に共有されるため、管理者が作成します。",
designModeOnTitle: "先にレイアウトのデザインを終えてください",
diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts
index 854f6c1bbdb..f67b5e3e2af 100644
--- a/ui/packages/i18n/src/locales/ko.ts
+++ b/ui/packages/i18n/src/locales/ko.ts
@@ -1773,6 +1773,12 @@ const ko = {
noCategoryAxis: "차트 범주 축이 필요합니다 — 객체 바인딩 차트는 축을 임의로 만들지 않습니다. 다음 중 하나를 선언하세요:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Studio로 돌아가기',
+ closeLabel: '닫고 Studio 목록으로 돌아가기',
+ leaveConfirm: '저장하지 않고 나가시겠습니까? 저장하지 않은 변경 사항이 사라집니다.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4133,6 +4139,8 @@ const ko = {
settings: "보고서 설정",
pendingDraft: "이 보고서에 게시되지 않은 변경 사항이 있습니다. 위에서 게시하거나 버린 후 저장하세요.",
nameTaken: "이 이름으로 만들 수 있는 식별자가 모두 사용 중입니다. 보고서 이름을 바꾼 뒤 저장하세요.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "여기서는 앱의 사용자 지정 패키지를 사용할 수 없어 이 보고서는 앱 패키지 밖에 저장되었습니다. 그래서 Studio 목록에 표시되지 않습니다.",
adminOnlyTitle: "워크스페이스 관리자만 보고서를 만들 수 있습니다",
adminOnly: "보고서는 워크스페이스의 모든 사람에게 공유되므로 관리자가 만듭니다.",
designModeOnTitle: "먼저 레이아웃 디자인을 마치세요",
diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts
index 2237161b73f..dda11d1f663 100644
--- a/ui/packages/i18n/src/locales/pt-BR.ts
+++ b/ui/packages/i18n/src/locales/pt-BR.ts
@@ -1828,6 +1828,12 @@ const pt = {
noCategoryAxis: "Eixo de categorias do gráfico obrigatório — um gráfico vinculado a um objeto não o inventa. Declare um destes:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Voltar ao Studio',
+ closeLabel: 'Fechar e voltar à lista do Studio',
+ leaveConfirm: 'Sair sem salvar? As alterações não salvas serão perdidas.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4219,6 +4225,8 @@ const pt = {
settings: "Configurações do relatório",
pendingDraft: "Este relatório tem alterações não publicadas. Publique ou descarte-as acima e depois salve.",
nameTaken: "Todos os identificadores gerados a partir deste nome já estão em uso. Dê outro nome ao relatório e salve.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "Este relatório foi salvo fora do pacote do app, porque o pacote de personalização do app não pode ser usado aqui, então a lista do Studio não o mostra.",
adminOnlyTitle: "Somente administradores do espaço de trabalho podem criar relatórios",
adminOnly: "Um relatório é compartilhado com todo o espaço de trabalho, por isso um administrador o cria.",
designModeOnTitle: "Termine primeiro de projetar o layout",
diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts
index 973cd7afb5a..0cc3aa33d27 100644
--- a/ui/packages/i18n/src/locales/ru.ts
+++ b/ui/packages/i18n/src/locales/ru.ts
@@ -1893,6 +1893,12 @@ const ru = {
noCategoryAxis: "Требуется ось категорий диаграммы — диаграмма, привязанная к объекту, не придумывает её. Объявите одно из:",
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: 'Вернуться в Studio',
+ closeLabel: 'Закрыть и вернуться к списку Studio',
+ leaveConfirm: 'Уйти без сохранения? Несохранённые изменения будут потеряны.',
+ },
dashboard: {
// objectui#7063 — the DEFAULT empty state every dashboard widget renders
// when its query SUCCEEDED and returned nothing. It replaced the terse
@@ -4323,6 +4329,8 @@ const ru = {
settings: "Настройки отчёта",
pendingDraft: "В этом отчёте есть неопубликованные изменения. Опубликуйте или отмените их выше, затем сохраните.",
nameTaken: "Все идентификаторы, полученные из этого имени, уже заняты. Дайте отчёту другое имя и сохраните.",
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: "Этот отчёт сохранён вне пакета приложения, потому что пакет настроек приложения здесь использовать нельзя, поэтому список Studio его не показывает.",
adminOnlyTitle: "Создавать отчёты могут только администраторы рабочего пространства",
adminOnly: "Отчёт виден всем в рабочем пространстве, поэтому его создаёт администратор.",
designModeOnTitle: "Сначала завершите дизайн макета",
diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts
index 52bffa25ffa..ee8b7d8054e 100644
--- a/ui/packages/i18n/src/locales/zh-Hans.ts
+++ b/ui/packages/i18n/src/locales/zh-Hans.ts
@@ -1854,6 +1854,8 @@ const zh = {
settings: '报表设置',
pendingDraft: '这张报表有一份还没发布的修改。先在上方发布或丢弃它,再保存。',
nameTaken: '由这个名称生成的标识都已被占用。请给报表换个名称再保存。',
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: '这份报表没有存进应用的包:此处无法使用应用的定制包,所以 Studio 列表里看不到它。',
adminOnlyTitle: '只有系统管理员能搭建报表',
adminOnly: '报表对工作区里所有人生效,所以由系统管理员搭建。',
designModeOnTitle: '请先完成布局设计',
@@ -1903,6 +1905,12 @@ const zh = {
},
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: '返回 Studio',
+ closeLabel: '关闭并返回 Studio 列表',
+ leaveConfirm: '不保存就离开吗?未保存的修改将会丢失。',
+ },
dashboard: {
total: '总计',
noDataSourceFor: '没有可用的数据源:',
diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts
index e4a7ead6eec..3be944aa25c 100644
--- a/ui/packages/i18n/src/locales/zh-Hant.ts
+++ b/ui/packages/i18n/src/locales/zh-Hant.ts
@@ -1854,6 +1854,8 @@ const zhHant = {
settings: '報表設定',
pendingDraft: '這張報表有一份還沒釋出的修改。先在上方釋出或丟棄它,再儲存。',
nameTaken: '由這個名稱生成的標識都已被佔用。請給報表換個名稱再儲存。',
+ // objectstack#36906 — a report made from Studio's report list that could not be saved in the app's package.
+ savedOutsideApp: '這份報表沒有存進應用的包:此處無法使用應用的定製包,所以 Studio 列表裡看不到它。',
adminOnlyTitle: '只有系統管理員能搭建報表',
adminOnly: '報表對工作區裡所有人生效,所以由系統管理員搭建。',
designModeOnTitle: '請先完成佈局設計',
@@ -1903,6 +1905,12 @@ const zhHant = {
},
},
},
+ // objectstack#36906 — the × of an app page opened from a Studio list.
+ studioReturn: {
+ close: '返回 Studio',
+ closeLabel: '關閉並返回 Studio 列表',
+ leaveConfirm: '不儲存就離開嗎?未儲存的修改將會丟失。',
+ },
dashboard: {
total: '總計',
noDataSourceFor: '沒有可用的資料來源:',