Rebuild section data from an autosave data.frame
Source:R/helpers_autosave.R
build_sections_from_autosave.RdThis helper mirrors the logic in autosave_module_server() when loading an auto-save file, but returns a plain R structure instead of touching reactives. It supports both the "new" schema (group_id + section mapping) and the legacy schema (Group column with section IDs).
Arguments
- autosave_df
A data.frame of taxa (i.e. with Title/Date/schema_version columns already removed). It should contain either:
columns
group_idandsection_id(new schema), orcolumn
Groupcontaining section IDs (legacy schema).
- group_defs
A data.frame with columns:
section_id
group_id
group_name used to map group_id back to section_id in the new schema.
Value
A named list. Each element name is a section_id (e.g. "section_1"),
and each value is a list with component data, which is itself a list of
rows (id, taxon, dipnet1, dipnet2, tsn, parentTsn). Returns an empty list
if there is no usable data. Throws an error if required grouping columns
are missing.