Repository navigation
FE-2384: Update app navigation around processes and environments - #10641
vilkinsons wants to merge 8 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10641 +/- ##
==========================================
+ Coverage 69.04% 69.07% +0.02%
==========================================
Files 2089 2089
Lines 215009 215120 +111
Branches 9368 9400 +32
==========================================
+ Hits 148459 148598 +139
+ Misses 64644 64604 -40
- Partials 1906 1918 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR SummaryMedium Risk Overview Reworks navigation: sidebar order and highlighting, a combined Pages section (sidebar dashboards + block pages, View all pages), Create dashboard on
Reviewed by Cursor Bugbot for commit 0540ef9. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
The new “View all pages” link opens a Page-only listing that excludes dashboards, leaving dashboard-only workspaces with an empty list.
1 open issue
What changed in this PR
Reorganizes HASH navigation around Processes and Environments, consolidates sidebar page links, and aligns direct route access with explicit feature flags.
Changes:
- Moves the Petri net list and editor to
/environments, with/processesshowing Goals or Flows. - Groups dashboards and block pages under Pages, moves dashboard creation to
/pages, and adds an Apps section. - Updates route guards, editor navigation, Content Security Policy matching, and related tests.
| File | Description |
|---|---|
libs/@local/hash-isomorphic-utils/src/flows/definitions/ftse-investors-flow-definition.ts |
Updates the preview URL in documentation. |
libs/@local/hash-isomorphic-utils/src/feature-flags.ts |
Adds the favorites flag. |
libs/@hashintel/petrinaut-core/src/handle/host-integration.mdx |
Updates editor reference paths. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/top-nav-link.tsx |
Adds active-page semantics and label truncation. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/pages-section/dashboard-list.tsx |
Lists workspace dashboards in the sidebar. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/pages-section/dashboard-list.test.tsx |
Tests dashboard filtering, ordering, and retry. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/pages-section.tsx |
Groups dashboards and block pages. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/pages-section.test.tsx |
Tests Pages visibility and grouping. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/account-page-list.tsx |
Removes controls now owned by Pages. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar.tsx |
Reorders navigation and adds Apps. |
apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar.test.tsx |
Tests navigation order, flags, and highlighting. |
apps/hash-frontend/src/pages/shared/use-enabled-feature-flags.tsx |
Removes an outdated admin-override comment. |
apps/hash-frontend/src/pages/settings/personalization.page.tsx |
Updates sidebar preference labels. |
apps/hash-frontend/src/pages/processes.page.tsx |
Shows Goals or Flows as Processes. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/use-string-evaluation-gate.ts |
Carries editor policy handling to Environments. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/use-string-evaluation-gate.test.ts |
Updates policy-navigation test routes. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/use-process-save-and-load/use-petri-net-revisions.ts |
Carries revision loading to the relocated editor. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/use-process-save-and-load.tsx |
Updates the persisted-net import. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/top-bar-context.ts |
Carries shared editor controls to Environments. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/save-availability.ts |
Carries save eligibility logic. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/save-availability.test.ts |
Carries save eligibility tests. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut/top-bar-plugin/version-picker.tsx |
Carries the revision picker. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut/top-bar-plugin/top-bar.tsx |
Renames breadcrumbs and title placeholder. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut/top-bar-plugin.tsx |
Updates the plugin description. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut/brunch-hash-graph-reads.ts |
Carries Brunch graph-read integration. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut/brunch-hash-graph-reads.hook.test.tsx |
Carries graph-read hook tests. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut.tsx |
Carries Petrinaut and Brunch integration. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/process-petrinaut.test.tsx |
Carries assistant integration tests. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/agent-save.ts |
Carries agent-save coordination. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor/agent-save.test.ts |
Carries agent-save lifecycle tests. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor/petrinaut-editor.tsx |
Carries editor state and persistence controls. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor.tsx |
Updates navigation and default environment title. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor.test.tsx |
Updates editor imports and route assertions. |
apps/hash-frontend/src/pages/environments/[uuid].page/process-editor.integration.test.tsx |
Updates integration scenarios to environment routes. |
apps/hash-frontend/src/pages/environments/[uuid].page.tsx |
Relocates the draft and saved-net route. |
apps/hash-frontend/src/pages/environments.page/use-persisted-nets.ts |
Relocates the hook and updates its documentation. |
apps/hash-frontend/src/pages/environments.page/process-tile.tsx |
Relocates tiles and updates route documentation. |
apps/hash-frontend/src/pages/environments.page/petri-net-preview.tsx |
Relocates previews and updates route documentation. |
apps/hash-frontend/src/pages/environments.page/example-tiles-data.ts |
Relocates examples and updates URL documentation. |
apps/hash-frontend/src/pages/environments.page.tsx |
Adds the renamed environment listing. |
apps/hash-frontend/src/pages/entities.page/create-dashboard.tsx |
Adds dashboard creation with error handling. |
apps/hash-frontend/src/pages/entities.page/create-dashboard.test.tsx |
Tests creation failures and sidebar refresh. |
apps/hash-frontend/src/pages/entities.page.tsx |
Adds dashboard creation to /pages. |
apps/hash-frontend/src/pages/dashboards.page/dashboard-preview.tsx |
Removes obsolete dashboard previews. |
apps/hash-frontend/src/pages/dashboards.page.tsx |
Redirects the former listing to Home. |
apps/hash-frontend/src/pages/dashboard/[dashboard-id].page.tsx |
Refreshes sidebar data after dashboard changes. |
apps/hash-frontend/src/pages/_app.page/is-feature-flagged-page-hidden.ts |
Centralizes feature-gated route checks. |
apps/hash-frontend/src/pages/_app.page/is-feature-flagged-page-hidden.test.ts |
Tests route flag requirements. |
apps/hash-frontend/src/pages/_app.page.tsx |
Applies route guards without the admin exception. |
apps/hash-frontend/src/lib/csp.ts |
Moves editor policy matching to Environments. |
apps/hash-frontend/src/lib/csp.test.ts |
Updates policy tests for environment routes. |
apps/hash-frontend/src/graphql/queries/knowledge/entity.queries.ts |
Adds a dedicated sidebar dashboard query. |
apps/brunch-agent/evals/persona/hosts/hash.ts |
Updates evaluation URLs to Environments. |
Review effort: Balanced
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Pages list stuck loading if type fetch fails
- The entity-types context now clears its loading flag when the type query rejects, and the pages route keys its "Loading pages…" placeholder off that flag instead of
entityTypes === null, so a failed fetch no longer leaves the listing stuck loading.
- The entity-types context now clears its loading flag when the type query rejects, and the pages route keys its "Loading pages…" placeholder off that flag instead of
Or push these changes by commenting:
@cursor push 58e9b77d1e
Preview (58e9b77d1e)
diff --git a/apps/hash-frontend/src/pages/entities.page.test.tsx b/apps/hash-frontend/src/pages/entities.page.test.tsx
--- a/apps/hash-frontend/src/pages/entities.page.test.tsx
+++ b/apps/hash-frontend/src/pages/entities.page.test.tsx
@@ -16,6 +16,7 @@ const state = vi.hoisted(() => ({
flags: { pages: true, dashboards: true, documents: true, canvases: true },
pagesAreEnabled: true,
entityTypeIds: null as VersionedUrl[] | null,
+ entityTypesLoading: false,
router: {
asPath: "/pages",
pathname: "/entities",
@@ -16,6 +16,7 @@ const state = vi.hoisted(() => ({
flags: { pages: true, dashboards: true, documents: true, canvases: true },
pagesAreEnabled: true,
entityTypeIds: null as VersionedUrl[] | null,
+ entityTypesLoading: false,
router: {
asPath: "/pages",
pathname: "/entities",
@@ -58,6 +59,7 @@ vi.mock(
isSpecialEntityTypeLookup: null,
entityTypes:
state.entityTypeIds?.map(($id) => ({ schema: { $id } })) ?? null,
+ loading: state.entityTypesLoading,
}),
}),
);
@@ -58,6 +59,7 @@ vi.mock(
isSpecialEntityTypeLookup: null,
entityTypes:
state.entityTypeIds?.map(($id) => ({ schema: { $id } })) ?? null,
+ loading: state.entityTypesLoading,
}),
}),
);
@@ -98,6 +100,7 @@ beforeEach(() => {
state.flags.pages = true;
state.flags.dashboards = true;
state.pagesAreEnabled = true;
+ state.entityTypesLoading = false;
state.entityTypeIds = [
systemEntityTypes.page.entityTypeId,
`${systemEntityTypes.page.entityTypeBaseUrl}v/2` as VersionedUrl,
@@ -98,6 +100,7 @@ beforeEach(() => {
state.flags.pages = true;
state.flags.dashboards = true;
state.pagesAreEnabled = true;
+ state.entityTypesLoading = false;
state.entityTypeIds = [
systemEntityTypes.page.entityTypeId,
`${systemEntityTypes.page.entityTypeBaseUrl}v/2` as VersionedUrl,
@@ -151,11 +154,13 @@ test.each([
test("waits for all type versions before querying pages", () => {
const entityTypeIds = state.entityTypeIds;
state.entityTypeIds = null;
+ state.entityTypesLoading = true;
const { rerender } = renderPage();
expect(EntitiesVisualizer).not.toHaveBeenCalled();
expect(screen.getByText("Loading pages…")).toBeTruthy();
state.entityTypeIds = entityTypeIds;
+ state.entityTypesLoading = false;
rerender(
<ThemeProvider theme={theme}>
<EntitiesPage />
@@ -151,11 +154,13 @@ test.each([
test("waits for all type versions before querying pages", () => {
const entityTypeIds = state.entityTypeIds;
state.entityTypeIds = null;
+ state.entityTypesLoading = true;
const { rerender } = renderPage();
expect(EntitiesVisualizer).not.toHaveBeenCalled();
expect(screen.getByText("Loading pages…")).toBeTruthy();
state.entityTypeIds = entityTypeIds;
+ state.entityTypesLoading = false;
rerender(
<ThemeProvider theme={theme}>
<EntitiesPage />
@@ -166,6 +171,14 @@ test("waits for all type versions before querying pages", () => {
).toEqual(entityTypeIds?.slice(0, 4));
});
+test("stops loading when the entity types could not be fetched", () => {
+ state.entityTypeIds = null;
+ renderPage();
+ expect(EntitiesVisualizer).not.toHaveBeenCalled();
+ expect(screen.queryByText("Loading pages…")).toBeNull();
+ expect(screen.getByText("No pages to display.")).toBeTruthy();
+});
+
test("does not query all entities when no page types are available", () => {
state.entityTypeIds = [];
renderPage();
@@ -166,6 +171,14 @@ test("waits for all type versions before querying pages", () => {
).toEqual(entityTypeIds?.slice(0, 4));
});
+test("stops loading when the entity types could not be fetched", () => {
+ state.entityTypeIds = null;
+ renderPage();
+ expect(EntitiesVisualizer).not.toHaveBeenCalled();
+ expect(screen.queryByText("Loading pages…")).toBeNull();
+ expect(screen.getByText("No pages to display.")).toBeTruthy();
+});
+
test("does not query all entities when no page types are available", () => {
state.entityTypeIds = [];
renderPage();
diff --git a/apps/hash-frontend/src/pages/entities.page.tsx b/apps/hash-frontend/src/pages/entities.page.tsx
--- a/apps/hash-frontend/src/pages/entities.page.tsx
+++ b/apps/hash-frontend/src/pages/entities.page.tsx
@@ -180,7 +180,8 @@ const EntitiesPage: NextPageWithLayout = () => {
const { activeWorkspaceWebId } = useActiveWorkspace();
const { hashInstance } = useHashInstance();
- const { entityTypes } = useEntityTypesContextRequired();
+ const { entityTypes, loading: entityTypesLoading } =
+ useEntityTypesContextRequired();
const isPagesRoute = router.asPath.split(/[?#]/)[0] === "/pages";
const pageEntityTypeIds = useMemo(
@@ -180,7 +180,8 @@ const EntitiesPage: NextPageWithLayout = () => {
const { activeWorkspaceWebId } = useActiveWorkspace();
const { hashInstance } = useHashInstance();
- const { entityTypes } = useEntityTypesContextRequired();
+ const { entityTypes, loading: entityTypesLoading } =
+ useEntityTypesContextRequired();
const isPagesRoute = router.asPath.split(/[?#]/)[0] === "/pages";
const pageEntityTypeIds = useMemo(
@@ -390,7 +391,7 @@ const EntitiesPage: NextPageWithLayout = () => {
<Container sx={{ ...largePageMaxWidthCss, pt: 2, pb: 5 }}>
{isPagesRoute && !pageEntityTypeIds ? (
<Typography>
- {entityTypes === null ? "Loading pages…" : "No pages to display."}
+ {entityTypesLoading ? "Loading pages…" : "No pages to display."}
</Typography>
) : (
<EntitiesVisualizer
@@ -390,7 +391,7 @@ const EntitiesPage: NextPageWithLayout = () => {
<Container sx={{ ...largePageMaxWidthCss, pt: 2, pb: 5 }}>
{isPagesRoute && !pageEntityTypeIds ? (
<Typography>
- {entityTypes === null ? "Loading pages…" : "No pages to display."}
+ {entityTypesLoading ? "Loading pages…" : "No pages to display."}
</Typography>
) : (
<EntitiesVisualizer
diff --git a/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts b/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts
--- a/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts
+++ b/apps/hash-frontend/src/shared/entity-types-context/provider/use-entity-types-context-value.ts
@@ -70,6 +70,12 @@ export const useEntityTypesContextValue = (): EntityTypesContextValue => {
latestOnly: false,
includeArchived: true,
},
+ }).catch((error: unknown) => {
+ // if aborted, a newer fetch is in flight and reports its own loading state
+ if (!controller.signal.aborted) {
+ setTypes((currentTypes) => ({ ...currentTypes, loading: false }));
+ }
+ throw error;
});
if (controller.signal.aborted) {
@@ -70,6 +70,12 @@ export const useEntityTypesContextValue = (): EntityTypesContextValue => {
latestOnly: false,
includeArchived: true,
},
+ }).catch((error: unknown) => {
+ // if aborted, a newer fetch is in flight and reports its own loading state
+ if (!controller.signal.aborted) {
+ setTypes((currentTypes) => ({ ...currentTypes, loading: false }));
+ }
+ throw error;
});
if (controller.signal.aborted) {You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 0540ef9. Configure here.
| {isPagesRoute && !pageEntityTypeIds ? ( | ||
| <Typography> | ||
| {entityTypes === null ? "Loading pages…" : "No pages to display."} | ||
| </Typography> |
There was a problem hiding this comment.
Pages list stuck loading if type fetch fails
Low Severity
/pages now shows nothing but "Loading pages…" until the entity-types context sets entityTypes. The context's fetch doesn't catch errors, and an aborted request throws, so a failed or aborted type query leaves entityTypes as null for good. The page then stays on "Loading pages…" and never queries pages. Before this change, the page didn't depend on that fetch.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0540ef9. Configure here.
|
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting: Preview (fa6200e82c)diff --git a/apps/hash-frontend/src/pages/entities.page.test.tsx b/apps/hash-frontend/src/pages/entities.page.test.tsx
--- a/apps/hash-frontend/src/pages/entities.page.test.tsx
+++ b/apps/hash-frontend/src/pages/entities.page.test.tsx
@@ -122,8 +122,9 @@ test.each([
expect(vi.mocked(EntitiesVisualizer).mock.lastCall?.[0]).toMatchObject({
entityTypeBaseUrl: undefined,
entityTypeId: undefined,
- entityTypeIds: expected.map(
- (kind) => systemEntityTypes[kind as "page" | "dashboard"].entityTypeId,
+ entityTypeBaseUrls: expected.map(
+ (kind) =>
+ systemEntityTypes[kind as "page" | "dashboard"].entityTypeBaseUrl,
),
isViewingPages: true,
});
@@ -122,8 +122,9 @@ test.each([
expect(vi.mocked(EntitiesVisualizer).mock.lastCall?.[0]).toMatchObject({
entityTypeBaseUrl: undefined,
entityTypeId: undefined,
- entityTypeIds: expected.map(
- (kind) => systemEntityTypes[kind as "page" | "dashboard"].entityTypeId,
+ entityTypeBaseUrls: expected.map(
+ (kind) =>
+ systemEntityTypes[kind as "page" | "dashboard"].entityTypeBaseUrl,
),
isViewingPages: true,
});
@@ -147,7 +148,7 @@ test("keeps ordinary Page entity lists pinned to their requested type", () => {
renderPage();
expect(vi.mocked(EntitiesVisualizer).mock.lastCall?.[0]).toMatchObject({
entityTypeBaseUrl: systemEntityTypes.page.entityTypeBaseUrl,
- entityTypeIds: undefined,
+ entityTypeBaseUrls: undefined,
isViewingPages: false,
});
});
@@ -147,7 +148,7 @@ test("keeps ordinary Page entity lists pinned to their requested type", () => {
renderPage();
expect(vi.mocked(EntitiesVisualizer).mock.lastCall?.[0]).toMatchObject({
entityTypeBaseUrl: systemEntityTypes.page.entityTypeBaseUrl,
- entityTypeIds: undefined,
+ entityTypeBaseUrls: undefined,
isViewingPages: false,
});
});
diff --git a/apps/hash-frontend/src/pages/entities.page.tsx b/apps/hash-frontend/src/pages/entities.page.tsx
--- a/apps/hash-frontend/src/pages/entities.page.tsx
+++ b/apps/hash-frontend/src/pages/entities.page.tsx
@@ -50,6 +50,7 @@ import { useActiveWorkspace } from "./shared/workspace-context";
import type { NextPageWithLayout } from "../shared/layout";
import type { Breadcrumb } from "./shared/breadcrumbs";
import type {
+ BaseUrl,
EntityTypeWithMetadata,
VersionedUrl,
} from "@blockprotocol/type-system";
@@ -50,6 +50,7 @@ import { useActiveWorkspace } from "./shared/workspace-context";
import type { NextPageWithLayout } from "../shared/layout";
import type { Breadcrumb } from "./shared/breadcrumbs";
import type {
+ BaseUrl,
EntityTypeWithMetadata,
VersionedUrl,
} from "@blockprotocol/type-system";
@@ -182,15 +183,19 @@ const EntitiesPage: NextPageWithLayout = () => {
const { hashInstance } = useHashInstance();
const isPagesRoute = router.asPath.split(/[?#]/)[0] === "/pages";
- const pageEntityTypeIds = useMemo(
+ /**
+ * Matched by base URL, not by versioned id: a page's Document or Canvas type
+ * may inherit from an earlier version of the Page type.
+ */
+ const pageEntityTypeBaseUrls = useMemo(
() =>
- atLeastOne<VersionedUrl>([
+ atLeastOne<BaseUrl>([
...(enabledFeatureFlags.pages &&
hashInstance?.properties.pagesAreEnabled
- ? [systemEntityTypes.page.entityTypeId]
+ ? [systemEntityTypes.page.entityTypeBaseUrl]
: []),
...(enabledFeatureFlags.dashboards
- ? [systemEntityTypes.dashboard.entityTypeId]
+ ? [systemEntityTypes.dashboard.entityTypeBaseUrl]
: []),
]),
[
@@ -182,15 +183,19 @@ const EntitiesPage: NextPageWithLayout = () => {
const { hashInstance } = useHashInstance();
const isPagesRoute = router.asPath.split(/[?#]/)[0] === "/pages";
- const pageEntityTypeIds = useMemo(
+ /**
+ * Matched by base URL, not by versioned id: a page's Document or Canvas type
+ * may inherit from an earlier version of the Page type.
+ */
+ const pageEntityTypeBaseUrls = useMemo(
() =>
- atLeastOne<VersionedUrl>([
+ atLeastOne<BaseUrl>([
...(enabledFeatureFlags.pages &&
hashInstance?.properties.pagesAreEnabled
- ? [systemEntityTypes.page.entityTypeId]
+ ? [systemEntityTypes.page.entityTypeBaseUrl]
: []),
...(enabledFeatureFlags.dashboards
- ? [systemEntityTypes.dashboard.entityTypeId]
+ ? [systemEntityTypes.dashboard.entityTypeBaseUrl]
: []),
]),
[
@@ -382,13 +387,15 @@ const EntitiesPage: NextPageWithLayout = () => {
</Container>
</Box>
<Container sx={{ ...largePageMaxWidthCss, pt: 2, pb: 5 }}>
- {isPagesRoute && !pageEntityTypeIds ? (
+ {isPagesRoute && !pageEntityTypeBaseUrls ? (
<Typography>No pages to display.</Typography>
) : (
<EntitiesVisualizer
entityTypeBaseUrl={isPagesRoute ? undefined : entityTypeBaseUrl}
entityTypeId={isPagesRoute ? undefined : entityTypeId}
- entityTypeIds={isPagesRoute ? pageEntityTypeIds : undefined}
+ entityTypeBaseUrls={
+ isPagesRoute ? pageEntityTypeBaseUrls : undefined
+ }
isViewingPages={isPagesRoute}
hideColumns={hideColumns}
/>
@@ -382,13 +387,15 @@ const EntitiesPage: NextPageWithLayout = () => {
</Container>
</Box>
<Container sx={{ ...largePageMaxWidthCss, pt: 2, pb: 5 }}>
- {isPagesRoute && !pageEntityTypeIds ? (
+ {isPagesRoute && !pageEntityTypeBaseUrls ? (
<Typography>No pages to display.</Typography>
) : (
<EntitiesVisualizer
entityTypeBaseUrl={isPagesRoute ? undefined : entityTypeBaseUrl}
entityTypeId={isPagesRoute ? undefined : entityTypeId}
- entityTypeIds={isPagesRoute ? pageEntityTypeIds : undefined}
+ entityTypeBaseUrls={
+ isPagesRoute ? pageEntityTypeBaseUrls : undefined
+ }
isViewingPages={isPagesRoute}
hideColumns={hideColumns}
/>
diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer.tsx b/apps/hash-frontend/src/pages/shared/entities-visualizer.tsx
--- a/apps/hash-frontend/src/pages/shared/entities-visualizer.tsx
+++ b/apps/hash-frontend/src/pages/shared/entities-visualizer.tsx
@@ -155,7 +155,11 @@ export const EntitiesVisualizer: FunctionComponent<{
* Limit the entities displayed to only those matching this exact type version
*/
entityTypeId?: VersionedUrl;
- entityTypeIds?: [VersionedUrl, ...VersionedUrl[]];
+ /**
+ * Limit the entities displayed to only those matching any version of any of
+ * these types. Supersedes {@link entityTypeBaseUrl}.
+ */
+ entityTypeBaseUrls?: [BaseUrl, ...BaseUrl[]];
isViewingPages?: boolean;
/**
* Hide specific columns from the table
@@ -155,7 +155,11 @@ export const EntitiesVisualizer: FunctionComponent<{
* Limit the entities displayed to only those matching this exact type version
*/
entityTypeId?: VersionedUrl;
- entityTypeIds?: [VersionedUrl, ...VersionedUrl[]];
+ /**
+ * Limit the entities displayed to only those matching any version of any of
+ * these types. Supersedes {@link entityTypeBaseUrl}.
+ */
+ entityTypeBaseUrls?: [BaseUrl, ...BaseUrl[]];
isViewingPages?: boolean;
/**
* Hide specific columns from the table
@@ -164,14 +168,20 @@ export const EntitiesVisualizer: FunctionComponent<{
}> = ({
entityTypeBaseUrl,
entityTypeId,
- entityTypeIds: providedEntityTypeIds,
+ entityTypeBaseUrls: providedEntityTypeBaseUrls,
isViewingPages = false,
hideColumns,
}) => {
const theme = useTheme();
+ const requestedEntityTypeBaseUrls = useMemo(
+ () =>
+ providedEntityTypeBaseUrls ??
+ (entityTypeBaseUrl ? [entityTypeBaseUrl] : undefined),
+ [providedEntityTypeBaseUrls, entityTypeBaseUrl],
+ );
const requestedEntityTypeIds = useMemo(
- () => providedEntityTypeIds ?? (entityTypeId ? [entityTypeId] : undefined),
- [providedEntityTypeIds, entityTypeId],
+ () => (entityTypeId ? [entityTypeId] : undefined),
+ [entityTypeId],
);
const { isSpecialEntityTypeLookup } = useEntityTypesContextRequired();
@@ -164,14 +168,20 @@ export const EntitiesVisualizer: FunctionComponent<{
}> = ({
entityTypeBaseUrl,
entityTypeId,
- entityTypeIds: providedEntityTypeIds,
+ entityTypeBaseUrls: providedEntityTypeBaseUrls,
isViewingPages = false,
hideColumns,
}) => {
const theme = useTheme();
+ const requestedEntityTypeBaseUrls = useMemo(
+ () =>
+ providedEntityTypeBaseUrls ??
+ (entityTypeBaseUrl ? [entityTypeBaseUrl] : undefined),
+ [providedEntityTypeBaseUrls, entityTypeBaseUrl],
+ );
const requestedEntityTypeIds = useMemo(
- () => providedEntityTypeIds ?? (entityTypeId ? [entityTypeId] : undefined),
- [providedEntityTypeIds, entityTypeId],
+ () => (entityTypeId ? [entityTypeId] : undefined),
+ [entityTypeId],
);
const { isSpecialEntityTypeLookup } = useEntityTypesContextRequired();
@@ -295,7 +305,8 @@ export const EntitiesVisualizer: FunctionComponent<{
[sort],
);
- const isTypePinned = !!entityTypeBaseUrl || !!requestedEntityTypeIds?.length;
+ const isTypePinned =
+ !!requestedEntityTypeBaseUrls?.length || !!requestedEntityTypeIds?.length;
const usesTableEndpoint = view === "Table";
@@ -295,7 +305,8 @@ export const EntitiesVisualizer: FunctionComponent<{
[sort],
);
- const isTypePinned = !!entityTypeBaseUrl || !!requestedEntityTypeIds?.length;
+ const isTypePinned =
+ !!requestedEntityTypeBaseUrls?.length || !!requestedEntityTypeIds?.length;
const usesTableEndpoint = view === "Table";
@@ -365,7 +376,7 @@ export const EntitiesVisualizer: FunctionComponent<{
} = useAvailableTypes({
filterState,
internalWebs,
- entityTypeBaseUrl,
+ entityTypeBaseUrls: requestedEntityTypeBaseUrls,
entityTypeIds: requestedEntityTypeIds,
summarySource,
});
@@ -365,7 +376,7 @@ export const EntitiesVisualizer: FunctionComponent<{
} = useAvailableTypes({
filterState,
internalWebs,
- entityTypeBaseUrl,
+ entityTypeBaseUrls: requestedEntityTypeBaseUrls,
entityTypeIds: requestedEntityTypeIds,
summarySource,
});
@@ -400,7 +411,7 @@ export const EntitiesVisualizer: FunctionComponent<{
const entitiesData = useEntitiesVisualizerData({
conversions,
cursor: subgraphCursor,
- entityTypeBaseUrl,
+ entityTypeBaseUrls: requestedEntityTypeBaseUrls,
entityTypeIds: requestedEntityTypeIds,
filterState,
internalWebs,
@@ -400,7 +411,7 @@ export const EntitiesVisualizer: FunctionComponent<{
const entitiesData = useEntitiesVisualizerData({
conversions,
cursor: subgraphCursor,
- entityTypeBaseUrl,
+ entityTypeBaseUrls: requestedEntityTypeBaseUrls,
entityTypeIds: requestedEntityTypeIds,
filterState,
internalWebs,
@@ -588,14 +599,14 @@ export const EntitiesVisualizer: FunctionComponent<{
propertyFilters,
},
internalWebIds: internalWebs.map(({ webId }) => webId),
- pinnedEntityTypeBaseUrl: entityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls: requestedEntityTypeBaseUrls,
pinnedEntityTypeIds: requestedEntityTypeIds,
}),
);
}, [
filterState,
internalWebs,
- entityTypeBaseUrl,
+ requestedEntityTypeBaseUrls,
requestedEntityTypeIds,
linkEntityTypeIds,
linkOnlyPropertyBaseUrls,
@@ -588,14 +599,14 @@ export const EntitiesVisualizer: FunctionComponent<{
propertyFilters,
},
internalWebIds: internalWebs.map(({ webId }) => webId),
- pinnedEntityTypeBaseUrl: entityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls: requestedEntityTypeBaseUrls,
pinnedEntityTypeIds: requestedEntityTypeIds,
}),
);
}, [
filterState,
internalWebs,
- entityTypeBaseUrl,
+ requestedEntityTypeBaseUrls,
requestedEntityTypeIds,
linkEntityTypeIds,
linkOnlyPropertyBaseUrls,
diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/build-filter.ts b/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/build-filter.ts
--- a/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/build-filter.ts
+++ b/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/build-filter.ts
@@ -54,21 +54,20 @@ const buildWebClause = (
};
const buildTypeClause = ({
- pinnedEntityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls,
pinnedEntityTypeIds,
selectedTypeIds,
}: {
- pinnedEntityTypeBaseUrl?: BaseUrl;
+ pinnedEntityTypeBaseUrls?: BaseUrl[];
pinnedEntityTypeIds?: VersionedUrl[];
selectedTypeIds: Set<VersionedUrl> | null;
}): { clause: Filter | null; isPinned: boolean } => {
- if (pinnedEntityTypeBaseUrl) {
+ if (pinnedEntityTypeBaseUrls?.length) {
return {
clause: {
- equal: [
- { path: ["type", "baseUrl"] },
- { parameter: pinnedEntityTypeBaseUrl },
- ],
+ any: pinnedEntityTypeBaseUrls.map((baseUrl) => ({
+ equal: [{ path: ["type", "baseUrl"] }, { parameter: baseUrl }],
+ })),
},
isPinned: true,
};
@@ -54,21 +54,20 @@ const buildWebClause = (
};
const buildTypeClause = ({
- pinnedEntityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls,
pinnedEntityTypeIds,
selectedTypeIds,
}: {
- pinnedEntityTypeBaseUrl?: BaseUrl;
+ pinnedEntityTypeBaseUrls?: BaseUrl[];
pinnedEntityTypeIds?: VersionedUrl[];
selectedTypeIds: Set<VersionedUrl> | null;
}): { clause: Filter | null; isPinned: boolean } => {
- if (pinnedEntityTypeBaseUrl) {
+ if (pinnedEntityTypeBaseUrls?.length) {
return {
clause: {
- equal: [
- { path: ["type", "baseUrl"] },
- { parameter: pinnedEntityTypeBaseUrl },
- ],
+ any: pinnedEntityTypeBaseUrls.map((baseUrl) => ({
+ equal: [{ path: ["type", "baseUrl"] }, { parameter: baseUrl }],
+ })),
},
isPinned: true,
};
@@ -119,13 +118,13 @@ const buildTypeClause = ({
export const buildEntitiesFilter = ({
filterState,
internalWebIds,
- pinnedEntityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls,
pinnedEntityTypeIds,
typeUniverse,
}: {
filterState: EntitiesFilterState;
internalWebIds: WebId[];
- pinnedEntityTypeBaseUrl?: BaseUrl;
+ pinnedEntityTypeBaseUrls?: BaseUrl[];
pinnedEntityTypeIds?: VersionedUrl[];
/**
* The type universe: the entity type ids present in the current result set,
@@ -119,13 +118,13 @@ const buildTypeClause = ({
export const buildEntitiesFilter = ({
filterState,
internalWebIds,
- pinnedEntityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls,
pinnedEntityTypeIds,
typeUniverse,
}: {
filterState: EntitiesFilterState;
internalWebIds: WebId[];
- pinnedEntityTypeBaseUrl?: BaseUrl;
+ pinnedEntityTypeBaseUrls?: BaseUrl[];
pinnedEntityTypeIds?: VersionedUrl[];
/**
* The type universe: the entity type ids present in the current result set,
@@ -153,7 +152,7 @@ export const buildEntitiesFilter = ({
}
const { clause: typeClause, isPinned: isTypePinned } = buildTypeClause({
- pinnedEntityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls,
pinnedEntityTypeIds,
selectedTypeIds: filterState.type.selectedTypeIds,
});
@@ -153,7 +152,7 @@ export const buildEntitiesFilter = ({
}
const { clause: typeClause, isPinned: isTypePinned } = buildTypeClause({
- pinnedEntityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls,
pinnedEntityTypeIds,
selectedTypeIds: filterState.type.selectedTypeIds,
});
diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/use-available-types.ts b/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/use-available-types.ts
--- a/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/use-available-types.ts
+++ b/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/use-available-types.ts
@@ -47,13 +47,13 @@ export type SummarySource =
export const useAvailableTypes = ({
filterState,
internalWebs,
- entityTypeBaseUrl,
+ entityTypeBaseUrls,
entityTypeIds,
summarySource,
}: {
filterState: EntitiesFilterState;
internalWebs: { webId: WebId }[];
- entityTypeBaseUrl?: BaseUrl;
+ entityTypeBaseUrls?: BaseUrl[];
entityTypeIds?: VersionedUrl[];
summarySource: SummarySource;
}): {
@@ -47,13 +47,13 @@ export type SummarySource =
export const useAvailableTypes = ({
filterState,
internalWebs,
- entityTypeBaseUrl,
+ entityTypeBaseUrls,
entityTypeIds,
summarySource,
}: {
filterState: EntitiesFilterState;
internalWebs: { webId: WebId }[];
- entityTypeBaseUrl?: BaseUrl;
+ entityTypeBaseUrls?: BaseUrl[];
entityTypeIds?: VersionedUrl[];
summarySource: SummarySource;
}): {
@@ -99,7 +99,7 @@ export const useAvailableTypes = ({
const { dataTypes } = useDataTypesContext();
const { propertyTypes } = usePropertyTypes();
- const isTypePinned = !!entityTypeBaseUrl || !!entityTypeIds?.length;
+ const isTypePinned = !!entityTypeBaseUrls?.length || !!entityTypeIds?.length;
const shouldFetchAvailableTypes =
!isTypePinned && summarySource.mode === "fetch";
@@ -99,7 +99,7 @@ export const useAvailableTypes = ({
const { dataTypes } = useDataTypesContext();
const { propertyTypes } = usePropertyTypes();
- const isTypePinned = !!entityTypeBaseUrl || !!entityTypeIds?.length;
+ const isTypePinned = !!entityTypeBaseUrls?.length || !!entityTypeIds?.length;
const shouldFetchAvailableTypes =
!isTypePinned && summarySource.mode === "fetch";
@@ -108,16 +108,16 @@ export const useAvailableTypes = ({
return entityTypeIds;
}
- if (entityTypeBaseUrl && entityTypes) {
+ if (entityTypeBaseUrls?.length && entityTypes) {
return entityTypes
- .filter(
- ({ schema }) => extractBaseUrl(schema.$id) === entityTypeBaseUrl,
+ .filter(({ schema }) =>
+ entityTypeBaseUrls.includes(extractBaseUrl(schema.$id)),
)
.map(({ schema }) => schema.$id);
}
return null;
- }, [entityTypeBaseUrl, entityTypeIds, entityTypes]);
+ }, [entityTypeBaseUrls, entityTypeIds, entityTypes]);
// No typeUniverse here — this query defines the universe. Feeding it back in
// would ratchet it shut against newly appearing types.
@@ -108,16 +108,16 @@ export const useAvailableTypes = ({
return entityTypeIds;
}
- if (entityTypeBaseUrl && entityTypes) {
+ if (entityTypeBaseUrls?.length && entityTypes) {
return entityTypes
- .filter(
- ({ schema }) => extractBaseUrl(schema.$id) === entityTypeBaseUrl,
+ .filter(({ schema }) =>
+ entityTypeBaseUrls.includes(extractBaseUrl(schema.$id)),
)
.map(({ schema }) => schema.$id);
}
return null;
- }, [entityTypeBaseUrl, entityTypeIds, entityTypes]);
+ }, [entityTypeBaseUrls, entityTypeIds, entityTypes]);
// No typeUniverse here — this query defines the universe. Feeding it back in
// would ratchet it shut against newly appearing types.
diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-visualizer-data.tsx b/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-visualizer-data.tsx
--- a/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-visualizer-data.tsx
+++ b/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-visualizer-data.tsx
@@ -67,7 +67,7 @@ export type EntitiesVisualizerData = Partial<
export const useEntitiesVisualizerData = (params: {
conversions?: ConversionRequest[];
cursor?: EntityQueryCursor;
- entityTypeBaseUrl?: BaseUrl;
+ entityTypeBaseUrls?: BaseUrl[];
entityTypeIds?: VersionedUrl[];
filterState: EntitiesFilterState;
internalWebs: { webId: WebId }[];
@@ -67,7 +67,7 @@ export type EntitiesVisualizerData = Partial<
export const useEntitiesVisualizerData = (params: {
conversions?: ConversionRequest[];
cursor?: EntityQueryCursor;
- entityTypeBaseUrl?: BaseUrl;
+ entityTypeBaseUrls?: BaseUrl[];
entityTypeIds?: VersionedUrl[];
filterState: EntitiesFilterState;
internalWebs: { webId: WebId }[];
@@ -91,7 +91,7 @@ export const useEntitiesVisualizerData = (params: {
const {
conversions,
cursor,
- entityTypeBaseUrl,
+ entityTypeBaseUrls,
entityTypeIds,
filterState,
internalWebs,
@@ -91,7 +91,7 @@ export const useEntitiesVisualizerData = (params: {
const {
conversions,
cursor,
- entityTypeBaseUrl,
+ entityTypeBaseUrls,
entityTypeIds,
filterState,
internalWebs,
@@ -112,22 +112,22 @@ export const useEntitiesVisualizerData = (params: {
buildEntitiesFilter({
filterState,
internalWebIds,
- pinnedEntityTypeBaseUrl: entityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls: entityTypeBaseUrls,
pinnedEntityTypeIds: entityTypeIds,
typeUniverse,
}),
[
filterState,
internalWebIds,
- entityTypeBaseUrl,
+ entityTypeBaseUrls,
entityTypeIds,
typeUniverse,
],
);
const awaitingTypeUniverse =
typeUniverse === null &&
- !entityTypeBaseUrl &&
+ !entityTypeBaseUrls?.length &&
!entityTypeIds?.length &&
filterState.type.selectedTypeIds === null;
@@ -112,22 +112,22 @@ export const useEntitiesVisualizerData = (params: {
buildEntitiesFilter({
filterState,
internalWebIds,
- pinnedEntityTypeBaseUrl: entityTypeBaseUrl,
+ pinnedEntityTypeBaseUrls: entityTypeBaseUrls,
pinnedEntityTypeIds: entityTypeIds,
typeUniverse,
}),
[
filterState,
internalWebIds,
- entityTypeBaseUrl,
+ entityTypeBaseUrls,
entityTypeIds,
typeUniverse,
],
);
const awaitingTypeUniverse =
typeUniverse === null &&
- !entityTypeBaseUrl &&
+ !entityTypeBaseUrls?.length &&
!entityTypeIds?.length &&
filterState.type.selectedTypeIds === null;You can send follow-ups to the cloud agent here. |




🌟 Purpose
workerfeature flag, and prevents access by users without this set./pages🔍 Changes
The sidebar now orders Home, Inbox, Processes, Environments, Entities, and Types below the account switcher. Notes and Favorites follow when their feature flags are enabled. Supply Chain moves to Apps. Workspace dashboards and block pages share one Pages list, with “View all pages” at the bottom. Dashboard creation moves to
/pages, alongside “Create document” and “Create canvas”. The/pagestable includes dashboards and block pages according to their feature flags. Dashboard rows open/dashboard/[uuid], and block-page rows use their workspace shortname. The former dashboard list page redirects to Home.Processes uses
/processes, retaining its existing Goals or Flows landing content. The environment list and editor move to/environmentsand/environments/[uuid]. Both sections require theworkersflag. Direct page access now checks explicit feature flags, matching sidebar visibility and removing the previous instance-admin exception.Dashboard sidebar titles use the full Block Protocol name property URL. Missing or non-text names are omitted before sorting and rendering, so custom properties with the same slug cannot break workspace navigation. Regression tests reproduce both the single-dashboard render crash and the multi-dashboard sort crash, and cover malformed names alongside valid dashboards.
Validation: focused sidebar, dashboard-list, route-guard, editor, and Content Security Policy tests passed. The 27 focused tests for the combined Pages listing, row navigation, dashboard creation, dashboard sidebar, and file-only display detection passed. Formatting passed. Targeted ESLint reports one existing
no-unnecessary-type-assertionerror inentities-visualizer.tsx, also reproduced against the pre-fix revision. In the live local app, Alice was redirected to Home from both sections withworkersdisabled, then could open both after enabling it in the local database. A locally created dashboard appeared alongside documents in/pages, and clicking its table row opened its dashboard editor.To inspect the change, sign in with
workersenabled and open/processesand/environments. Withdashboardsenabled, select a workspace and open a dashboard from the sidebar’s Pages list, or choose “View all pages” and create one from/pages. Disableworkersand verify that the two sidebar links disappear and direct requests to/processes,/environments, and/environments/draftreturn to Home.Existing environment bookmarks under
/processes/[uuid]must use/environments/[uuid]. The/processespath now belongs to Processes.