feat(ui): add @pretable/ui shared design system package#7
Merged
Conversation
Three-surface editorial+terminal hybrid: playground (the pitch), bench (the adversarial receipts), and a new apps/docs (Mintlify- equivalent reference). Shared tokens, Fraunces + system stack, amber accent, severity color as the only saturated grid signal. Informed by competitor research on AG Grid, TanStack Table, MUI X DataGrid, and Mintlify-layout patterns (Resend, Clerk, Stripe, MUI X docs, Supabase docs). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers the shared design-system package: tokens CSS, Fraunces font wiring via @fontsource-variable/fraunces, and five React components (Receipt, Callout, CodeBlock, Nav, Footer). Does not migrate apps; that's Plans B-D. Prettier formatting for both the plan and the spec. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add rootDir to tsconfig.typecheck.json so type-checking stays pinned to src/ - Resolve onSuccess CSS copies against the package dir via import.meta.url so tsup works whether invoked from the repo root or the package Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Without an afterEach(cleanup()) registration, React Testing Library does not tear down the DOM between tests in vitest. Tests that scan the DOM via queryByText (e.g. the 'renders children without requiring a tag' case in callout.test.tsx) then see leftover elements from prior renders and fail. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the hardcoded #7d4f0a on .pt-callout-warn .pt-callout-tag with a new --pt-amber-ink-dark token so the palette is fully centralized. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Give <Callout> role='note' so screen readers announce it as supplementary information rather than a bare div. Both variants use role='note'. role='alert' is for urgent, time-sensitive content the user needs to act on immediately, which doesn't fit a persistent docs callout even when styled as a warning. Consumers who need urgent semantics can override with aria-live on an ancestor. Two new tests cover the default and warn cases. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dot span carried aria-label="ci {status}" while the adjacent
visible text already reads "ci: {status}", so screen readers heard
"ci ci green green". Mark the dot aria-hidden — the visible text
carries the same information with correct phrasing.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address the final holistic review before merge: - Tokenize two remaining hardcoded hex values in components.css (--pt-grid-head for code block head, --pt-ink-hover for nav CTA). Keeps the tokenization discipline consistent across the stylesheet. - Move @fontsource-variable/fraunces from runtime dependency to optional peer dependency, matching the README: consumers import the font themselves, so the package should not pull it unconditionally. - Add "sideEffects" field scoped to CSS so bundlers can tree-shake unused components from the JS barrel while preserving stylesheet imports. - Add "./package.json" to the exports map for tooling (pnpm, publint). - Use link.href as the React key in Footer links (label can collide). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
Final review passFinal holistic code review ran over the full package. Landed four in-scope polish items in
Deferred (out of scope for this PR)
CI status
The three checks my package is responsible for are green: |
The grid-core test script (vitest run) imports @pretable-internal/layout-core, which resolves to ./dist/index.js via package.json exports. On fresh CI without a pre-build step, dist/ does not exist and vitest errors with "Failed to resolve entry for package". packages/react already uses this alias pattern for @pretable-internal/renderer-dom and @pretable/core. Apply the same approach here so grid-core tests can run from a clean checkout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
When the S4/S5 scenario branches were added to the parseBenchQuery nested ternary, the indentation for S7 and its fallback drifted two spaces shallow. Prettier's check flags this; prettier --write corrects the indent depth to match the ternary nesting level. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
blove
added a commit
that referenced
this pull request
May 11, 2026
…5 cross-validation PR #128's S5/S7 cross-validation matrix surfaced a finding: AG Grid Community matches pretable on every measured streaming numeric (frame p95, 25k/sec envelope, visible-row drift). The homepage's stub-era "purpose-built streaming pipeline" framing — and the implication that pretable is uniquely fast at streaming — is no longer supportable on hypothesis-scale numerics. The honest wedge is package surface: pretable ships the SSE → partial-JSON → batcher → applyTransaction pipeline as a single import; AG Grid expects you to wire it yourself. Three editorial edits: - ComparisonTable.tsx: streaming row renamed from "purpose-built streaming pipeline" to "streaming pipeline (SSE → partial JSON → batcher → applyTransaction)" — same yes/n/a/n/a/n/a shape, sharper capability claim. Header docblock updated to cite the S5/S7 cross-validation milestone alongside the existing B2 sources. - ReceiptsBand.tsx: replaced the "25k/s · max sustained update rate" hero stat (no longer pretable-unique) with "OpenAI · Anthropic · SSE · streaming sources, one import". Added a `compact: true` flag to the Stat interface so the longer label renders at 20–24 px instead of 44–56 px, preserving the four-cell grid without overflowing the hero font scale. - FeatureGrid.tsx: Stream-aware card — dropped "sustained from 100 to 25,000 updates/sec" tail; rewrote the description around the pipeline that ships as one import. Test added: ReceiptsBand.test.tsx regression-guards the new capability anchor (`streaming sources` + `openai`). Repo-memory entry appended (B2 follow-up #7); MEMORY.md index updated; project_b2_followups.md regenerated to reflect everything resolved except item #5 (open comparator interaction scripts). No source/package changes outside apps/website + the docs entry; all 190+ website tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
blove
added a commit
that referenced
this pull request
May 11, 2026
…5 cross-validation (#129) PR #128's S5/S7 cross-validation matrix surfaced a finding: AG Grid Community matches pretable on every measured streaming numeric (frame p95, 25k/sec envelope, visible-row drift). The homepage's stub-era "purpose-built streaming pipeline" framing — and the implication that pretable is uniquely fast at streaming — is no longer supportable on hypothesis-scale numerics. The honest wedge is package surface: pretable ships the SSE → partial-JSON → batcher → applyTransaction pipeline as a single import; AG Grid expects you to wire it yourself. Three editorial edits: - ComparisonTable.tsx: streaming row renamed from "purpose-built streaming pipeline" to "streaming pipeline (SSE → partial JSON → batcher → applyTransaction)" — same yes/n/a/n/a/n/a shape, sharper capability claim. Header docblock updated to cite the S5/S7 cross-validation milestone alongside the existing B2 sources. - ReceiptsBand.tsx: replaced the "25k/s · max sustained update rate" hero stat (no longer pretable-unique) with "OpenAI · Anthropic · SSE · streaming sources, one import". Added a `compact: true` flag to the Stat interface so the longer label renders at 20–24 px instead of 44–56 px, preserving the four-cell grid without overflowing the hero font scale. - FeatureGrid.tsx: Stream-aware card — dropped "sustained from 100 to 25,000 updates/sec" tail; rewrote the description around the pipeline that ships as one import. Test added: ReceiptsBand.test.tsx regression-guards the new capability anchor (`streaming sources` + `openai`). Repo-memory entry appended (B2 follow-up #7); MEMORY.md index updated; project_b2_followups.md regenerated to reflect everything resolved except item #5 (open comparator interaction scripts). No source/package changes outside apps/website + the docs entry; all 190+ website tests pass. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a new workspace package
@pretable/uicontaining the shared design system for the pretable playground, bench, and upcoming docs apps. No app migration in this PR — playground (Plan B), bench (Plan C), and the new docs app (Plan D) will consume this package in follow-up PRs.What ships:
tokens.css) — editorial (cream/ink/amber) + terminal (dark grid) + severity + syntax palettes, typography stacks, type scale, layout tokens. All--pt-*prefixed.@fontsource-variable/fraunces(runtime dep, not self-hosted).<Receipt>— inline numeric tag chip for body copy<Callout>— cream-hi panel with amber/warn left border,role="note"<CodeBlock>— terminal-surface snippet with optional tabs and copy-to-clipboard<Nav>— 60px sticky header with wordmark, version pill, links, search trigger, GitHub star pill, CTA<Footer>— one-line monospace footer with CI status indicatorDesign + plan
docs/superpowers/specs/2026-04-21-pretable-visual-system-design.mddocs/superpowers/plans/2026-04-21-pretable-ui-package.mdFollow-ups folded into this PR
Two small improvements surfaced during review were committed onto this branch since they touch files that only exist here (couldn't be split into separate PRs without stacking):
db3fdec chore(ui): tokenize Callout warn tag color— replaced the one hardcoded#7d4f0awith--pt-amber-ink-darkfor full token coverage828414a feat(ui): add semantic role to Callout—role="note"on both variants (with rationale in the commit about whyrole="alert"is wrong for persistent docs callouts)10907d4 fix(ui): prevent Footer CI status from being announced twice— the dot'saria-labelduplicated the adjacent visible "ci: {status}" text; nowaria-hiddenTest plan
pnpm --filter @pretable/ui test)pnpm --filter @pretable/ui typecheck)pnpm --filter @pretable/ui lint)dist/{index.js,index.d.ts,tokens.css,components.css}pnpm testgreen (no regressions in playground/bench/grid-core/etc.)pnpm typecheckclean