GRI-2072: left sub-menu per section; playlist tabs for Media/Devices/Settings #218

Merged
vivy merged 5 commits from feature/GRI-2072-panel-left-submenu-nav into dev 2026-11-15 11:21:13 +00:00
Member

Summary

Closes #210.

  • Settings used to be one page mixing network/sign-in config, the global playback default and the "restart now" controls, plus IP rules as its own separate top-level tab. It now has a left sub-menu with its own URLs: Playback defaults (/settings), Campuses (/settings/campuses, read-only list — adding/editing one is #207), and Network / IP rules (/settings/network, merging in the old /ip-rules page). A campus-scoped settings_manage holder still sees just their own campus's playback default, with no menu to split it from. /ip-rules redirects into Settings. Either settings_manage or devices_approve now reaches the Settings tab (each section inside still checks its own permission), where before devices_approve alone had no way back to IP rules once it stopped being a top-level tab.
  • A playlist's editor splits into left tabs with their own URLs: Media (default, /playlists/{id}, unchanged items/order/duration/page-override behaviour), Devices (/playlists/{id}/devices, the existing assignment form — unassigning is #209, live rollout status is a separate follow-up not wired into the UI yet), and Settings (/playlists/{id}/settings: rename via the existing update_playlist endpoint, campus shown read-only since the server has no route to move a playlist afterwards, and delete via the existing delete_playlist endpoint).
  • Creating a playlist moved from an inline form on the list page to a small dialog (name, and a campus picker for a global admin — a campus-scoped editor gets none, since their own campus always wins server-side), landing straight on the new playlist's Media tab, per the product owner's proposal on the issue.
  • The top bar gains a Dashboard tab (a minimal landing page) and drops the standalone IP rules tab.
  • New SectionNav/SectionLayout (src/SectionNav.tsx) is the one left-menu implementation both Settings and the playlist editor use — a nav with aria-current="page" on the active entry.

Test plan

  • npm run check (prettier, oxlint, tsc, vitest) — all green, 66/66 tests.
  • scripts/local-gates.sh --frontend-only — every gate passes, including the frontend production build.
  • Manually traced loading/empty/error states for the new/changed screens (Overview, CampusesTab, PlaylistSettingsTab delete flow) against existing conventions (role="status"/role="alert" + retry).
  • Deep-linked to /settings/campuses, /settings/network, /playlists/{id}/devices, /playlists/{id}/settings in tests — each renders directly from the URL, matching the acceptance criterion that a reload keeps the tab.
  • Not run in a real browser (no UI sandbox in this environment) — please sanity-check keyboard/visual layout of the two-column gx-section nav before merge.
## Summary Closes #210. - Settings used to be one page mixing network/sign-in config, the global playback default and the "restart now" controls, plus IP rules as its own separate top-level tab. It now has a left sub-menu with its own URLs: **Playback defaults** (`/settings`), **Campuses** (`/settings/campuses`, read-only list — adding/editing one is #207), and **Network / IP rules** (`/settings/network`, merging in the old `/ip-rules` page). A campus-scoped `settings_manage` holder still sees just their own campus's playback default, with no menu to split it from. `/ip-rules` redirects into Settings. Either `settings_manage` or `devices_approve` now reaches the Settings tab (each section inside still checks its own permission), where before `devices_approve` alone had no way back to IP rules once it stopped being a top-level tab. - A playlist's editor splits into left tabs with their own URLs: **Media** (default, `/playlists/{id}`, unchanged items/order/duration/page-override behaviour), **Devices** (`/playlists/{id}/devices`, the existing assignment form — unassigning is #209, live rollout status is a separate follow-up not wired into the UI yet), and **Settings** (`/playlists/{id}/settings`: rename via the existing `update_playlist` endpoint, campus shown read-only since the server has no route to move a playlist afterwards, and delete via the existing `delete_playlist` endpoint). - Creating a playlist moved from an inline form on the list page to a small dialog (name, and a campus picker for a global admin — a campus-scoped editor gets none, since their own campus always wins server-side), landing straight on the new playlist's Media tab, per the product owner's proposal on the issue. - The top bar gains a **Dashboard** tab (a minimal landing page) and drops the standalone **IP rules** tab. - New `SectionNav`/`SectionLayout` (`src/SectionNav.tsx`) is the one left-menu implementation both Settings and the playlist editor use — a `nav` with `aria-current="page"` on the active entry. ## Test plan - [x] `npm run check` (prettier, oxlint, tsc, vitest) — all green, 66/66 tests. - [x] `scripts/local-gates.sh --frontend-only` — every gate passes, including the frontend production build. - [x] Manually traced loading/empty/error states for the new/changed screens (Overview, CampusesTab, PlaylistSettingsTab delete flow) against existing conventions (`role="status"`/`role="alert"` + retry). - [x] Deep-linked to `/settings/campuses`, `/settings/network`, `/playlists/{id}/devices`, `/playlists/{id}/settings` in tests — each renders directly from the URL, matching the acceptance criterion that a reload keeps the tab. - [ ] Not run in a real browser (no UI sandbox in this environment) — please sanity-check keyboard/visual layout of the two-column `gx-section` nav before merge.
GRI-2072: give every section a left sub-menu, and playlist tabs for Media/Devices/Settings
All checks were successful
CI / the pre-push hook (pull_request) Successful in 1m3s
CI / cargo fmt (pull_request) Successful in 49s
CI / cargo deny (pull_request) Successful in 1m59s
CI / cargo deny advisories (pull_request) Successful in 1m58s
CI / cargo clippy (pull_request) Successful in 2m52s
CI / repository boundary (pull_request) Successful in 1m15s
CI / frontend-web (pull_request) Successful in 3m22s
CI / cargo test (pull_request) Successful in 5m46s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 37s
6301f8fad6
Settings used to mix network config, playback defaults and the "restart
now" controls on one page, with IP rules as a separate top-level tab;
Playlists mixed items, device assignment and creation on one page too.

Each section now gets a left sub-menu of its own pages, each with its own
URL: Settings splits into Playback defaults / Campuses / Network (merging
in the old IP rules page) / IP rules, and a playlist's editor splits into
Media (default) / Devices / Settings (name, campus, delete). Creating a
playlist moved from an inline form on the list page to a small dialog
(name, campus for a global admin), landing straight on the new playlist's
Media tab. The top bar gains a Dashboard tab and drops the standalone IP
rules tab; an old /ip-rules link redirects into Settings.
Merge branch 'dev' into feature/GRI-2072-panel-left-submenu-nav
All checks were successful
CI / the pre-push hook (pull_request) Successful in 34s
CI / cargo fmt (pull_request) Successful in 30s
CI / cargo deny (pull_request) Successful in 2m5s
CI / cargo clippy (pull_request) Successful in 2m48s
CI / cargo deny advisories (pull_request) Successful in 1m48s
CI / repository boundary (pull_request) Successful in 44s
CI / frontend-web (pull_request) Successful in 1m46s
CI / cargo test (pull_request) Successful in 4m23s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 55s
498e7d5ae8
vivy requested changes 2026-11-15 11:02:01 +00:00
Dismissed
vivy left a comment

One regression; the rest is good (merges clean with dev after #212, no old product name left, PATCH /playlists/{id} exists on the server, New playlist is a dialog as agreed).

Campus-scoped users lose IP rules. On dev, /ip-rules needs only devices_approve and has no campus check, and the server serves campus users too: list_ip_rules filters auto_approve by current.may_access(rule.campus_id) (crates/server/src/devices/handlers.rs:381). In SettingsSectionScreen.tsx:

  1. if (canManagePlayback && user.campusId) return <CampusSettingsScreen …/> returns before any menu, so a campus user with settings_manage and devices_approve can no longer reach IP rules at all.
  2. The Network entry is gated on isGlobal, so a campus user with only devices_approve gets the Settings tab in the top bar (DashboardScreen allows it) and an empty page with an empty menu. /ip-rules redirects them there too.

Fix: for campus users, show a menu with Playback defaults (CampusSettingsScreen, if settings_manage) and IP rules (if devices_approve). Global-only network config can stay global-only. Add a test for each of the two cases above, and one asserting that the Settings tab never renders an empty menu.

One regression; the rest is good (merges clean with dev after #212, no old product name left, PATCH /playlists/{id} exists on the server, New playlist is a dialog as agreed). **Campus-scoped users lose IP rules.** On dev, `/ip-rules` needs only `devices_approve` and has no campus check, and the server serves campus users too: `list_ip_rules` filters `auto_approve` by `current.may_access(rule.campus_id)` (`crates/server/src/devices/handlers.rs:381`). In `SettingsSectionScreen.tsx`: 1. `if (canManagePlayback && user.campusId) return <CampusSettingsScreen …/>` returns before any menu, so a campus user with `settings_manage` **and** `devices_approve` can no longer reach IP rules at all. 2. The Network entry is gated on `isGlobal`, so a campus user with only `devices_approve` gets the Settings tab in the top bar (DashboardScreen allows it) and an **empty page with an empty menu**. `/ip-rules` redirects them there too. Fix: for campus users, show a menu with *Playback defaults* (CampusSettingsScreen, if `settings_manage`) and *IP rules* (if `devices_approve`). Global-only network config can stay global-only. Add a test for each of the two cases above, and one asserting that the Settings tab never renders an empty menu.
Fixed the review's regression: a campus user with settings_manage and
devices_approve hit the early CampusSettingsScreen return and lost IP
rules entirely, and a campus devices_approve holder with no settings
permission hit an empty Settings menu gated on isGlobal. Both now get a
menu (Playback defaults if settings_manage, IP rules if devices_approve),
and the network-config fields stay global-only.
Merge remote-tracking branch 'origin/feature/GRI-2072-panel-left-submenu-nav' into feature/GRI-2072-panel-left-submenu-nav
All checks were successful
CI / the pre-push hook (pull_request) Successful in 1m11s
CI / cargo fmt (pull_request) Successful in 1m11s
CI / cargo clippy (pull_request) Successful in 2m0s
CI / cargo deny advisories (pull_request) Successful in 2m26s
CI / cargo deny (pull_request) Successful in 2m28s
CI / repository boundary (pull_request) Successful in 54s
CI / frontend-web (pull_request) Successful in 3m15s
CI / cargo test (pull_request) Successful in 4m33s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 22s
350247fe05
Author
Member

Fixed: SettingsSectionScreen no longer returns CampusSettingsScreen early when the user also holds devices_approve — that case now gets a menu (Playback defaults + IP rules). A campus user with only devices_approve now gets a menu with just IP rules instead of an empty page gated on isGlobal; NetworkSettingsTab gets canManageNetwork={canManagePlayback && isGlobal} so the network-config fields stay global-only. Added the two requested tests plus one asserting the menu is never empty for a campus devices_approve holder (all three pass).

Merged origin/dev (brings in #212 and #215) — clean, no conflicts.

Verified: npm run check (68/68 tests) and scripts/local-gates.sh --frontend-only both pass. Pushed as 350247f.

Fixed: `SettingsSectionScreen` no longer returns `CampusSettingsScreen` early when the user also holds `devices_approve` — that case now gets a menu (Playback defaults + IP rules). A campus user with only `devices_approve` now gets a menu with just IP rules instead of an empty page gated on `isGlobal`; `NetworkSettingsTab` gets `canManageNetwork={canManagePlayback && isGlobal}` so the network-config fields stay global-only. Added the two requested tests plus one asserting the menu is never empty for a campus devices_approve holder (all three pass). Merged `origin/dev` (brings in #212 and #215) — clean, no conflicts. Verified: `npm run check` (68/68 tests) and `scripts/local-gates.sh --frontend-only` both pass. Pushed as 350247f.
vivy approved these changes 2026-11-15 11:21:10 +00:00
vivy left a comment

57ee74b fixes both cases: a campus user with settings_manage + devices_approve keeps IP rules, and a campus approver-only user gets an IP rules menu instead of an empty page. The network fields stay global-only. Both have tests. Approved on 350247fe.

57ee74b fixes both cases: a campus user with settings_manage + devices_approve keeps IP rules, and a campus approver-only user gets an IP rules menu instead of an empty page. The network fields stay global-only. Both have tests. Approved on 350247fe.
vivy merged commit f4a0709fc1 into dev 2026-11-15 11:21:13 +00:00
vivy deleted branch feature/GRI-2072-panel-left-submenu-nav 2026-11-15 11:21:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!218
No description provided.