= ({
table={resource.subject}
/>
+ ) : viewKind === 'dashboard' && embedded ? (
+ // A dashboard inside a dashboard block would render itself again,
+ // forever. Say so instead of hanging the page.
+
+ Pick a table, board or calendar view; a dashboard can't be shown
+ inside a dashboard.
+
) : viewKind === 'dashboard' ? (
) : viewKind === 'kanban' ? (
diff --git a/browser/data-browser/src/chunks/TablePage/useTableData.ts b/browser/data-browser/src/chunks/TablePage/useTableData.ts
index 1155a74da5..c0cfaa4fed 100644
--- a/browser/data-browser/src/chunks/TablePage/useTableData.ts
+++ b/browser/data-browser/src/chunks/TablePage/useTableData.ts
@@ -33,8 +33,9 @@ export function useTableData(
resource: Resource,
/** Which view to show, when the caller decides rather than the URL. */
viewOverride?: string,
+ embedded = false,
): UseTableDataResult {
- const tableView = useTableView(resource, viewOverride);
+ const tableView = useTableView(resource, viewOverride, embedded);
const { filters, sorting } = tableView;
const store = useStore();
diff --git a/browser/data-browser/src/chunks/TablePage/useTableView.ts b/browser/data-browser/src/chunks/TablePage/useTableView.ts
index 769ae84cd1..f4f9aba053 100644
--- a/browser/data-browser/src/chunks/TablePage/useTableView.ts
+++ b/browser/data-browser/src/chunks/TablePage/useTableView.ts
@@ -203,6 +203,12 @@ export function useTableView(
* cannot say which view each of them shows.
*/
viewOverride?: string,
+ /**
+ * An embedded table never reads the host page's `?view=`: that param names a
+ * view of the host's table, and for a dashboard block of its own table it is
+ * the dashboard itself, which would render itself inside itself.
+ */
+ embedded = false,
): UseTableViewResult {
const store = useStore();
const canWrite = useCanWrite(table);
@@ -221,7 +227,7 @@ export function useTableView(
const navigate = ShowRoute.useNavigate();
const activeView =
viewOverride ??
- activeViewParam ??
+ (embedded ? undefined : activeViewParam) ??
defaultViewSubject ??
views[0] ??
undefined;