add SPA config UI, wire media/rss adapters, event-driven layout push
- React SPA: dashboard, data sources CRUD, widgets CRUD, layout builder, presets. TanStack Router + Query, shadcn/ui, Vite proxy to :3000 - wire media + rss adapters into polling loop, remove xtb source type - media adapter: read username/password from headers, proper subsonic auth - event handler: subscribe to LayoutChanged, push screen update to clients - fix clippy warnings across workspace (Default impls, collapsible ifs, redundant closures, is_none_or, unused imports)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use std::collections::BTreeSet;
|
||||
use domain::{
|
||||
ContainerNode, Direction, Layout, LayoutChild, LayoutNode, LayoutValidationError, Sizing,
|
||||
WidgetId,
|
||||
};
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
fn leaf(id: WidgetId) -> LayoutChild {
|
||||
LayoutChild {
|
||||
@@ -22,14 +22,18 @@ fn row(children: Vec<LayoutChild>) -> LayoutNode {
|
||||
|
||||
#[test]
|
||||
fn validate_returns_empty_when_all_widgets_exist() {
|
||||
let layout = Layout { root: row(vec![leaf(1), leaf(2)]) };
|
||||
let layout = Layout {
|
||||
root: row(vec![leaf(1), leaf(2)]),
|
||||
};
|
||||
let known = BTreeSet::from([1, 2]);
|
||||
assert!(layout.validate(&known).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn validate_reports_unknown_widget_ids() {
|
||||
let layout = Layout { root: row(vec![leaf(1), leaf(99)]) };
|
||||
let layout = Layout {
|
||||
root: row(vec![leaf(1), leaf(99)]),
|
||||
};
|
||||
let known = BTreeSet::from([1]);
|
||||
let errors = layout.validate(&known);
|
||||
assert_eq!(errors, vec![LayoutValidationError::UnknownWidget(99)]);
|
||||
@@ -49,7 +53,9 @@ fn validate_checks_nested_containers() {
|
||||
sizing: Sizing::Flex(1),
|
||||
node: row(vec![leaf(1), leaf(42)]),
|
||||
};
|
||||
let layout = Layout { root: row(vec![inner, leaf(2)]) };
|
||||
let layout = Layout {
|
||||
root: row(vec![inner, leaf(2)]),
|
||||
};
|
||||
let known = BTreeSet::from([1, 2]);
|
||||
let errors = layout.validate(&known);
|
||||
assert_eq!(errors, vec![LayoutValidationError::UnknownWidget(42)]);
|
||||
@@ -61,6 +67,8 @@ fn widget_ids_collects_all_leaf_ids() {
|
||||
sizing: Sizing::Flex(1),
|
||||
node: row(vec![leaf(3)]),
|
||||
};
|
||||
let layout = Layout { root: row(vec![leaf(1), inner, leaf(2)]) };
|
||||
let layout = Layout {
|
||||
root: row(vec![leaf(1), inner, leaf(2)]),
|
||||
};
|
||||
assert_eq!(layout.widget_ids(), BTreeSet::from([1, 2, 3]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user