Skip to content

Add content docs - #20

Merged
srcdev merged 7 commits into
mainfrom
add-content-docs
Jul 28, 2026
Merged

Add content docs#20
srcdev merged 7 commits into
mainfrom
add-content-docs

Conversation

@srcdev

@srcdev srcdev commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds ContentDocs, a docs-page layout component (nav + content + on-this-page columns) that adapts via CSS @container queries on its own measured width, not the viewport — correct even when a consumer page's own decoration (e.g. a left nav) eats into available space.
  • docsNav/docsPageNav are prop-driven (docsNavItems/docsPageNavItems: DocsNavItem[], with optional per-item icon) and rendered internally as ExpandingPanel accordions with active-item v-models — not slots — so every consumer gets the breakpoint force-open/collapse and native-accordion-grouping logic for free instead of re-wiring it themselves.
  • Adds useContainerBreakpoints, a container-width equivalent of VueUse's useBreakpoints, since viewport-based breakpoints don't reflect actual available space when page decoration is present.
  • Full CSS token API for heading/panel/link styling (shared + per-side overrides) and icon start/end ordering.

Fixes found along the way

  • ExpandingPanel: forceOpened's programmatic open state was leaking into the click-driven isPanelOpen model, leaving panels stuck open after forceOpened reverted to false.
  • Two ExpandingPanels sharing a hardcoded name made them mutually exclusive via native <details> grouping — correct on mobile, wrong at tablet/desktop where both need to be open simultaneously. Now grouped only while mobile.

Test plan

  • ContentDocs.spec.ts (20 tests): visibility, active-item state/emits, icon rendering, breakpoint-driven forceOpened at all three widths, panel name-grouping
  • useContainerBreakpoints.spec.ts (5 tests)
  • ExpandingPanel.spec.ts regression test for the forceOpened leak (47 tests total, all passing)
  • Verified end-to-end against the dev server via the demo page (/ui/layout-content-docs) — canvas-switcher-driven width changes, click-to-toggle, hover/active states, light/dark surface tokens
  • vue-tsc --noEmit clean

srcdev added 3 commits July 27, 2026 23:01
…iven nav panels

Adds useContainerBreakpoints, a container-width equivalent of VueUse's
useBreakpoints, for layouts where page decoration means viewport width
doesn't reflect actual available space. Wires it into ContentDocs' demo
page to drive forceOpened/onTop on its nav ExpandingPanels per breakpoint.

Also fixes two ExpandingPanel bugs surfaced by exercising forceOpened
reactively for the first time: a shared `name` made two force-opened
panels mutually exclusive via native <details> grouping, and forceOpened's
programmatic open state was leaking into isPanelOpen and getting stuck
after forceOpened reverted to false.
…Panels

Replaces the docsNav/docsPageNav slots with prop-driven nav items
(docsNavItems/docsPageNavItems, DocsNavItem incl. optional icon) and
active-item v-models, since every consumer would otherwise have to
re-wire the same ExpandingPanel + breakpoint force-open/name-grouping
logic themselves. Adds default heading/panel/link styling with a
shared + per-side CSS token API, grid-based link layout so icon-less
items stay aligned, and start/end icon ordering via a direction flip.

Documents the component in .claude/skills/components/content-docs.md.
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
srcdev-design-system Ready Ready Preview, Comment Jul 28, 2026 8:03pm
srcdev-design-system-storybook Ready Ready Preview, Comment Jul 28, 2026 8:03pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new docs-page layout shell (ContentDocs) and supporting infrastructure to enable container-width–driven responsive behavior (instead of viewport breakpoints), plus a small ExpandingPanel behavior fix surfaced by the new layout.

Changes:

  • Added ContentDocs component (docs nav + content + “on this page”) with a CSS token API, container-query layout, and comprehensive tests.
  • Added useContainerBreakpoints composable (element-width breakpoints) with unit tests.
  • Fixed ExpandingPanel so forceOpened-driven <details> toggles don’t leak into the click-driven model, with a regression test.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/types/components/index.ts Re-exports the new DocsNavItem type definitions.
app/types/components/content-docs.d.ts Introduces DocsNavItem type used by ContentDocs.
app/pages/ui/layout-content-docs.vue Adds a demo page showcasing ContentDocs.
app/layouts/default.vue Adds a navigation link to the new demo page.
app/composables/useContainerBreakpoints.ts Adds container-width breakpoint helpers using ResizeObserver.
app/composables/tests/useContainerBreakpoints.spec.ts Tests for container breakpoint behavior and helpers.
app/components/layout-grids/LayoutGridA.vue Formatting/style indentation adjustments.
app/components/02.molecules/expandable/expanding-panel/tests/ExpandingPanel.spec.ts Adds regression coverage for the forceOpened toggle leak.
app/components/02.molecules/expandable/expanding-panel/ExpandingPanel.vue Ignores native toggle events while forceOpened is true.
app/components/01.atoms/content-wrappers/docs-pages/tests/ContentDocs.spec.ts Adds ContentDocs behavior tests (rendering, icons, force-open rules, grouping).
app/components/01.atoms/content-wrappers/docs-pages/ContentDocs.vue Implements the new docs-page layout component with container-query logic and tokenized styling.
.vscode/srcdev-component-content-docs.code-snippets Adds editor snippets for consuming/styling ContentDocs.
.claude/skills/index.md Registers the new content-docs skill doc entry.
.claude/skills/components/content-docs.md Adds repository documentation for ContentDocs usage, behavior, and tokens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/components/01.atoms/content-wrappers/docs-pages/ContentDocs.vue Outdated
Comment thread app/pages/ui/layout-content-docs.vue Outdated
srcdev and others added 2 commits July 28, 2026 10:50
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
srcdev and others added 2 commits July 28, 2026 20:54
Previously v-if'd away entirely, which shrank a forceOpened panel's
summary row relative to a toggleable sibling's whenever the icon was
the tallest child — breaking vertical alignment between ContentDocs'
docsNav (toggleable) and docsPageNav (forceOpened) panels at tablet
width. Now always rendered, just visually hidden via a modifier class.

Adds a Storybook story and a permanent Playwright visual regression
suite for ContentDocs covering mobile/tablet/desktop states, since the
tablet state is exactly what exposed this bug.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
These are regenerated on every test run and were accidentally
committed at some point; ignore and untrack them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@srcdev
srcdev merged commit 71359af into main Jul 28, 2026
1 of 5 checks passed
@srcdev
srcdev deleted the add-content-docs branch July 28, 2026 19:55
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.

2 participants