Skip to main content

lattice_dashboard/
options.rs

1//! Dashboard configuration, owned by the dashboard subsystem
2//! ([[feedback_mode_owns_its_surface]]), not host core. Self-registers via
3//! `linkme` like every other `options!` block; the host's
4//! `init_from_linkme()` walks the global slice at boot, so linking
5//! `lattice-dashboard` into the binary (it always is — `install` runs in the
6//! Phase-B list, DB.2) picks these up automatically.
7//!
8//! Three options (see docs/dev/architecture/dashboard.md §8):
9//!
10//! - `dashboard.enabled` — auto-open `*dashboard*` on launch with no file arg.
11//! - `dashboard.sections` — ordered section ids to show. The config system
12//!   has no native list type, so the v1 encoding is a comma/whitespace-
13//!   separated string parsed by [`SectionSelection::parse`](crate::SectionSelection::parse).
14//!   Empty ⇒ all built-ins in default order; a list ⇒ exactly those ids in
15//!   that order.
16//! - `dashboard.source` — path to a user file that fully replaces section
17//!   composition. Empty ⇒ unset. A missing/unreadable path falls back to the
18//!   sections with a warning (DB.6), never a panic.
19
20lattice_config::groups! {
21    /// The dashboard launch page.
22    pub Dashboard = "dashboard";
23}
24
25lattice_config::options! {
26    group = Dashboard;
27
28    /// Open the `*dashboard*` launch page when the editor starts with no
29    /// file argument. `:dashboard` opens it on demand regardless.
30    #[name("dashboard.enabled")]
31    pub DashboardEnabled: bool = true;
32
33    /// Ordered section ids to show, comma/whitespace-separated. Empty (the
34    /// default) shows every built-in section in its default order. Listing
35    /// ids both selects and reorders — an id present shows in this position,
36    /// an id omitted is hidden. Unknown ids are skipped.
37    #[name("dashboard.sections")]
38    pub DashboardSections: String = String::new();
39
40    /// Path to a file whose contents fully replace the composed sections —
41    /// the "author the entire dashboard" escape hatch. Empty (the default)
42    /// uses section composition. A missing or unreadable path falls back to
43    /// the sections with a logged warning.
44    #[name("dashboard.source")]
45    pub DashboardSource: String = String::new();
46}