feat: add two-view architecture with sidebar navigation (Task 10.2)

- Add active_view and selected_comparison_directorate to app-state
- Sidebar: rename to Patient Pathways + add Trust Comparison nav item
- View container pattern: two view divs toggled by active_view
- Navigation callback: sidebar clicks switch views + update active state
- Trust Comparison placeholder landing page with tc-landing structure
This commit is contained in:
Andrew Charlwood
2026-02-06 21:38:12 +00:00
parent 94b1ac640a
commit 7d51efc25e
6 changed files with 116 additions and 19 deletions
+51 -3
View File
@@ -26,6 +26,8 @@ app.layout = dmc.MantineProvider(
"selected_drugs": [],
"selected_directorates": [],
"selected_trusts": [],
"active_view": "patient-pathways",
"selected_comparison_directorate": None,
}),
dcc.Store(id="chart-data", storage_type="memory"),
dcc.Store(id="reference-data", storage_type="session"),
@@ -39,9 +41,55 @@ app.layout = dmc.MantineProvider(
html.Main(
className="main",
children=[
make_kpi_row(),
make_filter_bar(),
make_chart_card(),
# View container — switched by active_view in app-state
html.Div(
id="view-container",
children=[
# Patient Pathways view (default, visible)
html.Div(
id="patient-pathways-view",
children=[
make_kpi_row(),
make_filter_bar(),
make_chart_card(),
],
),
# Trust Comparison view (hidden initially)
html.Div(
id="trust-comparison-view",
style={"display": "none"},
children=[
html.Div(
className="tc-landing",
id="trust-comparison-landing",
children=[
html.Div(
className="tc-landing__header",
children=[
html.H2(
"Trust Comparison",
className="tc-landing__title",
),
html.P(
"Select a directorate to compare drug usage across trusts.",
className="tc-landing__desc",
id="tc-landing-desc",
),
],
),
html.Div(
className="tc-landing__grid",
id="tc-landing-grid",
children=[
# Populated by callback in later task
],
),
],
),
],
),
],
),
make_footer(),
],
),