diff --git a/.changeset/36907-studio-new-dashboard-design-mode.md b/.changeset/36907-studio-new-dashboard-design-mode.md
new file mode 100644
index 00000000000..dc521f2aa18
--- /dev/null
+++ b/.changeset/36907-studio-new-dashboard-design-mode.md
@@ -0,0 +1,19 @@
+---
+'@object-ui/app-shell': patch
+'@object-ui/i18n': patch
+---
+
+feat(studio): New on a Studio dashboard list opens the app's design mode, ready to add a dashboard to its menu
+
+Clause-②: no
+Metadata-protocol: none
+
+Studio redesign (epic #36890): a new dashboard is made where it hangs in an app's menu, never outside every menu.
+
+- **New on a Studio dashboard list** opens the package's app with Design layout already on and the 「Add menu item」 picker open on its Dashboards, 「New dashboard…」 first. The app is picked the same way as for opening a dashboard: the app you came from when it is one of the package's, otherwise the package's first app. For an installed app, what you save there goes to its customization package, as before. For a customization package (`.custom`) that has no app of its own, the base package's app opens.
+- **After Create** the dashboard is in the menu where the picker put it, at the end of the menu's top level, and opens for editing, as a dashboard made in Design layout always has. Its × goes back to the Studio list you left. Closing the picker instead leaves you in Design layout, with nothing added.
+- **When there is no New.** On a phone-width window the dashboard list offers no New: Design layout is never on there. An empty list there says a dashboard is made in an app's design mode on a wider screen. A package with no app to open offers no New either, and the list says why. While the package's apps are still being read, an empty list shows no hint yet. It never says a writable package is read-only.
+- **Nothing enters Design layout by itself.** The way in is a one-time instruction carried by the click, never the address: a reload, a shared link or Back does not turn it on. If a dashboard's or a report's own editor is open at that moment, Design layout refuses with the usual message and nothing else happens.
+- **The report list is unchanged:** its New still opens the app's New report page.
+- **A note on an earlier entry,** customization packages' dashboards and reports opening in their base package's app: the app you came from also counts when it is not one of the base's apps, as long as its menu opens that dashboard or report. That is the same rule as for every package.
+- New Studio strings `engine.list.dashboardNewNoApp` and `engine.list.dashboardNewWiderScreen`, in English and Chinese.
diff --git a/ui/packages/app-shell/src/layout/ConsoleLayout.tsx b/ui/packages/app-shell/src/layout/ConsoleLayout.tsx
index 2ae1531489f..419d0563f33 100644
--- a/ui/packages/app-shell/src/layout/ConsoleLayout.tsx
+++ b/ui/packages/app-shell/src/layout/ConsoleLayout.tsx
@@ -39,6 +39,7 @@ import { useHomePath } from '../hooks/useHomePath.js';
import { AppHeader } from './AppHeader.js';
import { DesignModeProvider, useDesignModeController } from './designMode.js';
import { DesignModeBar } from './DesignModeBar.js';
+import { useDesignModeArrival } from './useDesignModeArrival.js';
import { useResponsiveSidebar } from '../hooks/useResponsiveSidebar.js';
import { usePhoneNavDrawerHistory } from './usePhoneNavDrawerHistory.js';
import { usePhoneViewport } from '../hooks/usePhoneViewport.js';
@@ -234,6 +235,10 @@ export function ConsoleLayout({
// objectstack#36362 — the app's design mode, held here so it stays on from
// page to page of the app; never on a phone, which has no 「Design layout」.
const designMode = useDesignModeController({ appName: activeAppName, appBasePath, enabled: !phone });
+ // objectstack#36907 — a Studio dashboard list's 「New」 arrives with the
+ // mode asked to enter and the 「Add menu item」 picker on its dashboards;
+ // read once and cleared, so Back or a reload enters nothing.
+ useDesignModeArrival(designMode, !phone);
// objectstack#30043 — the page in view, handed to the dock as its
// `context.surface` (cloud#1610's shape): the object of a list, the object
// and record id of a record page, the dashboard, report or page. Read off the
diff --git a/ui/packages/app-shell/src/layout/DesignModeMenu.tsx b/ui/packages/app-shell/src/layout/DesignModeMenu.tsx
index 8297d0cae8f..9a802bc13ab 100644
--- a/ui/packages/app-shell/src/layout/DesignModeMenu.tsx
+++ b/ui/packages/app-shell/src/layout/DesignModeMenu.tsx
@@ -53,6 +53,13 @@
* maintainer's ruling to keep report editing its own entry, as Twenty does):
* a new report is made from the reports index, then linked here.
*
+ * The mode may arrive asking this menu to open first (objectstack#36907, a
+ * Studio dashboard list's 「New」, `useDesignModeOpening`): the picker then
+ * opens at once, on its 「Dashboards」, for an entry at the end of the top
+ * level, as that level's 「Add menu item」 would. A dashboard created from it
+ * opens with the Studio list it came from (`?studio=`), so its × goes back
+ * there; closing the picker drops that, and later adds are plain.
+ *
* Every edit is staged with the mode (`useDesignModeChange`), under one key
* for the app's menu: the mode's 「Save」 writes it (`saveAppMenu`), its
* 「Cancel」 drops it. The menu drawn is the staged one, so it survives a page
@@ -144,7 +151,7 @@ import {
fetchListedPackageManifests,
listedCustomizationPairOf,
} from '../views/studio-design/packages-io.js';
-import { useDesignModeChange } from './designMode.js';
+import { useDesignModeChange, useDesignModeOpening } from './designMode.js';
import {
MENU_TARGET_KINDS,
canMoveBy,
@@ -181,6 +188,7 @@ import {
} from './designModeMenuSave.js';
import { freeItemName, isNewMenuItemKind, saveAppMenuWithNewItem, type NewMenuItemKind } from './designModeMenuCreate.js';
import { dashboardEditArrival } from './designModeArrival.js';
+import { withStudioReturn } from '../views/studio-design/studioAddress.js';
/**
* The group label's icon-mode hiding, as the sidebar's own labels declare it
@@ -452,10 +460,32 @@ export default function DesignModeMenu({ app, basePath, resolveTargetLabel, reso
const startAdd = (at: AddAt) => {
setAddAt({ parentId: at.parentId, index: Math.min(at.index, ownEndOf(menu, at.parentId)) });
};
+
+ // objectstack#36907 — what the mode arrived asking to open: the picker on
+ // its 「Dashboards」, at the end of the top level, taken once. `arrivedFrom`
+ // is the Studio list it came from, kept while that picker is open.
+ const arrivalOpening = useDesignModeOpening();
+ const [pickerKind, setPickerKind] = React.useState(null);
+ const [arrivedFrom, setArrivedFrom] = React.useState(null);
+ const takeArrival = arrivalOpening.take;
+ React.useEffect(() => {
+ if (!arrivalOpening.opening) return;
+ const taken = takeArrival();
+ if (!taken) return;
+ startAdd({ parentId: null, index: menu.length });
+ setPickerKind(taken.column);
+ setArrivedFrom(taken.studioReturn);
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- answered once per opening
+ }, [arrivalOpening.opening, takeArrival]);
+ const closePicker = () => {
+ setAddAt(null);
+ setPickerKind(null);
+ setArrivedFrom(null);
+ };
const pick = (entry: MenuEntry) => {
if (!addAt) return;
update(insertEntry(menu, addAt.parentId, addAt.index, entry));
- setAddAt(null);
+ closePicker();
};
// objectstack#36364 — a new dashboard, in the held place: created, put in
@@ -498,8 +528,9 @@ export default function DesignModeMenu({ app, basePath, resolveTargetLabel, reso
),
);
if (!saved) return false;
- setAddAt(null);
- navigate(resolveHref(entry as unknown as NavigationItem, basePath).href, { state: dashboardEditArrival(name) });
+ const href = resolveHref(entry as unknown as NavigationItem, basePath).href;
+ closePicker();
+ navigate(arrivedFrom ? withStudioReturn(href, arrivedFrom) : href, { state: dashboardEditArrival(name) });
return true;
};
@@ -622,7 +653,8 @@ export default function DesignModeMenu({ app, basePath, resolveTargetLabel, reso
setAddAt(null)}
+ initialKind={pickerKind}
+ onClose={closePicker}
onPick={(kind, name, link) => pick(entryFor(kind, name, newEntryId([...menu, ...(storedMenu ?? [])]), link))}
onCreate={createItem}
language={language}
@@ -915,6 +947,7 @@ function useTargetRows(packageId: string, language: string): { rows: TargetRow[]
function MenuItemPicker({
packageId,
inMenu,
+ initialKind = null,
onClose,
onPick,
onCreate,
@@ -922,6 +955,8 @@ function MenuItemPicker({
}: {
packageId: string;
inMenu: ReadonlySet;
+ /** The kind the picker opens on (objectstack#36907); `null`: the list of kinds. */
+ initialKind?: MenuTargetKind | null;
onClose: () => void;
onPick: (kind: MenuTargetKind, name: string, link?: { label: string; url: string }) => void;
/** Create a new `kind` named `label`; `taken` is every name of that kind the picker lists. */
@@ -930,7 +965,7 @@ function MenuItemPicker({
}) {
const { t } = useObjectTranslation();
const { rows, loading } = useTargetRows(packageId, language);
- const [kind, setKind] = React.useState(null);
+ const [kind, setKind] = React.useState(initialKind);
const [query, setQuery] = React.useState('');
const [link, setLink] = React.useState({ label: '', url: '' });
/** The kind being named for creation (objectstack#36364), `null` while picking. */
diff --git a/ui/packages/app-shell/src/layout/__tests__/DesignModeMenu-36363.test.tsx b/ui/packages/app-shell/src/layout/__tests__/DesignModeMenu-36363.test.tsx
index f8bda51a23e..775625864d6 100644
--- a/ui/packages/app-shell/src/layout/__tests__/DesignModeMenu-36363.test.tsx
+++ b/ui/packages/app-shell/src/layout/__tests__/DesignModeMenu-36363.test.tsx
@@ -16,7 +16,7 @@ import '@testing-library/jest-dom/vitest';
import * as React from 'react';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { act, cleanup, fireEvent, render, screen, within } from '@testing-library/react';
-import { MemoryRouter, useLocation } from 'react-router-dom';
+import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom';
import { SidebarProvider } from '@object-ui/components';
import { NavigationRenderer } from '@object-ui/layout';
import type { NavigationItem } from '@object-ui/types';
@@ -140,7 +140,9 @@ vi.mock('../../views/studio-design/packages-io', async (importOriginal) => ({
}));
vi.mock('../../utils/getIcon', () => ({ getIcon: () => () => null }));
-import { DesignModeProvider, useDesignMode, useDesignModeController } from '../designMode';
+import { DesignModeProvider, useDesignMode, useDesignModeController, useHoldDesignModeOut } from '../designMode';
+import { useDesignModeArrival } from '../useDesignModeArrival';
+import { designModeAddDashboardArrival } from '../designModeArrival';
import { DesignModeBar } from '../DesignModeBar';
import DesignModeMenu from '../DesignModeMenu';
import { closestCenter, type CollisionDetection } from '@dnd-kit/core';
@@ -1308,3 +1310,229 @@ describe('the design-mode menu save and drag, hardened (objectstack#36538)', ()
});
});
});
+
+/*
+ * objectstack#36907 — a Studio dashboard list's 「New」 arrives in the app with
+ * `designModeAddDashboardArrival` in the navigation state. The shell
+ * (`useDesignModeArrival`, as `ConsoleLayout` calls it) reads it once, clears
+ * it from the history entry, and enters the mode with the picker open on its
+ * 「Dashboards」; where `enter` refuses, nothing more happens and the mode
+ * says why; on a phone, nothing at all.
+ */
+const STUDIO_LIST = '/studio/com.acme.crm/metadata/dashboard?package=com.acme.crm';
+
+/** The shell's hold on the mode, as `ConsoleLayout` wires it, the arrival read included. */
+function ArrivalHarness({ enabled = true, editorOpen = false }: { enabled?: boolean; editorOpen?: boolean }) {
+ const mode = useDesignModeController({ appName: 'crm', appBasePath: '/apps/crm', enabled });
+ useDesignModeArrival(mode, enabled);
+ return (
+
+ {mode.active && }
+ {editorOpen && }
+
+ {mode.active && (
+ (target.kind === 'object' ? OBJECT_LABELS[target.objectName] : undefined)}
+ />
+ )}
+
+
+
+ );
+}
+
+/** A dashboard's or a report's own editor, open: it holds the mode out (objectstack#36692). */
+function OpenEditor() {
+ useHoldDesignModeOut(true);
+ return null;
+}
+
+/** The address and the navigation state on screen, as `JSON`. */
+function Here() {
+ const { pathname, search, state } = useLocation();
+ return ;
+}
+
+/** A second arrival into the app on screen: Studio's New, taken again; and the browser's Back. */
+function ArriveAgain() {
+ const navigate = useNavigate();
+ return (
+ <>
+
+
+ >
+ );
+}
+
+const here = () => {
+ const el = screen.getByTestId('here');
+ return { at: el.getAttribute('data-at'), state: JSON.parse(el.getAttribute('data-state') ?? 'null') };
+};
+
+function arrive(props: { enabled?: boolean; editorOpen?: boolean } = {}, entry: { pathname: string; state: unknown } = {
+ pathname: '/apps/crm',
+ state: designModeAddDashboardArrival(STUDIO_LIST),
+}) {
+ return render(
+
+
+
+ ,
+ );
+}
+
+describe("the arrival from a Studio dashboard list's New (objectstack#36907)", () => {
+ it('enters the mode with the picker open on 「Dashboards」, 「New dashboard…」 first, for an entry at the end of the top level', async () => {
+ listed.dashboard = [{ name: 'revenue', label: 'Revenue' }];
+ try {
+ arrive();
+ await flush();
+ expect(screen.getByTestId('design-mode-bar')).toBeInTheDocument();
+ const picker = await screen.findByTestId('design-menu-picker');
+ const rows = within(within(picker).getByTestId('design-menu-picker-rows')).getAllByRole('button').map((b) => b.textContent);
+ expect(rows).toEqual(['New dashboard…', 'Revenue']);
+ expect(order()).toEqual(['home', ['sales', ['leads', 'accounts']], ['insights', []], '…']);
+ expect(toastError).not.toHaveBeenCalled();
+ } finally {
+ listed.dashboard = [];
+ }
+ });
+
+ it('is read once: the history entry is cleared, so a reload of it, or Back to it, enters nothing', async () => {
+ arrive();
+ await flush();
+ expect(here()).toEqual({ at: '/apps/crm', state: null });
+ expect(screen.getByTestId('design-mode-bar')).toBeInTheDocument();
+ cleanup();
+
+ // The same entry, reloaded: what the history holds now carries no arrival.
+ arrive({}, { pathname: '/apps/crm', state: null });
+ await flush();
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ });
+
+ it('「Create」 in it: the dashboard hangs at the end of the top level and opens for editing, with × back to the Studio list', async () => {
+ arrive();
+ await flush();
+ const picker = await screen.findByTestId('design-menu-picker');
+ fireEvent.click(within(picker).getByTestId('design-menu-picker-new-dashboard'));
+ const naming = await screen.findByTestId('design-menu-new-dashboard');
+ fireEvent.change(within(naming).getByTestId('design-menu-new-name'), { target: { value: 'Payment analysis' } });
+ fireEvent.click(within(naming).getByTestId('design-menu-new-create'));
+ await flush();
+ await flush();
+ await flush();
+
+ expect(written.map(([verb, type, name]) => `${verb} ${type} ${name}`)).toEqual([
+ 'save dashboard payment_analysis',
+ 'publish dashboard payment_analysis',
+ 'save app crm',
+ 'publish app crm',
+ ]);
+ const navigation = (written[2][3] as { navigation: Array<{ id: string }> }).navigation;
+ expect(navigation.at(-1)).toEqual({ id: 'nav_item_1', type: 'dashboard', dashboardName: 'payment_analysis' });
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ const landed = here();
+ expect(landed.at!.split('?')[0]).toBe('/apps/crm/dashboard/payment_analysis');
+ expect(new URLSearchParams(landed.at!.split('?')[1]).get('studio')).toBe(STUDIO_LIST);
+ expect(landed.state).toEqual({ designModeNewDashboard: 'payment_analysis' });
+ });
+
+ it("closing that picker drops the Studio list: a dashboard made from another 「Add menu item」 opens without it", async () => {
+ arrive();
+ await flush();
+ fireEvent.keyDown(await screen.findByTestId('design-menu-picker'), { key: 'Escape' });
+ await flush();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ const picker = await openDashboards();
+ fireEvent.click(within(picker).getByTestId('design-menu-picker-new-dashboard'));
+ const naming = await screen.findByTestId('design-menu-new-dashboard');
+ fireEvent.change(within(naming).getByTestId('design-menu-new-name'), { target: { value: 'Payment analysis' } });
+ fireEvent.click(within(naming).getByTestId('design-menu-new-create'));
+ await flush();
+ await flush();
+ await flush();
+ expect(here().at).toBe('/apps/crm/dashboard/payment_analysis');
+ });
+
+ it('where an editor of its own holds the mode out, entering refuses and says why; the arrival does nothing more and is cleared', async () => {
+ render(
+
+
+
+ ,
+ );
+ fireEvent.click(screen.getByText('arrive again'));
+ await flush();
+ expect(toastError).toHaveBeenCalledWith('Save or cancel your dashboard or report changes before designing the layout.');
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ expect(here()).toEqual({ at: '/apps/crm', state: null });
+ expect(written).toEqual([]);
+ });
+
+ it('the same refusal when the editor opens in the very commit the arrival lands in', async () => {
+ arrive({ editorOpen: true });
+ await flush();
+ expect(toastError).toHaveBeenCalledWith('Save or cancel your dashboard or report changes before designing the layout.');
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ expect(here()).toEqual({ at: '/apps/crm', state: null });
+ });
+
+ it('on a phone the mode is never on: the arrival enters nothing, says nothing, and is cleared', async () => {
+ arrive({ enabled: false });
+ await flush();
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ expect(toastError).not.toHaveBeenCalled();
+ expect(here()).toEqual({ at: '/apps/crm', state: null });
+ });
+
+ it('the arrival entry is replaced, not stacked: Back from it goes to the page before, and enters nothing', async () => {
+ render(
+
+
+
+ ,
+ );
+ await flush();
+ expect(screen.getByTestId('design-mode-bar')).toBeInTheDocument();
+ fireEvent.click(screen.getByTestId('design-mode-cancel'));
+ fireEvent.click(screen.getByText('browser back'));
+ await flush();
+ expect(here()).toEqual({ at: '/apps/crm/home', state: null });
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ });
+
+ it('an arrival read on a phone holds nothing: the window widening later opens no mode', async () => {
+ const { rerender } = arrive({ enabled: false });
+ await flush();
+ rerender(
+
+
+
+ ,
+ );
+ await flush();
+ expect(screen.queryByTestId('design-mode-bar')).toBeNull();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ });
+
+ it('CONTROL — the menu door enters the mode with no picker open', async () => {
+ start();
+ await flush();
+ expect(screen.getByTestId('design-mode-bar')).toBeInTheDocument();
+ expect(screen.queryByTestId('design-menu-picker')).toBeNull();
+ });
+});
diff --git a/ui/packages/app-shell/src/layout/designMode.tsx b/ui/packages/app-shell/src/layout/designMode.tsx
index 3ef4f48bc9f..3b1c6e15752 100644
--- a/ui/packages/app-shell/src/layout/designMode.tsx
+++ b/ui/packages/app-shell/src/layout/designMode.tsx
@@ -15,7 +15,9 @@
* page to page of that app, and goes off when the app changes. It is never on
* a phone, which draws no 「Design layout」.
*
- * It holds the changes made under it, and nothing else. Each change is staged
+ * It holds the changes made under it, and nothing else but one thing: the
+ * surface an arrival asked to open first ({@link DesignModeOpening},
+ * objectstack#36907), held until that surface takes it. Each change is staged
* under a key by the surface that makes it ({@link useDesignModeChange}): the
* menu editor, the page header's pinned actions, a record page's tabs (its
* tab row is their editor while the mode is on, objectstack#36737, as Twenty
@@ -72,7 +74,11 @@
* (installed) package's app enters too, and what the mode saves goes to that
* package's customization package, as Studio's edits do, except where the
* customization door is walled off for the caller. The mode has no address:
- * no URL enters it. Each
+ * no URL enters it. A Studio dashboard list's 「New」 enters it by a one-time
+ * arrival in the navigation state instead (`useDesignModeArrival`,
+ * objectstack#36907), which asks {@link DesignModeValue.enterOpening}: the
+ * same entry, refused the same way, with the 「Add menu item」 picker opened
+ * on its dashboards once the menu's editor is drawn. Each
* change's `commit` is a write the server judges again.
*
* @module
@@ -93,6 +99,17 @@ type StagedChanges = ReadonlyMap>;
const NO_CHANGES: StagedChanges = new Map();
+/**
+ * What an arrival asks the mode to open first (objectstack#36907): the
+ * 「Add menu item」 picker, on its dashboards, at the end of the menu's top
+ * level. `studioReturn` is the Studio list the arrival came from, which the
+ * dashboard created there goes back to (`?studio=`), or `null`.
+ */
+export interface DesignModeOpening {
+ readonly column: 'dashboard';
+ readonly studioReturn: string | null;
+}
+
/** The mode as the shell holds it, for the app it is on. */
export interface DesignModeValue {
/** On, for the app on screen. */
@@ -106,6 +123,12 @@ export interface DesignModeValue {
* while a dashboard or report editor holds the mode out.
*/
readonly enter: () => boolean;
+ /**
+ * {@link DesignModeValue.enter}, then hold `opening` for the surface that
+ * opens it ({@link useDesignModeOpening}); `false`, nothing held and the
+ * reason said, where `enter` refuses.
+ */
+ readonly enterOpening: (opening: DesignModeOpening) => boolean;
/** Drop every staged change and leave the mode. */
readonly cancel: () => void;
/** Commit every staged change, then leave the mode; `false` when one failed. */
@@ -114,6 +137,10 @@ export interface DesignModeValue {
interface DesignModeStore extends DesignModeValue {
readonly changes: StagedChanges;
+ /** What an arrival asked to open first, until that surface takes it. */
+ readonly opening: DesignModeOpening | null;
+ /** Take {@link DesignModeStore.opening}: it is answered once. */
+ readonly takeOpening: () => DesignModeOpening | null;
readonly stage: (key: string, change: DesignModeChange) => void;
readonly unstage: (key: string) => void;
/** Save every staged change with `change` in `key`'s place; `false` when one failed. */
@@ -128,9 +155,11 @@ interface HeldMode {
/** The app the mode was entered in; `null` while the mode is off. */
readonly app: string | null;
readonly changes: StagedChanges;
+ /** What an arrival asked to open first, not yet taken. */
+ readonly opening: DesignModeOpening | null;
}
-const OFF: HeldMode = { app: null, changes: NO_CHANGES };
+const OFF: HeldMode = { app: null, changes: NO_CHANGES, opening: null };
/**
* Whether `url` is a page of the app at `appBasePath` (`/apps/SEGMENT`), read
@@ -160,7 +189,10 @@ export function useDesignModeController({
const [held, setHeld] = React.useState(OFF);
const [saving, setSaving] = React.useState(false);
/** How many editors of their own hold the mode out. */
- const [heldOut, setHeldOut] = React.useState(0);
+ // Counted in a ref, not state: an editor that opens in the same commit as
+ // an arrival asks to enter (objectstack#36907) holds the mode out before
+ // that entry is judged.
+ const heldOut = React.useRef(0);
// Another app: the mode and what it held were the previous app's.
if (held.app !== null && held.app !== appName) setHeld(OFF);
@@ -168,6 +200,7 @@ export function useDesignModeController({
const on = held.app !== null && held.app === appName;
const active = on && enabled;
const changes = on ? held.changes : NO_CHANGES;
+ const opening = active ? held.opening : null;
const dirty = changes.size > 0;
const heldRef = React.useRef(held);
@@ -175,26 +208,43 @@ export function useDesignModeController({
heldRef.current = held;
});
- const enter = React.useCallback((): boolean => {
- if (heldOut > 0) {
- toast.error(
- t('designMode.editorOpen', {
- defaultValue: 'Save or cancel your dashboard or report changes before designing the layout.',
- }),
- );
- return false;
- }
- setHeld((prev) => (prev.app === appName ? prev : { app: appName, changes: NO_CHANGES }));
- return true;
- }, [appName, heldOut, t]);
+ const enterWith = React.useCallback(
+ (asked: DesignModeOpening | null): boolean => {
+ if (heldOut.current > 0) {
+ toast.error(
+ t('designMode.editorOpen', {
+ defaultValue: 'Save or cancel your dashboard or report changes before designing the layout.',
+ }),
+ );
+ return false;
+ }
+ setHeld((prev) => {
+ const entered = prev.app === appName ? prev : { app: appName, changes: NO_CHANGES, opening: null };
+ return asked ? { ...entered, opening: asked } : entered;
+ });
+ return true;
+ },
+ [appName, t],
+ );
+ // `enter` takes no argument: a button's click event is never an opening.
+ const enter = React.useCallback((): boolean => enterWith(null), [enterWith]);
+ const enterOpening = React.useCallback(
+ (asked: DesignModeOpening): boolean => enterWith(asked.column === 'dashboard' ? asked : null),
+ [enterWith],
+ );
+ const takeOpening = React.useCallback((): DesignModeOpening | null => {
+ const taken = heldRef.current.opening;
+ if (taken) setHeld((prev) => (prev.opening ? { ...prev, opening: null } : prev));
+ return taken;
+ }, []);
const holdOut = React.useCallback(() => {
- setHeldOut((n) => n + 1);
+ heldOut.current += 1;
let released = false;
return () => {
if (released) return;
released = true;
- setHeldOut((n) => n - 1);
+ heldOut.current -= 1;
};
}, []);
@@ -207,7 +257,7 @@ export function useDesignModeController({
if (prev.app === null) return prev;
const next = new Map(prev.changes);
next.set(key, change);
- return { app: prev.app, changes: next };
+ return { ...prev, changes: next };
});
}, []);
@@ -216,7 +266,7 @@ export function useDesignModeController({
if (prev.app === null || !prev.changes.has(key)) return prev;
const next = new Map(prev.changes);
next.delete(key);
- return { app: prev.app, changes: next };
+ return { ...prev, changes: next };
});
}, []);
@@ -249,7 +299,7 @@ export function useDesignModeController({
if (now === undefined || (now !== change && now !== was)) return prev;
const next = new Map(prev.changes);
next.delete(key);
- return { app: prev.app, changes: next };
+ return { ...prev, changes: next };
});
}
setHeld((prev) => (prev.changes.size === 0 ? OFF : prev));
@@ -277,8 +327,23 @@ export function useDesignModeController({
}, [dirty, leaveMessage, appBasePath]);
return React.useMemo(
- () => ({ active, dirty, saving, enter, cancel, save, changes, stage, unstage, saveWith, holdOut }),
- [active, dirty, saving, enter, cancel, save, changes, stage, unstage, saveWith, holdOut],
+ () => ({
+ active,
+ dirty,
+ saving,
+ enter,
+ enterOpening,
+ cancel,
+ save,
+ changes,
+ opening,
+ takeOpening,
+ stage,
+ unstage,
+ saveWith,
+ holdOut,
+ }),
+ [active, dirty, saving, enter, enterOpening, cancel, save, changes, opening, takeOpening, stage, unstage, saveWith, holdOut],
);
}
@@ -297,6 +362,21 @@ export function useDesignModeActive(): boolean {
return React.useContext(DesignModeContext)?.active ?? false;
}
+/**
+ * What an arrival asked the mode to open first (objectstack#36907), for the
+ * surface that opens it: `opening` while it is held and the mode is on,
+ * `take` to answer it once. Outside a shell that holds the mode, nothing.
+ */
+export function useDesignModeOpening(): {
+ readonly opening: DesignModeOpening | null;
+ readonly take: () => DesignModeOpening | null;
+} {
+ const store = React.useContext(DesignModeContext);
+ const takeOpening = store?.takeOpening;
+ const take = React.useCallback(() => takeOpening?.() ?? null, [takeOpening]);
+ return { opening: store?.opening ?? null, take };
+}
+
/**
* The other half of the exclusion: a dashboard's or a report's own editor
* holds the mode out while `open`, so entering it refuses and says why
diff --git a/ui/packages/app-shell/src/layout/designModeArrival.ts b/ui/packages/app-shell/src/layout/designModeArrival.ts
index 574f8d3b023..f61128dc9f2 100644
--- a/ui/packages/app-shell/src/layout/designModeArrival.ts
+++ b/ui/packages/app-shell/src/layout/designModeArrival.ts
@@ -6,6 +6,7 @@
* state, and the dashboard's page opens its edit state on arrival
* (objectstack#36372), as its Edit button does. A dashboard opened from a
* Studio list lands the same way (objectstack#36906, `StudioAreaAppOpen`).
+ * Below it, the arrival that enters the mode itself (objectstack#36907).
*
* 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
@@ -38,3 +39,49 @@ export function withoutDashboardEditArrival(state: unknown): Record;
return Object.keys(rest).length > 0 ? rest : null;
}
+
+/*
+ * The arrival that ENTERS the mode (objectstack#36907): a Studio dashboard
+ * list's 「New」 opens its app with the mode on and the 「Add menu item」
+ * picker open on its dashboards, so a dashboard is made where it hangs in a
+ * menu (objectstack#36364), never outside every menu (epic objectstack#36359).
+ *
+ * Navigation state, never a URL parameter: the mode has no address, so no
+ * link and no reload enters it. The app shell reads it once (`useDesignModeArrival`),
+ * asks the mode to enter, and clears it from the history entry, so Back or a
+ * reload enters nothing. A refused entry does nothing more: the mode says why.
+ */
+
+/** The navigation-state key the entering arrival rides on. */
+export const DESIGN_MODE_ADD_DASHBOARD_ARRIVAL_STATE = 'designModeAddDashboard';
+
+/** What the entering arrival carries: the Studio list it came from, or `null`. */
+export interface DesignModeAddDashboardArrival {
+ /** The Studio list the new dashboard's × goes back to (`?studio=`), or `null`. */
+ readonly studioReturn: string | null;
+}
+
+/**
+ * The navigation state that enters the mode on arrival and opens the
+ * 「Add menu item」 picker on its dashboards; `studioReturn` is the Studio list
+ * the dashboard created there goes back to.
+ */
+export function designModeAddDashboardArrival(studioReturn: string | null): Record {
+ return { [DESIGN_MODE_ADD_DASHBOARD_ARRIVAL_STATE]: { studioReturn } };
+}
+
+/** The entering arrival `state` carries, or `null`. */
+export function readDesignModeAddDashboardArrival(state: unknown): DesignModeAddDashboardArrival | null {
+ if (!state || typeof state !== 'object') return null;
+ const arrival = (state as Record)[DESIGN_MODE_ADD_DASHBOARD_ARRIVAL_STATE];
+ if (!arrival || typeof arrival !== 'object') return null;
+ const studioReturn = (arrival as Record).studioReturn;
+ return { studioReturn: typeof studioReturn === 'string' && studioReturn ? studioReturn : null };
+}
+
+/** `state` without the entering arrival, for the replace that clears it once read. */
+export function withoutDesignModeAddDashboardArrival(state: unknown): Record | null {
+ if (!state || typeof state !== 'object') return null;
+ const { [DESIGN_MODE_ADD_DASHBOARD_ARRIVAL_STATE]: _arrival, ...rest } = state as Record;
+ return Object.keys(rest).length > 0 ? rest : null;
+}
diff --git a/ui/packages/app-shell/src/layout/useDesignModeArrival.ts b/ui/packages/app-shell/src/layout/useDesignModeArrival.ts
new file mode 100644
index 00000000000..725492c027f
--- /dev/null
+++ b/ui/packages/app-shell/src/layout/useDesignModeArrival.ts
@@ -0,0 +1,43 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * The app shell's reader of the arrival that enters the design mode
+ * (objectstack#36907, `designModeAddDashboardArrival`): a Studio dashboard
+ * list's 「New」 opens the app with it in the navigation state.
+ *
+ * Read once per history entry, where it lands. The entry is replaced without
+ * it before anything else happens, so Back or a reload enters nothing: the
+ * mode has no address, and a history entry is not one either. Then:
+ *
+ * - on a phone, nothing more: the mode is never on there, and Studio offers
+ * that 「New」 on no phone;
+ * - elsewhere the mode is asked to enter with the 「Add menu item」 picker
+ * opened on its dashboards (`enterOpening`). Where `enter` refuses (a
+ * dashboard's or a report's own editor holds the mode out,
+ * objectstack#36692), the arrival does nothing more, and the mode says why,
+ * as it does for its own menu door.
+ *
+ * @module
+ */
+
+import * as React from 'react';
+import { useLocation, useNavigate } from 'react-router-dom';
+import type { DesignModeValue } from './designMode.js';
+import { readDesignModeAddDashboardArrival, withoutDesignModeAddDashboardArrival } from './designModeArrival.js';
+
+export function useDesignModeArrival(mode: DesignModeValue, enabled: boolean): void {
+ const location = useLocation();
+ const navigate = useNavigate();
+ const arrival = readDesignModeAddDashboardArrival(location.state);
+ const readRef = React.useRef(null);
+ React.useEffect(() => {
+ if (!arrival || readRef.current === location.key) return;
+ readRef.current = location.key;
+ navigate(`${location.pathname}${location.search}${location.hash}`, {
+ replace: true,
+ state: withoutDesignModeAddDashboardArrival(location.state),
+ });
+ if (enabled) mode.enterOpening({ column: 'dashboard', studioReturn: arrival.studioReturn });
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- read once per history entry; `arrival` is a fresh object each render
+ }, [location.key, !!arrival]);
+}
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.pairCreate-36897.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.pairCreate-36897.test.tsx
index ab4d10aa2fa..5ac5a005072 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.pairCreate-36897.test.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.pairCreate-36897.test.tsx
@@ -12,6 +12,11 @@
* for this caller) nothing is offered.
* - Setup (no area) is unchanged — the control: its 「新建」 goes to the
* item page's create and opens no dialog.
+ *
+ * objectstack#36907 — a dashboard list's 「新建」 in the area opens an app's
+ * design mode, so it is offered only where an app opens (decision 6, the
+ * pair leg included), never on a phone; with no app the list says why. The
+ * report list's 「新建」 is the control: it reads no app.
*/
// Paid at collection, not inside a case's clock (check:test-source-alias).
@@ -19,21 +24,38 @@ import '@objectstack/lint';
import '@testing-library/jest-dom/vitest';
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 { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
import '@objectstack/spec/identity';
import { MetadataAreaHostContext, type MetadataAreaHost } from './metadataAreaHost';
const BASE = 'hotcrm';
+/** objectstack#36907 — the published apps per package (unset: one app), and the app reads asked. */
+const APPS = { byPackage: new Map(), reads: [] as string[], hold: null as Promise | null };
+/** Types whose list is empty, for the empty state's hint. */
+const EMPTY_TYPES = new Set();
const CLIENT = {
- list: async (type: string) =>
- type === 'package'
+ list: async (type: string, options?: { packageId?: string }) => {
+ if (type === 'app') {
+ APPS.reads.push(options?.packageId ?? '');
+ if (APPS.hold) await APPS.hold;
+ return APPS.byPackage.get(options?.packageId ?? '') ?? [{ name: 'crm_app_one', label: 'One app' }];
+ }
+ if (EMPTY_TYPES.has(type)) return [];
+ return type === 'package'
? [{ manifest: { id: BASE, name: 'HotCRM', scope: 'installed' } }]
- : [{ name: `crm_${type}_one`, label: `One ${type}`, _packageId: BASE }],
+ : [{ name: `crm_${type}_one`, label: `One ${type}`, _packageId: BASE }];
+ },
};
const entry = (type: string, domain: string) => ({ type, label: type, domain, allowEnvironmentOverlay: false, allowRuntimeCreate: true });
-const ENTRIES = [entry('object', 'data'), entry('flow', 'automation'), entry('email_template', 'system')];
+const ENTRIES = [
+ entry('object', 'data'),
+ entry('flow', 'automation'),
+ entry('email_template', 'system'),
+ entry('dashboard', 'ui'),
+ entry('report', 'ui'),
+];
vi.mock('./useMetadata', async (importOriginal) => ({
...(await importOriginal>()),
@@ -74,13 +96,19 @@ const fetchMock = vi.fn(async (url: string) => {
return json(404, { success: false });
});
+const DESKTOP_WIDTH = window.innerWidth;
beforeEach(() => {
fetchMock.mockClear();
vi.stubGlobal('fetch', fetchMock);
+ APPS.byPackage = new Map();
+ APPS.reads = [];
+ APPS.hold = null;
+ EMPTY_TYPES.clear();
});
afterEach(() => {
cleanup();
vi.unstubAllGlobals();
+ Object.defineProperty(window, 'innerWidth', { configurable: true, writable: true, value: DESKTOP_WIDTH });
});
const READ_ONLY_BASE: MetadataAreaHost = { packageId: BASE, readOnly: true, basePath: `/studio/${BASE}/metadata`, pairCreate: true };
@@ -144,3 +172,127 @@ describe('the list offers 「新建」 on a read-only base, into its pair (objec
expect(screen.queryByTestId('create-object-owd')).toBeNull();
});
});
+
+describe("a dashboard list's 「新建」 in the area opens an app's design mode (objectstack#36907)", () => {
+ const WRITABLE: MetadataAreaHost = { packageId: BASE, readOnly: false, basePath: `/studio/${BASE}/metadata` };
+ const PAIR = `${BASE}.custom`;
+ const reason = () => screen.queryByTestId('metadata-list-create-unavailable');
+ // The header's 新建 (an empty list draws a second one in its empty state).
+ const newButton = () => screen.queryByTestId('metadata-list-create');
+
+ it("offered where an app opens: it goes to the area's create, which opens the app's design mode", async () => {
+ mount(WRITABLE, 'dashboard');
+ await screen.findByTestId('metadata-row-crm_dashboard_one');
+ await waitFor(() => expect(newButton()).not.toBeNull());
+ expect(reason()).toBeNull();
+ expect(APPS.reads).toEqual([BASE]);
+ fireEvent.click(newButton()!);
+ await waitFor(() => expect(screen.getByTestId('location')).toHaveTextContent(`/studio/${BASE}/metadata/dashboard/new?package=${BASE}`));
+ });
+
+ it('with no app to open, no 新建, and the list says why', async () => {
+ APPS.byPackage.set(BASE, []);
+ mount(WRITABLE, 'dashboard');
+ await screen.findByTestId('metadata-row-crm_dashboard_one');
+ expect(await screen.findByTestId('metadata-list-create-unavailable')).toHaveTextContent(
+ t('engine.list.dashboardNewNoApp', 'en-US'),
+ );
+ expect(newButton()).toBeNull();
+ });
+
+ it('on a phone, no 新建 and no app read: the design mode is never on there', async () => {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, writable: true, value: 390 });
+ mount(WRITABLE, 'dashboard');
+ // A phone draws the list as cards: wait for the list's reads to settle.
+ await act(async () => {
+ await new Promise((resolve) => setTimeout(resolve, 50));
+ });
+ expect(screen.getByTestId('location')).toHaveTextContent(`/studio/${BASE}/metadata/dashboard?package=${BASE}`);
+ expect(newButton()).toBeNull();
+ expect(reason()).toBeNull();
+ expect(APPS.reads).toEqual([]);
+ });
+
+ it("a read-only base: offered by its own app; behind the customization wall nothing is offered, and no app is read", async () => {
+ mount(READ_ONLY_BASE, 'dashboard');
+ await screen.findByTestId('metadata-row-crm_dashboard_one');
+ await waitFor(() => expect(newButton()).not.toBeNull());
+ cleanup();
+ APPS.reads = [];
+ mount(NO_PAIR_CREATE, 'dashboard');
+ await screen.findByTestId('metadata-row-crm_dashboard_one');
+ expect(newButton()).toBeNull();
+ expect(reason()).toBeNull();
+ expect(APPS.reads).toEqual([]);
+ });
+
+ it("the pair leg: a pair publishing no app is offered by its base's app, one read more", async () => {
+ APPS.byPackage.set(PAIR, []);
+ mount({ packageId: PAIR, readOnly: false, basePath: `/studio/${PAIR}/metadata` }, 'dashboard');
+ await waitFor(() => expect(newButton()).not.toBeNull());
+ expect(APPS.reads).toEqual([PAIR, BASE]);
+ cleanup();
+ APPS.reads = [];
+ APPS.byPackage.set(BASE, []);
+ mount({ packageId: PAIR, readOnly: false, basePath: `/studio/${PAIR}/metadata` }, 'dashboard');
+ expect(await screen.findByTestId('metadata-list-create-unavailable')).toBeInTheDocument();
+ expect(newButton()).toBeNull();
+ });
+
+ it('CONTROL — the report list: 新建 offered with no app, and no app read', async () => {
+ APPS.byPackage.set(BASE, []);
+ mount(WRITABLE, 'report');
+ await screen.findByTestId('metadata-row-crm_report_one');
+ expect(newButton()).not.toBeNull();
+ expect(reason()).toBeNull();
+ expect(APPS.reads).toEqual([]);
+ });
+});
+
+describe("an empty dashboard list's hint never says a writable package is read-only (objectstack#36907)", () => {
+ const WRITABLE: MetadataAreaHost = { packageId: BASE, readOnly: false, basePath: `/studio/${BASE}/metadata` };
+ const hint = () => screen.queryByTestId('metadata-list-empty-hint');
+ const settle = () =>
+ act(async () => {
+ await new Promise((resolve) => setTimeout(resolve, 50));
+ });
+
+ beforeEach(() => {
+ EMPTY_TYPES.add('dashboard');
+ });
+
+ it('on a phone it says a dashboard is made in an app\'s design mode on a wider screen', async () => {
+ Object.defineProperty(window, 'innerWidth', { configurable: true, writable: true, value: 390 });
+ mount(WRITABLE, 'dashboard');
+ expect(await screen.findByTestId('metadata-list-empty-hint')).toHaveTextContent(
+ t('engine.list.dashboardNewWiderScreen', 'en-US'),
+ );
+ expect(hint()).not.toHaveTextContent(t('engine.list.readOnlyHint', 'en-US'));
+ expect(screen.queryByTestId('metadata-list-create')).toBeNull();
+ });
+
+ it("while the package's apps are read it says nothing yet, then the create hint once the New is offered", async () => {
+ let release!: () => void;
+ APPS.hold = new Promise((resolve) => {
+ release = resolve;
+ });
+ mount(WRITABLE, 'dashboard');
+ await settle();
+ // The empty state is drawn (its title), with no description under it yet.
+ expect(screen.getByText(/^No .+ items registered$/)).toBeInTheDocument();
+ expect(hint()).toBeNull();
+ expect(screen.queryByTestId('metadata-list-create')).toBeNull();
+ await act(async () => {
+ release();
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ });
+ expect(await screen.findByTestId('metadata-list-empty-hint')).toHaveTextContent(/New/);
+ expect(screen.getByTestId('metadata-list-create')).toBeInTheDocument();
+ });
+
+ it('CONTROL — with no app, the hint is the no-app reason', async () => {
+ APPS.byPackage.set(BASE, []);
+ mount(WRITABLE, 'dashboard');
+ await waitFor(() => expect(hint()).toHaveTextContent(t('engine.list.dashboardNewNoApp', 'en-US')));
+ });
+});
diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
index 16a49bb3885..1ea69a52208 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
+++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
@@ -103,6 +103,7 @@ import { SharingRuleCloneDialog, type SharingRuleCloneDialogProps } from './Shar
import { PermissionSetCloneDialog } from './PermissionSetCloneDialog.js';
import { permissionSetCloneNoticeText } from './permission-set-clone.js';
import { newSimilarOutcome } from '../studio-design/permissionNewSimilar.js';
+import { useStudioDashboardNew } from '../studio-design/StudioAreaAppOpen.js';
import { postureHasOrgWall, useTenancyPosture } from '../../hooks/useTenancyPosture.js';
import {
applyListState,
@@ -823,8 +824,16 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
const typeWritable = !!(entry?.allowEnvironmentOverlay || entry?.allowRuntimeCreate);
// A declaration-only catalog is never authored here: its items are created
// on the authored object's page.
- const canCreate =
+ const canCreateHere =
typeWritable && !walled && (!envScope || canAuthor) && !authoredObject && (!host?.readOnly || createInPair);
+ // objectstack#36907 — in the Studio area a dashboard's New opens an app's
+ // design mode (its 「Add menu item」 picker, so the dashboard hangs in a
+ // menu): offered only where an app opens, never on a phone, and with no app
+ // the list says why instead.
+ const dashboardNew = useStudioDashboardNew(
+ canCreateHere && type === 'dashboard' && host?.packageId ? host.packageId : null,
+ );
+ const canCreate = canCreateHere && (dashboardNew === 'off' || dashboardNew === 'offered');
// The wall is the gate to NAME only where the type would otherwise admit a
// write: a type with no runtime write channel is read-only for the operator
// too, and its page says nothing about the wall.
@@ -849,7 +858,23 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
`${routeLocation.pathname}?${search}`,
!loading && filtered.length > 0,
);
- const createButton = canCreate && (
+ // What an empty list says under its title. objectstack#36907 — a dashboard
+ // list whose New is withheld never falls through to the read-only hint: the
+ // package is writable. While its apps are read it says nothing yet; on a
+ // phone it says where a dashboard is made; with no app, why there is no New.
+ const emptyHint: string | null =
+ (scopedItems.length === 0 || hintedEmpty ? host?.emptyListHint : undefined) ??
+ config.emptyStateHint ??
+ (canCreate
+ ? tFormat('engine.list.createHint', locale, { type: typeLabel })
+ : dashboardNew === 'no-app'
+ ? t('engine.list.dashboardNewNoApp', locale)
+ : dashboardNew === 'phone'
+ ? t('engine.list.dashboardNewWiderScreen', locale)
+ : dashboardNew === 'pending'
+ ? null
+ : t('engine.list.readOnlyHint', locale));
+ const createButton = (canCreate && (
{t('engine.list.create', locale)}
- );
+ )) || (dashboardNew === 'no-app' && (
+
+ {t('engine.list.dashboardNewNoApp', locale)}
+
+ ));
// Declarative type-level actions (GAP-1) scoped to the list toolbar.
// Per-row (`list_item`) actions are not surfaced here yet — they need the
// row's recordId from the grid.
@@ -1458,13 +1487,7 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string
? tFormat('engine.list.emptyType', locale, { type: typeLabel })
: tFormat('engine.list.emptyQuery', locale, { query })}
-
- {(scopedItems.length === 0 || hintedEmpty ? host?.emptyListHint : undefined) ??
- config.emptyStateHint ??
- (canCreate
- ? tFormat('engine.list.createHint', locale, { type: typeLabel })
- : t('engine.list.readOnlyHint', locale))}
-
+ {emptyHint !== null && {emptyHint}}
{scopedItems.length === 0 && canCreate && (