Skip to content

DashboardEngine: named saved views / bookmarks (saveView / goToView / listViews / removeView) — capture & restore page + time window #346

Description

@HanSur94

Problem / motivation

FastSense's stated core value (PROJECT.md / STATE.md) is that an engineer can "ingest a million-sample sensor stream, monitor thresholds, build sub-second-responsive dashboards, and navigate it all" from one app. The navigation primitives already exist on DashboardEngine:

But there is no way to save a view and return to it. On a long recording, once an engineer scrubs to an interesting window — a startup transient, a spike, an alarm burst — they cannot mark it and come back after navigating elsewhere. They must remember or retype the datenum bounds (and the page). This is the missing half of navigation: you can move the window, but you can't bookmark one.

Verified there is no existing capability: grep -rniE "saveView |goToView|bookmark|namedView" over libs/ returns nothing, and gh issue list --state all --search "saved view bookmark named view jump time window" returns nothing.

Proposed feature

A small named-view store on DashboardEngine — the standard dashboard "saved views / bookmarks" pattern (Grafana/Chronograf), applied to FastSense's navigation core:

d.saveView('startup transient');     % capture current page + time window
names = d.listViews();               % -> cellstr of saved-view names
d.goToView('startup transient');     % restore: switchPage + setTimeWindow
d.removeView('startup transient');

Rough sketch

  • Lib/class: libs/Dashboard/DashboardEngine.m (public API); optional +1 field in libs/Dashboard/DashboardSerializer.m for persistence.
  • State: a private SavedViews_ (containers.Map name → struct, or struct array).
  • saveView(name) — record struct('name', name, 'pageIdx', obj.ActivePageIdx, 'timeWindow', obj.getTimeWindow()). A full-range bookmark stores timeWindow = [].
  • goToView(name)obj.switchPage(v.pageIdx), then obj.setTimeWindow(v.timeWindow(1), v.timeWindow(2)) (or setTimeWindow([], []) when empty). Error with a namespaced ID (DashboardEngine:unknownView) listing valid names if name is absent.
  • listViews() — return saved-view names as a cellstr.
  • removeView(name) — drop one entry.
  • Optional persistence: serialize SavedViews_ as a new savedViews config field in DashboardSerializer save/load so bookmarks survive a round-trip (can be a follow-up; see constraints).

Value

High, for the exact target workflow. A one-call d.saveView('anomaly 14:32') / d.goToView('anomaly 14:32') restores both the page and the exact [t0 t1] — turning ad-hoc scrubbing on long recordings into repeatable, named navigation. Directly serves the project's stated core value; a universal, expected dashboard pattern.

Constraints check

  • Toolbox-free: yes — containers.Map + existing engine methods; no toolbox.
  • Pure MATLAB/Octave: yes — reuses switchPage / setTimeWindow / getTimeWindow.
  • Backward-compatible: yes — purely additive public methods + a new private field. A serialized config with no savedViews field round-trips exactly as today (absent = empty), so existing scripts and serialized dashboards keep working. No change to the DashboardWidget / Tag contracts.
  • Note for triage: if bookmarks should persist across save/load (vs. session-only), that adds the one DashboardSerializer field above — still additive and backward-compatible, but a scope choice worth an explicit decision.

Effort estimate

S–M — four small methods on DashboardEngine reusing existing primitives; optional +1 serializer field for persistence. Suite test: save a view on page 2 with a set window, switch away, goToView, assert page index + getTimeWindow() restored.

Distinct from existing issues


AI-proposed via /feature-scout — needs a human product decision before implementation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions