shinyplanr 0.1.8
New features
-
Category display order (sidebar sliders, checkbox groups, Cost/Climate dropdowns, and the Layer Information dropdowns) is now explicit and consistent across the whole app, driven by a new internal helper,
forder_dict_categories().- Categories are grouped by their “master category” (
Dict$type), always shown in the fixed order:Feature->Bioregion->Cost->Climate->LockIn->LockOut->EcosystemServices. This mirrors the existing hardcoded sidebar section order in the Scenario tab. - Within a
type, categories are ordered by a new optional numericcategoryOrdercolumn inDict_Feature.csv. IfcategoryOrderis absent, category order falls back to the pre-existing default (alphabetical bycategoryID) – fully backward compatible with dictionaries created before this release. -
Dict$categoryis now an ordered factor (not a plain character column) once3_setup_app.Rhas run. This letsdplyr::arrange()/dplyr::group_by()consumers (dropdowns,spatialplanrbar charts) automatically follow the same order as the sidebar sliders, which rely onDictrow order. - See
vignette("ac-setting-up"), section “Controlling category order”, for how to setcategoryOrder.
- Categories are grouped by their “master category” (
-
validate_dict()gained two new checks:-
categoryIDmust be identical across every row sharing the same (type,category) combination. Previously, an inconsistent or blankcategoryIDon some rows of a category was silently ignored (viadplyr::first()), producing confusing results that depended on row order rather than raising an error. - If present,
categoryOrdermust be numeric and identical across every row sharing the same (type,category) combination.
-
Bug fixes
- Fixed a latent bug where
categoryIDinconsistency within a category (e.g. blank on some rows) was silently tolerated rather than causing master-category sliders / bioregion display columns to behave unpredictably. This is now caught byvalidate_dict()(see above).
Internal changes
-
create_fancy_dropdown()(R/utils_ui.R) and the interactive Layer Information dropdown builder (R/mod_4afeatures.R) now explicitly coerce the grouping category tocharacterbefore passing it topurrr::map_chr(), since that function does not coerce factors and would error onceDict$categorybecame an ordered factor. -
inst/templates/setup/3_setup_app.Rnow callsshinyplanr:::forder_dict_categories()instead ofdplyr::arrange(type, categoryID)when buildingDict. - The generated
Dict_Feature.csvtemplates (both the oceandatr-based and minimal manual templates) now include an examplecategoryOrdercolumn.
No config_list keys were added, removed, or renamed, so the config schema version (get_schema_version()) is unchanged at 2.
