Skip to content

Tidy the design system, docs, and dependencies for forkers - #6

Merged
pei-tinybird merged 4 commits into
mainfrom
feature/project-cleanup
Oct 14, 2026
Merged

pei-tinybird merged 4 commits into
mainfrom
feature/project-cleanup

Conversation

@pei-tinybird

@pei-tinybird pei-tinybird commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Make the project easier to fork, simpler, and better documented. Also fixes a dashboard crash, hardens the console routes, and updates outdated dependencies.

Changes

Fixes

  • /?range=toString returned a 500. lib/range.ts now uses Object.hasOwn, and a test covers it.
  • /api/console/server-event and /api/console/stored reject bodies over 64 KB (413). stored now accepts same-origin requests only.
  • Server SDK: pageUrl is sanitized like the browser client (no credentials, no hash, only allowed query params), with a new allowedQueryParams option. Relative URLs still throw.

Dependencies

  • Updated @base-ui/react 1.9.0, @tabler/icons-react 3.49.0, @vercel/connect 2.4.1, tailwind-merge 3.7.0, @types/node 24.19.2 (kept on 24 to match engines).
  • Removed unused playwright-core and class-variance-authority.

Design system

  • One Button (components/button.tsx, no cva), plus shared cardClass, inputClass, focusRing, Notice, and ExternalLink in components/ui.tsx.
  • Arbitrary values went from 41 to 1 (the sidebar height).
  • Tokens: repeated literals aliased, one green, badge colors registered as utilities, unused tokens removed.
  • Contrast: badge text is now at least 4.6:1 (was as low as 2.5:1). Chart series that share these colors are slightly darker.
  • Recordings and console share the @4xl two-column breakpoint. The recordings list is 24rem wide.
  • Accessibility: calendar arrow keys work (the day ref is now attached), and event viewer rows are keyboard buttons.
  • Removed dead animation classes, dark: classes, unused props, and the provenance comments.

One component per file

  • components/ui/: generic primitives (button, badge, tooltip, notice, popover, calendar) and shared class strings in styles.ts.
  • components/dashboard/: cards, grid, bar list, charts, data table, date filter.
  • components/console/: one file per console card. console-store.ts is unchanged.
  • app/(dashboard)/_sections/: one file per dashboard section. page.tsx goes from 584 to 133 lines and console-app.tsx from 679 to 66.
  • Removed SegmentedLinks, props no caller passes, and exports nobody imports. Compiled CSS is byte-identical and screenshots match before and after the split.

Forkability

  • Branding lives in lib/site.ts (name, tagline, links).
  • Engagement labels are built from ENGAGED_MS and QUICK_EXIT_MS, so they match the SQL.

Docs

  • README: screenshot up top, corrected sign-in mode and required variables, a "Customize it" section (branding plus 6 steps to add a widget), and a troubleshooting table with the collector's error codes.
  • SDK README: all options documented, one schema reference for events and recordings.
  • CONTRIBUTING holds the rules. AGENTS.md links to it. .env.example matches the README.

Test plan

  • npm run typecheck, npm test (97 tests), and npm run build pass
  • Verified locally with npm run dev: dashboard, console, and recordings at 1440 and 1280px, the console at 600px, both sign-in tabs, date picker keyboard navigation
  • Dashboard queries unchanged apart from the shared engagement constants
  • Workspace picker after Vercel Connect (needs the OAuth flow)
  • Phone widths below 600px

Screenshots

Dashboard, before and after. Badge text and chart series are darker for contrast, and cards use one ring edge. Shot on the synthetic demo_events data.

Before After
Before After
rawtree-console

public/overview.jpg is refreshed in this PR so the README matches the new colors.

🤖 Generated with Claude Code

- Fix the /?range=toString crash and cap console route bodies at 64 KB.
- Add a same-origin check to the console storage route.
- Sanitize the server SDK pageUrl like the browser client (new allowedQueryParams option).
- Update outdated dependencies and remove unused ones.
- Share one Button, card, input, and focus style. Replace arbitrary values with scale values.
- Raise badge colors to WCAG AA contrast and remove unused tokens.
- Move branding to lib/site.ts and derive engagement labels from the query constants.
- Rewrite the README, SDK README, CONTRIBUTING, and AGENTS.md so each fact lives in one place.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pei-tinybird
pei-tinybird requested a review from a team as a code owner October 13, 2026 14:30
@pei-tinybird pei-tinybird self-assigned this Oct 13, 2026
pei-tinybird and others added 3 commits October 14, 2026 15:46
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…per file

- components/ui/: generic primitives and shared class strings (styles.ts).
- components/dashboard/: cards, grid, bar list, charts, data table, date filter.
- components/console/: one file per console card; console-store.ts unchanged.
- app/(dashboard)/_sections/: one file per dashboard section; page.tsx loads data and lays out.
- Remove stale code: SegmentedLinks, props no caller passes, unused exports.
- Point the README, AGENTS.md, and lib/queries.ts at the new paths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Keep stat values on one line so "1 : 0.28" doesn't wrap.
- Show the API key command as its own scrollable code block on sign-in.
- Link the live demo at the top of the README.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pei-tinybird
pei-tinybird merged commit 4eda14a into main Oct 14, 2026
1 check passed
@pei-tinybird
pei-tinybird deleted the feature/project-cleanup branch October 14, 2026 14:37
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.

1 participant