Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit 98efa16

Browse files
committed
feat(web): wire canvas/channels dashboard routers
Canvas/Channels called dashboards.list (and canvasData/canvasTemplates/ channelTasks), but the web host router never exposed those routers, so they NOT_FOUND'd at call time — e.g. deleting a context failed with "No query-procedure on path dashboards.list". Load canvasCoreModule in the web container (its services only need AuthService + fetch to the PostHog desktop_file_system API — no Node backend) and mount the four real host-router canvas routers, mirroring desktop. Generated-By: PostHog Code Task-Id: 77d13a30-444d-4045-9d80-5e2a9f2e68ae
1 parent 26d0531 commit 98efa16

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

apps/web/src/web-container.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
type IAuthSessionStore,
2727
type IAuthTokenCipher,
2828
} from "@posthog/core/auth/identifiers";
29+
import { canvasCoreModule } from "@posthog/core/canvas/canvas.module";
2930
import type { CloudTaskService } from "@posthog/core/cloud-task/cloud-task";
3031
import { cloudTaskModule } from "@posthog/core/cloud-task/cloud-task.module";
3132
import {
@@ -453,6 +454,12 @@ container.bind(CLOUD_TASK_AUTH).toDynamicValue((ctx) => ({
453454
},
454455
}));
455456

457+
// ── Canvas / Channels: host-agnostic dashboard + freeform canvas services ──
458+
// They only need AuthService + fetch (they reach the PostHog desktop_file_system
459+
// API), so the web host binds them by loading the same core module desktop does;
460+
// the web host router forwards its canvas routers to these.
461+
container.load(canvasCoreModule);
462+
456463
// SessionService is built from host-agnostic deps (host tRPC client + UI
457464
// stores) — same construction the desktop renderer uses.
458465
container

apps/web/src/web-host-router.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import type { TeamSkillsService } from "@posthog/core/skills/teamSkillsService";
33
import { resolveService } from "@posthog/di/container";
44
import { analyticsRouter } from "@posthog/host-router/routers/analytics.router";
55
import { authRouter } from "@posthog/host-router/routers/auth.router";
6+
import { canvasDataRouter } from "@posthog/host-router/routers/canvas-data.router";
7+
import { canvasTemplatesRouter } from "@posthog/host-router/routers/canvas-templates.router";
8+
import { channelTasksRouter } from "@posthog/host-router/routers/channel-tasks.router";
69
import { cloudTaskRouter } from "@posthog/host-router/routers/cloud-task.router";
10+
import { dashboardsRouter } from "@posthog/host-router/routers/dashboards.router";
711
import { publicProcedure, router } from "@posthog/host-trpc/trpc";
812
import {
913
type CloudRegion,
@@ -465,7 +469,14 @@ export const webHostRouter = router({
465469
archive: archiveStubRouter,
466470
auth: authRouter,
467471
browserTabs: browserTabsRouter,
472+
// Canvas / Channels: real host-router routers over the host-agnostic canvas
473+
// core services (bound via canvasCoreModule in web-container), which reach the
474+
// PostHog desktop_file_system API through authenticatedFetch — no Node backend.
475+
canvasData: canvasDataRouter,
476+
canvasTemplates: canvasTemplatesRouter,
477+
channelTasks: channelTasksRouter,
468478
cloudTask: cloudTaskRouter,
479+
dashboards: dashboardsRouter,
469480
deepLink: deepLinkStubRouter,
470481
folders: foldersStubRouter,
471482
fs: fsStubRouter,

0 commit comments

Comments
 (0)