[Issue]: Sidebar - make headings collapsible #96
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
epic
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#96
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by
Kaushal Pal Singh (kps@pelagiamarine.com, MANAGER) — via portal Report Issue button
Description
Purchasing, crewing, administration all should be collapsible and collapsed by default. Clicking a link in one heading should collapse other headings, if open.
Priority
P2 — Medium
Context
/dashboardClaude triage
Triage — Issue #96: Sidebar — make headings collapsible
Type: Feature (enhancement to existing navigation behaviour)
Priority: P2 — Medium
Routing: claude-queue
Interpretation
The portal sidebar currently renders section headings (Purchasing, Crewing,
Administration) as static, always-expanded labels via
SectionHeader. The reporterwants each of these headings to be collapsible, collapsed by default, and to behave
as an accordion: opening one heading (or clicking a link within it) collapses any other
open heading.
Note: the top "main" links (Dashboard, New PO, Closed POs, Approvals, Payments, My Profile,
etc.) are not under any heading — they sit above the sections directly. The request only
concerns the three (or fewer, role-dependent) headed sections.
Action items
SectionHeaderan interactive toggle inApp/components/layout/sidebar.tsx:<p>label into a<button>row with a chevron indicator(e.g.
ChevronRight/ChevronDownfromlucide-react, already a dependency).aria-expandedand appropriatearia-controls/region semantics for accessibility.Sidebarclient component (useState), keyed by sectionid (
"purchasing" | "crewing" | "administration"). Default all to collapsed.accordion). Per the issue, clicking a link within a section collapses the others — so
the active section's links remain visible while siblings close.
NavLinklist based on its open state (the headedgroups in the existing JSX: Purchasing block, Crewing block, both Administration blocks).
auto-expand the section that contains the currently active route on mount, so the user
isn't left on a page whose nav section is hidden.
tests/unit/vendors-table.test.tsx/po-status-badge.test.tsx) asserting: sectionscollapsed by default, clicking a header expands it and reveals its links, and opening one
section collapses another. Run
pnpm type-check,pnpm lint,pnpm test.Files / areas involved
App/components/layout/sidebar.tsx— the only source file to change (SectionHeader,Sidebar, section render blocks). Single, localized.App/tests/unit/sidebar.test.tsx— new unit test (none exists today).App/tests/e2e/rebrand.spec.ts— existing e2e only checks the "PPMS" brand text inaside;unaffected, but worth a glance to ensure the brand text stays outside any collapsible region.
Open questions
a link navigates to a new page (fresh mount), the user lands with all sections collapsed.
Should the section containing the active route auto-expand on mount? (Recommended yes —
otherwise the active link is hidden.) The issue text doesn't specify; sensible default
chosen above.
(localStorage)? Not requested; default is no persistence (re-derive from active route).
("collapse other headings, if open"). Assuming single-open.
Routing rationale
Routing: claude-queue — a localized, single-file client-component change (
sidebar.tsx) withclear acceptance criteria, verifiable by type-check/lint plus a component unit test, touching
no DB migrations, auth/permissions, payments, or external systems.
Routing:
claude-queue| Type:feature[Claude] Started working on this issue on branch
claude/issue-96.[Claude] Opened PR #97 with a proposed fix. Review and merge it, then create a release tag to deploy.