From 180fc0cabe68057e4146d030b85f0ab70c5f8f8c Mon Sep 17 00:00:00 2001 From: Matt Dray <18232097+matt-dray@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:42:13 +0100 Subject: [PATCH 1/4] Move sidebar layout under visualisations page --- R/app_ui.R | 85 +++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/R/app_ui.R b/R/app_ui.R index 1f31aca..269795a 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -10,37 +10,6 @@ app_ui <- function(request) { selected = "Visualisations", # start with this panel open fillable = FALSE, # scrollable pages (i.e. don't fit cards to window extent) - sidebar = bslib::sidebar( - id = "sidebar", - open = "closed", - width = 400, - bslib::accordion( - id = "sidebar_accordion", - open = FALSE, - multiple = TRUE, - bslib::accordion_panel( - title = "Datasets", - icon = bsicons::bs_icon("table"), - mod_select_geography_ui("mod_select_geography"), - mod_select_provider_ui("mod_select_provider") - ), - bslib::accordion_panel( - title = "Types of Potentially-Mitigatable Activity (TPMAs)", - icon = bsicons::bs_icon("hospital"), - mod_select_strategy_ui("mod_select_strategy") - ), - bslib::accordion_panel( - title = "Bookmark", - icon = bsicons::bs_icon("bookmark"), - shiny::bookmarkButton( - label = "Generate shareable URL", - title = "Bookmark your selections and get a URL for sharing", - icon = NULL - ) - ) - ) - ), - bslib::nav_panel( id = "nav_panel_overview", title = "Overview", @@ -99,17 +68,49 @@ app_ui <- function(request) { title = "Visualisations", icon = bsicons::bs_icon("graph-up"), - mod_show_strategy_text_ui("mod_show_strategy_text"), - mod_plot_rates_ui("mod_plot_rates"), - bslib::layout_columns( - col_widths = c(6, 6), - mod_table_diagnoses_ui("mod_table_diagnoses"), - mod_table_procedures_ui("mod_table_procedures") - ), - bslib::layout_columns( - col_widths = c(6, 6), - mod_plot_age_sex_pyramid_ui("mod_plot_age_sex_pyramid"), - mod_plot_nee_ui("mod_plot_nee") + bslib::layout_sidebar( + sidebar = bslib::sidebar( + id = "sidebar", + open = "open", # no longer needs to be toggled -- it only exists here + width = 400, + bslib::accordion( + id = "sidebar_accordion", + open = FALSE, + multiple = TRUE, + bslib::accordion_panel( + title = "Datasets", + icon = bsicons::bs_icon("table"), + mod_select_geography_ui("mod_select_geography"), + mod_select_provider_ui("mod_select_provider") + ), + bslib::accordion_panel( + title = "Types of Potentially-Mitigatable Activity (TPMAs)", + icon = bsicons::bs_icon("hospital"), + mod_select_strategy_ui("mod_select_strategy") + ), + bslib::accordion_panel( + title = "Bookmark", + icon = bsicons::bs_icon("bookmark"), + shiny::bookmarkButton( + label = "Generate shareable URL", + title = "Bookmark your selections and get a URL for sharing", + icon = NULL + ) + ) + ) + ), + mod_show_strategy_text_ui("mod_show_strategy_text"), + mod_plot_rates_ui("mod_plot_rates"), + bslib::layout_columns( + col_widths = c(6, 6), + mod_table_diagnoses_ui("mod_table_diagnoses"), + mod_table_procedures_ui("mod_table_procedures") + ), + bslib::layout_columns( + col_widths = c(6, 6), + mod_plot_age_sex_pyramid_ui("mod_plot_age_sex_pyramid"), + mod_plot_nee_ui("mod_plot_nee") + ) ) ), From 9738b4f91d8e1d14a326a2749880c6cdfe164426 Mon Sep 17 00:00:00 2001 From: Matt Dray <18232097+matt-dray@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:42:40 +0100 Subject: [PATCH 2/4] Remove observer that auto-hides/shows sidebar --- R/app_server.R | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index 79d467c..e144d1c 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -24,17 +24,6 @@ app_server <- function(input, output, session) { as.numeric(Sys.getenv("BASELINE_YEAR", 202324)) }) - # Open sidebar --- - shiny::observe({ - if (input$page_navbar == "Visualisations") { - # Sidebar options only relevant to visualisations - bslib::toggle_sidebar("sidebar", open = TRUE) - } else { - bslib::toggle_sidebar("sidebar", open = FALSE) - } - }) |> - shiny::bindEvent(input$page_navbar) - # Open sidebar accordions ---- shiny::observe({ # Data must load before accordions open From ad291060f655df216289d417af241e1537a8c919 Mon Sep 17 00:00:00 2001 From: Matt Dray <18232097+matt-dray@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:50:07 +0100 Subject: [PATCH 3/4] Update snapshot tests --- tests/testthat/_snaps/app_ui.md | 388 ++++++++++++++++---------------- 1 file changed, 193 insertions(+), 195 deletions(-) diff --git a/tests/testthat/_snaps/app_ui.md b/tests/testthat/_snaps/app_ui.md index 151480f..55b4769 100644 --- a/tests/testthat/_snaps/app_ui.md +++ b/tests/testthat/_snaps/app_ui.md @@ -3,7 +3,7 @@ Code ui Output - + -
-
From 5220209f7519aacac20ee4f2b72ef7a157068ea0 Mon Sep 17 00:00:00 2001 From: Matt Dray <18232097+matt-dray@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:54:43 +0100 Subject: [PATCH 4/4] Add YH as contributor --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index df9ad17..b3e8a70 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,7 +5,8 @@ Authors@R: c( person("Matt", "Dray", , "matt.dray@nhs.net", role = c("aut", "cre")), person("Tom", "Jemmett", , "thomas.jemmett@nhs.net", role = "aut"), person("Zoë", "Turner", , "zoe.turner3@nhs.net", role = "ctb"), - person("Claire", "Welsh", , "claire.welsh8@nhs.net", role = "ctb") + person("Claire", "Welsh", , "claire.welsh8@nhs.net", role = "ctb"), + person("YiWen", "Hon", , "yiwen.hon@nhs.net", role = "ctb") ) Description: A Shiny-app-in-a-package to explore data related to Types of Potentially-Mitigatable Activity (TPMAs) with the goal of finding