- Moved Stalker-related components and services from apps/web to libs/portal for better modularity. - Introduced SQLite DB Worker to handle non-EPG database operations, improving UI responsiveness. - Updated documentation for the Workspace Dashboard and Shell, detailing current implementation and routing structure. - Added new EPG fixture scenarios to the Xtream mock server for testing purposes. - Enhanced the overall architecture documentation to reflect recent changes and improvements.
4.4 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.
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.
- 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.