Skip to content

Commit 20ff5dc

Browse files
feat(dashboards): one Sim-built dashboard per workspace
A workspace now has a single dashboard that Sim builds. The Dashboards page renders it directly, or an empty state until the first save. Folders, the list, create, rename and move are removed; the agent reads and saves it with dashboards get / set, and replacing existing content needs its revision. A partial unique index enforces one live dashboard per workspace, and generic file writes can no longer produce the dashboard content type. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S6aTRnkiu7PxYZPNPXYEMV
1 parent ec7680d commit 20ff5dc

54 files changed

Lines changed: 563 additions & 1756 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {
2+
deleteWorkspaceDashboardContract,
3+
readWorkspaceDashboardContract,
4+
} from '@/lib/api/contracts/dashboards'
5+
import {
6+
defineInternalJsonRoute,
7+
internalOrchestrationErrorPolicy,
8+
internalRateLimits,
9+
internalSessionAuth,
10+
} from '@/lib/api/server/routes'
11+
import {
12+
deleteWorkspaceDashboard,
13+
readWorkspaceDashboard,
14+
} from '@/lib/dashboards/application/dashboards'
15+
import { dashboardOperations } from '@/lib/dashboards/application/operations'
16+
17+
export const GET = defineInternalJsonRoute({
18+
contract: readWorkspaceDashboardContract,
19+
auth: internalSessionAuth,
20+
operation: dashboardOperations.read,
21+
rateLimit: internalRateLimits.user({ bucketName: 'dashboards' }),
22+
errorPolicy: internalOrchestrationErrorPolicy,
23+
mapInput: ({ params }) => ({ workspaceId: params.id }),
24+
useCase: readWorkspaceDashboard,
25+
})
26+
27+
export const DELETE = defineInternalJsonRoute({
28+
contract: deleteWorkspaceDashboardContract,
29+
auth: internalSessionAuth,
30+
operation: dashboardOperations.delete,
31+
rateLimit: internalRateLimits.user({ bucketName: 'dashboards' }),
32+
errorPolicy: internalOrchestrationErrorPolicy,
33+
mapInput: ({ params }) => ({ workspaceId: params.id }),
34+
useCase: deleteWorkspaceDashboard,
35+
})

‎apps/sim/app/api/workspaces/[id]/dashboards/[dashboardId]/route.ts‎

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎apps/sim/app/api/workspaces/[id]/dashboards/folders/route.ts‎

Lines changed: 0 additions & 59 deletions
This file was deleted.

‎apps/sim/app/api/workspaces/[id]/dashboards/route.ts‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎apps/sim/app/workspace/[workspaceId]/components/folders/foldered-resources.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ComponentType } from 'react'
2-
import { ChartColumn, Database, File as FileIcon, Table as TableIcon } from '@sim/emcn/icons'
2+
import { Database, File as FileIcon, Table as TableIcon } from '@sim/emcn/icons'
33
import type { FolderResourceType } from '@/lib/api/contracts/folders'
44
import { folderListHref } from '@/app/workspace/[workspaceId]/components/folders/search-params'
55

@@ -10,7 +10,7 @@ import { folderListHref } from '@/app/workspace/[workspaceId]/components/folders
1010
*/
1111
export type FolderedHeaderResourceType = Extract<
1212
FolderResourceType,
13-
'file' | 'knowledge_base' | 'table' | 'dashboard'
13+
'file' | 'knowledge_base' | 'table'
1414
>
1515

1616
export interface FolderedResourceHeaderMeta {
@@ -36,7 +36,6 @@ export const FOLDERED_RESOURCE_HEADERS: Record<
3636
file: { rootLabel: 'Files', rootIcon: FileIcon, listSegment: 'files' },
3737
knowledge_base: { rootLabel: 'Knowledge bases', rootIcon: Database, listSegment: 'knowledge' },
3838
table: { rootLabel: 'Tables', rootIcon: TableIcon, listSegment: 'tables' },
39-
dashboard: { rootLabel: 'Dashboards', rootIcon: ChartColumn, listSegment: 'dashboards' },
4039
}
4140

4241
/**

‎apps/sim/app/workspace/[workspaceId]/dashboards/[dashboardId]/page.tsx‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)