Skip to content

feat(menu): reorganize sidebar with banded ordering and grouped headers - #97

Merged
antosubash merged 4 commits into
mainfrom
feature/interesting-mayer-4fbac3
May 1, 2026
Merged

feat(menu): reorganize sidebar with banded ordering and grouped headers#97
antosubash merged 4 commits into
mainfrom
feature/interesting-mayer-4fbac3

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Reorganizes the sidebar so installed modules cluster into coherent visual groups instead of an interleaved flat list.

  • Banded MENU_ORDER — adopted stable ranges (10–99 content, 100–199 administration, 200+ system) and resolved two pre-existing order conflicts (settings vs. users at 30, datasets vs. file_storage at 40 — both moot post-merge but the framework-level convention now stands for any module that gets added back).
  • group field on MenuItem — new optional group: str = "" ships through the existing get_for_user() payload to the frontend.
  • Grouped sidebar renderingSidebarLayout clusters consecutive items by group, prints an uppercase muted heading per non-empty group, and leaves ungrouped items (Dashboard) flat at the top. Each group's position is set by the lowest-order item that joins it, so backend-side reordering Just Works.
  • Built-in module assignments
    • Content → File Storage (and would cover Products/Datasets if reintroduced)
    • Administration → Users, Feature Flags, Background Tasks
    • System → Settings
  • Convention documented in docs/framework-conventions.md so future modules pick the right band/group.
  • Scaffold updatedmake new-module emits group="Content" by default.
  • Two new tests in framework/core/tests/test_menu.py cover the default empty group and group serialization.

This branch was developed before upstream #96 removed the products and datasets modules; the merge accepted those deletions, so the order/group changes for those two modules are gone but the framework-level mechanism (and assignments for the surviving modules) is intact.

Test plan

  • uv run pytest -q — 945 passed
  • uv run python -m simple_module_core (sm doctor) — clean
  • uv run ruff format --check . && uv run ruff check . && uv run ty check — all green
  • make ci-js-typecheck — all workspaces green
  • Manual visual check of the sidebar in make dev (skipped — no UI session in this run; reviewer to verify if desired)

antosubash added 4 commits May 1, 2026 00:34
Adds a `group` field on `MenuItem` so the sidebar clusters items under
"Content", "Administration", and "System" headers. Reorders module
`MENU_ORDER` values into stable bands (10–99 content, 100–199 admin,
200+ system) and resolves two pre-existing order conflicts (settings
vs. users at 30, datasets vs. file_storage at 40).
…ayer-4fbac3

# Conflicts:
#	modules/datasets/datasets/constants.py
#	modules/datasets/datasets/module.py
#	modules/products/products/module.py
@antosubash
antosubash merged commit 5d76dc5 into main May 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant