docs(quick-261022-imo): settings section panel scoped to the current category

This commit is contained in:
Jakub Zych
2026-10-22 13:54:08 +02:00
parent 80bb5aee3d
commit 51d088a3b2

View File

@@ -0,0 +1,88 @@
---
phase: quick-261022-imo
plan: 01
quick_id: 261022-imo
subsystem: admin
tags: [admin, shell, settings, navigation]
status: complete
requires:
- admin settings state (useSettings, settingsGroups) and the plugin SectionPanel / PluginRail collapse hand-off
provides:
- SettingsPanel.vue (category-scoped settings section panel)
- settingsSectionOf / SettingsSection in useSettings.ts
affects:
- AppShell section panel selection and --shell-offset
- modules/boardwalk/dist (embedded admin build)
tech-stack:
added: []
patterns:
- second level-2 panel chosen by AppShell (plugin SectionPanel first, SettingsPanel under v-else-if)
key-files:
created:
- admin/src/components/shell/SettingsPanel.vue
- admin/tests/shell/SettingsPanel.test.ts
modified:
- admin/src/state/useSettings.ts
- admin/src/components/shell/AppShell.vue
- admin/tests/shell/AppShell.test.ts
- admin/tests/state/useSettings.test.ts
- docs/backend/settings.md
- modules/boardwalk/dist
decisions:
- "Settings section panel lists only the current entry's category in settingsGroups order; hidden for one-entry categories, on /settings and when the plugin has its own navigation entry"
- "No settings flyout on the rail: /settings is one click away and is how category is switched (also on narrow viewports)"
requirements: [IMO-01, IMO-02, IMO-03, IMO-04, IMO-05, IMO-06]
metrics:
duration: ~6min
completed: 2026-10-22
tasks: 3
files: 8
actuals:
tokens: 5500 # chars/4 over the admin/ and docs/ diff (22120 chars); the regenerated minified dist is excluded
tasks: 3
commits: 3
plan_head_before: a97743a39f418b30663f6b6405d9ca14ebe8f02e
plan_head_after: 80bb5aee3d5bc93eb8f2a7924bd3d484d6733c32
commits: 3
---
# Phase quick-261022-imo Plan 01: Settings section panel scoped to category Summary
The admin shell now shows a 224px settings panel on settings forms and on settings-linked controllers that have no navigation entry of their own. It lists the permitted pages of the current entry's category in settingsGroups order and highlights the open page. It looks like the plugin side menu and collapses and expands the same way.
## What was built
- `settingsSectionOf(current)` and the `SettingsSection` type in `admin/src/state/useSettings.ts`. The function returns the current entry's category group from `settingsGroups`, or null when there is no current entry or the category has only one page. It is also returned from `useSettings()`.
- `admin/src/components/shell/SettingsPanel.vue` uses the same markup and classes as SectionPanel. It renders `aside[data-settings-panel]` with the category as its header, falling back to "Ustawienia" when the category is empty. Its links are `[data-settings-panel-item=<code>]` pointing to `settingsPath(entry)`, and the open page gets `aria-current="page"`. The collapse button `[data-sidebar-collapse]` collapses the panel and then moves focus to the rail's `[data-sidebar-expand]`. The header comment explains why the rail has no settings flyout.
- `AppShell.vue` gains a `settingsSection` computed. It is null when a plugin navigation entry is active. On `settings-form` routes it uses `settingsEntry(code)`, and otherwise `settingsLinkFor(controllerIdFromPath(path))`, which gives null on the /settings index. `--shell-offset` includes the panel width when either panel is showing.
- `docs/backend/settings.md`: the paragraph on linked controllers now mentions the panel, and a new "Moving between settings pages" section sits before "How values are stored".
- `modules/boardwalk/dist` was rebuilt; `scripts/check-admin-dist.sh` reports that it matches a fresh build.
## Commits
| Task | Commit | Message |
|------|--------|---------|
| 1 | 834ef98 | feat(quick-261022-imo): settings section panel scoped to the current category |
| 2 | 85476fa | test(quick-261022-imo): settings section panel coverage |
| 3 | 80bb5ae | chore(quick-261022-imo): rebuild embedded admin dist |
## Verification
- Tracer (Task 1): AppShell, useSettings, SectionPanel, PluginRail and Breadcrumbs tests all pass (36). `vue-tsc` is clean, `summer docs:build --check` reports no problems and `TestDocsTree` passes.
- Task 2: full admin suite passes, 95 files and 1478 tests; vue-tsc is clean.
- Task 3: `check-admin-dist.sh` passes, `go test -short ./modules/boardwalk` passes, and `git status` shows nothing under admin/ or modules/boardwalk/dist.
- Scope: the three commits only touch admin/, docs/backend/settings.md and modules/boardwalk/dist. No Go, pact or API files changed and no files were deleted (the hashed assets show up as renames).
## Deviations from Plan
None. The plan was executed as written. Task 2 is marked `tdd="true"`, but its tests were written after Task 1's implementation as the plan ordered, so there is no separate RED commit.
## Known Stubs
None.
## Self-Check: PASSED
- FOUND: admin/src/components/shell/SettingsPanel.vue
- FOUND: admin/tests/shell/SettingsPanel.test.ts
- FOUND: 834ef98, 85476fa, 80bb5ae