5.2 KiB
Workspace Dashboard
This document records the current dashboard implementation inside the workspace shell. It replaces the earlier dashboard plan document.
Related:
Summary
- The dashboard is the default
/workspacelanding page. - It is a widget-based surface with persisted layout and widget settings.
- The current implementation favors a constrained, stable layout over a full freeform grid system.
Core implementation:
libs/workspace/dashboard/feature/src/lib/workspace-dashboard.component.tslibs/workspace/dashboard/feature/src/lib/workspace-dashboard.component.htmllibs/workspace/dashboard/ui/src/lib/dashboard-widget-host.component.tslibs/workspace/dashboard/data-access/src/lib/dashboard-widget.model.tslibs/workspace/dashboard/data-access/src/lib/dashboard-layout.service.tslibs/workspace/dashboard/data-access/src/lib/dashboard-data.service.ts
Current Widget Set
Registered widget types:
source-statscontinue-watchingrecently-watchedglobal-favorites
Default layout:
continue-watching- Enabled by default
- Size
full
recently-watched- Enabled by default
- Size
two-thirds - Scope-aware
global-favorites- Enabled by default
- Size
one-third - Scope-aware
source-stats- Present in the registry
- Disabled by default
- Size
one-third
The old refactor summary mentioned Recent Sources, but that widget is not in
the current registry and should not be documented as shipped behavior.
Layout And Persistence Contract
The dashboard persists a versioned layout object in local storage.
Current storage details:
- Storage key:
workspace-dashboard-layout-v3 - Schema version:
12 - Size presets:
one-thirdhalftwo-thirdsfull
- Scope settings:
providers: Array<'m3u' | 'xtream' | 'stalker'>playlistIds: string[]
Normalization rules in DashboardLayoutService:
- Stored widgets are merged against
DEFAULT_DASHBOARD_WIDGETS. - Missing widgets are restored from defaults.
- Removed or invalid settings fall back to normalized defaults.
- Titles and descriptions come from the current code-defined defaults, not stale stored values.
- Widget order is reindexed after normalization.
Rendering Flow
WorkspaceDashboardComponentreadsDashboardLayoutService.state().- Enabled widgets are filtered and rendered in layout order.
DashboardWidgetHostComponentmapswidget.typeto a concrete widget component.- Widgets receive the normalized config, including size and optional scope.
- Data comes from
DashboardDataServiceand existing provider/state services. - Widget actions deep-link back into workspace/provider routes.
Dashboard detail handoff contract:
- Live items continue to activate their existing playback/provider route flows.
- Xtream and Stalker movies/series from
global-favoritesorrecently-watchedshould route into/workspace/global-favoritesor/workspace/global-recentwith collection detail pre-opened from navigation state. - Those collection detail opens must not switch the active playlist in the header playlist switcher.
- Those collection detail opens must not show the workspace category sidebar.
- The detail close/back action should return to the dashboard-origin view rather than reopening provider/category navigation.
Customize Mode
Customize mode is part of the current product, not future work.
Supported actions:
- Toggle widget visibility.
- Drag-and-drop reorder for visible widgets.
- Change widget size within the fixed preset list.
- Configure provider scope for scoped widgets.
- Configure playlist scope for scoped widgets.
- Reset the layout to defaults.
Scope-aware widgets currently rely on a provider/playlist filter model rather than per-widget custom query systems.
UX Rules
- Widgets should represent user tasks, not provider internals.
- Each widget must own its loading, empty, and error states.
- Dashboard failures must stay isolated to the widget that failed.
- Widget navigation should resolve directly into the relevant content context.
- Dashboard favorites/recent movie/series activations should preserve the current playlist context and use the collection-owned detail host instead of forcing provider/category side-navigation.
- New widgets should fit the existing constrained layout model unless the dashboard architecture is explicitly being expanded.
Adding Or Changing Widgets
Current workflow:
- Add or update the widget type in
dashboard-widget.model.ts. - Implement the widget UI under
libs/workspace/dashboard/ui/src/lib/widgets/. - Register the widget in
dashboard-widget-host.component.ts. - Add default state and migration-safe behavior in
dashboard-layout.service.ts. - Extend
dashboard-data.service.tsor reuse an existing feature service. - Ensure the widget has explicit empty/error/loading states and valid workspace deep links.
Deferred Work
These items are intentionally not part of the current contract:
- Freeform drag/resize grid with collision management.
- External data widgets such as RSS, sports, or news adapters.
- A widget marketplace or plugin system.