From 145d9d5dcb1007d9e98b81c48f1574da1a2b7ec0 Mon Sep 17 00:00:00 2001 From: Frederik Baerentsen Date: Thu, 2 Oct 2025 14:35:37 +0200 Subject: [PATCH] feat(admin): database is expanded by default --- .env.sample | 3 ++- CHANGELOG.md | 7 +++++++ bricktracker/config.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.env.sample b/.env.sample index 58b2ce4..3428e96 100644 --- a/.env.sample +++ b/.env.sample @@ -99,10 +99,11 @@ # Optional: Admin sections to expand by default (comma-separated list) # Valid sections: authentication, instructions, image, theme, retired, metadata, owner, purchase_location, status, storage, tag, database -# Default: [] (all sections collapsed) +# Default: database (maintains original behavior with database section expanded) # Examples: # BK_ADMIN_DEFAULT_EXPANDED_SECTIONS=database,theme # BK_ADMIN_DEFAULT_EXPANDED_SECTIONS=instructions,metadata +# BK_ADMIN_DEFAULT_EXPANDED_SECTIONS= (all sections collapsed) # Optional: Hide the 'Instructions' entry from the menu. Does not disable the route. # Default: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 94c5e05..f071f2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,13 @@ - Collapsible sections: All statistics sections have clickable headers to expand/collapse - Collection growth charts: Line charts showing sets, parts, and minifigures over time - Configuration options: `BK_STATISTICS_SHOW_CHARTS` and `BK_STATISTICS_DEFAULT_EXPANDED` environment variables +- Add configurable admin page section expansion + - `BK_ADMIN_DEFAULT_EXPANDED_SECTIONS`: Environment variable to specify which sections expand by default + - Accepts comma-separated list of section names (e.g., "database,theme,instructions") + - Valid sections: authentication, instructions, image, theme, retired, metadata, owner, purchase_location, status, storage, tag, database + - URL parameters take priority over configuration (e.g., `?open_database=1`) + - Database section expanded by default to maintain original behavior + - Smart metadata handling: sub-section expansion automatically expands parent metadata section ### 1.2.4 diff --git a/bricktracker/config.py b/bricktracker/config.py index 3ebd747..b5e5398 100644 --- a/bricktracker/config.py +++ b/bricktracker/config.py @@ -25,7 +25,7 @@ CONFIG: Final[list[dict[str, Any]]] = [ {'n': 'HIDE_ADD_SET', 'c': bool}, {'n': 'HIDE_ADD_BULK_SET', 'c': bool}, {'n': 'HIDE_ADMIN', 'c': bool}, - {'n': 'ADMIN_DEFAULT_EXPANDED_SECTIONS', 'd': [], 'c': list}, + {'n': 'ADMIN_DEFAULT_EXPANDED_SECTIONS', 'd': ['database'], 'c': list}, {'n': 'HIDE_ALL_INSTRUCTIONS', 'c': bool}, {'n': 'HIDE_ALL_MINIFIGURES', 'c': bool}, {'n': 'HIDE_ALL_PARTS', 'c': bool},