Sidebar Generation
Purpose
Define the structure of the sidebar returned by generateOpenSpecSidebar() and the labels it uses.
Requirements
Requirement: Sidebar is grouped into specifications, changes, and archive
generateOpenSpecSidebar() SHALL return SidebarItem[] with a "Specifications" group, a "Changes" group, and an "Archive" group that is only present when archived changes exist.
Specification group lists all specs
- WHEN
generateOpenSpecSidebar(specDir, { outDir: 'openspec' })is called and a specnav-integrationexists - THEN the "Specifications" group contains
{ text: 'Overview', link: '/openspec/specs/' }followed by an item withlink: '/openspec/specs/nav-integration/'
Change items link to artifact pages
- WHEN an active change
my-featurecontainsproposal.mdandtasks.md - THEN its group in "Changes" contains items linking to
/openspec/changes/my-feature/proposaland/openspec/changes/my-feature/tasks
Requirement: Sidebar text for spec and change items uses humanized labels
The text field of sidebar items for capability specs and changes MUST use the humanized label (Title Case) derived from the kebab-case name, not the raw kebab-case name.
Spec sidebar item uses Title Case
- WHEN
generateOpenSpecSidebar()is called and a spec namednav-integrationexists - THEN the sidebar item has
text: 'Nav Integration'
Change sidebar item uses Title Case
- WHEN
generateOpenSpecSidebar()is called and a change namedreadable-sidebar-labelsexists - THEN the change group has
text: 'Readable Sidebar Labels'