Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Engineering reference: For service contracts, EventBus events, and data-layer details see src/features/dashboard/dashboard.md.
Dashboard
Overview
Thedashboard feature manages role-based dashboard template editing — allowing administrators to configure which widgets appear for each role, in what layout, and whether those templates propagate to existing user dashboards.
Individual widget implementations live in features/widgets/. The dashboard feature owns the template editor UI that assembles, reorders, and saves widget configurations per role.
Entry point: DashboardTabs.tsx — serves as the page container with tabs for template roles.
Data Model
Firestore Collections
Dashboard template configurations are persisted in the organizations settings/config collection. The specific document path is managed by the widget system.| Collection | Document type | Description |
|---|---|---|
organizations/{id}/config/dashboardTemplates | DashboardTemplate | Per-role widget layout configurations |
Key TypeScript Types
DashboardTemplate and Widget types are owned by features/widgets.
Key Behaviors
Template Editor
DashboardTemplateEditor (in components/DashboardTemplateEditor/) is the main editing surface. It consists of:
RoleTabsSection— tab strip for selecting which role’s template to edit (admin, manager, member, auditor, etc.)TemplateCanvasSection— drag-and-drop canvas of current widgets for the selected roleAddWidgetModal— widget picker that lets admins browse and add widgets to the templateActionsSection— save/discard actions, including the “apply to existing dashboards” toggle
DashboardTemplateEditorContext holds the editor’s full in-progress state (selected role, current layout, dirty flag) and is scoped to the editor session.
Apply to Existing
When saving a template, theapplyToExisting flag (managed by useDashboardTemplateEditorModalState) controls whether the saved layout is also pushed to all existing user dashboards that use that role’s template, or only affects new users going forward.
Tab Structure
DashboardTabs.tsx is the top-level page component. It provides tab navigation between role templates (not rendered via tab content prop — follows the PageTabs pattern where content is rendered externally).
Service Contract
| Component/Hook | Owns | Key interface |
|---|---|---|
DashboardTemplateEditorContext | In-progress editor state | Selected role, widget list, dirty state, save/discard |
useDashboardTemplateEditorModalState | Modal UI state | applyToExisting, showAddWidgetModal |
ModalStateContext | Modal open/close state | Shared between editor components |
Events
Emitted
None. Template saves are direct Firestore writes; no EventBus events are emitted by this feature.Consumed
None.Dependencies
Depends on:features/widgets— widget types, widget catalog, persistence servicecontexts/TenantContext— current organization for scoping templatescontexts/RBACContext— role list for tab generation
- App shell routing —
DashboardTabsis a route-level page component