Skip to content

feat: docs tables, cards, search dialog and ToC (#8, #9, #10, #11) - #12

Merged
LizAinslie merged 1 commit into
mainfrom
docs-overhaul
Oct 26, 2026
Merged

LizAinslie merged 1 commit into
mainfrom
docs-overhaul

Conversation

@LizAinslie

Copy link
Copy Markdown
Contributor

Summary

Docs chrome overhaul covering #8, #9, #10 and #11. One branch, no version bump; everything is under [Unreleased].

#8 — tables

  • New DocsTable.astro: data-driven columns/rows, explicit narrow (shrink + nowrap) and prose (wrap at 16–20ch mobile / 20–48ch desktop) columns, optional caption, and an internal scroll box.
  • Plain Markdown tables now use the GitHub-style display: block; width: max-content; max-width: 100%; overflow-x: auto pattern, so they scroll inside the table rather than the page.
  • Markdown heuristic: every column except the last is treated as a key/type/default column; the last is prose. DocsTable opts out via .kdc-table.
  • Prose headings get scroll-margin-top so anchors land below the sticky navbar.

#9 — overview cards

  • New CardGrid.astro (1 / 2 / 3 responsive columns) and DocsCard.astro (title, description, href, optional icon).
  • Explicit .kdc-card-grid prose resets. not-prose alone is inert here because the package does not install @tailwindcss/typography; the class is kept for consumers that do.

#10 — search dialog

  • Input and close button share one flex header row; close is vertically centred.
  • Themed focus ring replaces the default outline.
  • Result titles are text-base, breadcrumbs text-sm, in both the server-rendered list and the client re-render path.
  • Input is at least 16px (max(1rem, 16px)) so iOS Safari does not zoom.
  • Full-screen below 640px. Also restores scale: 1 on the open daisyUI modal box, whose open-state rule is shadowed by a deeper layer in daisyUI 5.7.

#11 — table of contents

  • DocsLayout accepts headings: TocHeading[] and toc?: boolean (default on).
  • h2/h3 only; sticky right sidebar at lg, collapsible <details> block below lg.
  • Scroll-spy sets aria-current="location" on both copies; no toc and no headings keeps the original centred layout.
  • New TocHeading core type; DocsLayout is otherwise unchanged for existing pages.

Playground

  • New /docs/config reference page with realistic ktor.deployment.* tables, a long-key table, and h2/h3 headings for ToC depth filtering.
  • Index page uses CardGrid/DocsCard and DocsTable.
  • Install page opts out with toc={false}.
  • Markdown layout wrapper forwards headings.

Validation

  • pnpm typecheck
  • pnpm test — 66 tests pass
  • pnpm build
  • pnpm --filter @kolektiv/common-docs-chrome-playground build

Checked in headless Chrome at 390 / 768 / 1024 / 1440px:

  • No page-level horizontal scroll; tables scroll inside their own box.
  • Markdown prose column reaches 4–5 lines at desktop width; cards are 1/2/3 columns with no bullets or underlines.
  • ToC appears at >=1024px, collapses below it, highlights the active section after scrolling, and is absent on the opt-out page.
  • Search is full-screen at 390px, input/close centres align, input is 16px, focus ring is primary, titles 16px / breadcrumbs 14px after typing.

Notes

  • The ToC for .astro pages needs hand-authored headings entries with matching element ids; Markdown pages get them automatically.
  • No release/tag in this PR.

Closes #8
Closes #9
Closes #10
Closes #11

Add DocsTable with explicit narrow/prose columns and a scroll box, plus default Markdown table styles that never scroll the page. Add CardGrid and DocsCard with explicit prose resets so cards have no bullets or underlined text. Rework SearchDialog into a single header row with a themed focus ring, readable results, a 16px input and a full-screen mobile dialog. Generate an On this page ToC in DocsLayout from headings, with a sticky desktop sidebar, a mobile details block, active-section highlighting and a toc={false} opt-out.

Closes #8
Closes #9
Closes #10
Closes #11
@LizAinslie
LizAinslie merged commit f04bfdb into main Oct 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant