Skip to content

card component consolidation - #8345

Merged
jonathanawesome merged 64 commits into
mainfrom
card-component-consolidation
Sep 10, 2026
Merged

card component consolidation#8345
jonathanawesome merged 64 commits into
mainfrom
card-component-consolidation

Conversation

@jonathanawesome

@jonathanawesome jonathanawesome commented Aug 7, 2026

Copy link
Copy Markdown
Member

This PR consolidates duplicated component families down to one implementation each, with cards as the main thread. Four components are deleted outright and every call site moves onto a base/ equivalent, which is where the bulk of the diff comes from: 112 files, +5203/-4106.

Cards

@/components/ui/card and @/components/v2/card are both gone. Every card in the app now renders through base/card.

Absorbing the two of them meant giving base/card variants for the things the old components expressed through className, since base/card deliberately takes none:

  • onSurfacebase (border only) or raised (filled, one step off the page). raised matches ui/card's default fill and the bg-neutral-2/50 that most call sites were setting by hand, so both converge on the same value.
  • titleSizedefault (text-sm), large (text-lg, ui/card's CardTitle) and xlarge (text-2xl, the auth card).
  • bodyPaddingdefault or none, for content that runs edge to edge such as the project card's full-bleed sparkline.
  • interactive — hover treatment for a card that is itself a link.

Layout that used to sit on the card root — grid placement, h-full, margins, min-heights — moved to wrapper elements at the call sites. Where a card needed to fill a row, the wrapper is grid rather than flex flex-col, because grid items stretch on the block axis and flex column items do not.

Two structural patterns were resolved at the call sites instead of by adding API: CardFooter folded into children as a trailing row, and a card that had two header/content pairs became one header with the second caption inside the body.

Stat cards

19 near-identical stat tiles across the four insights files are now one base/stat-card, with tone covering the success/failure colouring and an optional info-icon hint. In insights/stats.tsx this replaced seven separate wrapper components whose only real differences were an icon, a label and a formatting hook.

The insights pages also had six panels that never imported a Card at all — hand-rolled <div className="border-neutral-5 bg-neutral-2/50 rounded-md border p-5"> with Section.Title inside. Those are now base/card too, so they were invisible to the migration inventory but shipped as cards.

Not-found

Four components collapsed into one base/not-found. Two of them were both exported as NotFound, differing only in a card wrapper and a back button, and named the same two props differently (title/description vs heading/subheading). The other two were the route-level 404 and a resource-access variant with its own illustration and horizontal layout, both now variants: layout, illustration, fullScreen and an optional bigHeading for the "404" display line. The route-level Sentry captureMessage moved into router.tsx, where the other routing concerns already live.

Project and target cards

ProjectCard and TargetCard were ~172 lines each with only 49 differing — the ~70-line ECharts config, the data math and both tooltips were byte-identical. They now share common/resource-card, which takes the link as a render prop so each call site keeps TanStack's route and param checking on its own literal route.

Radio groups

ui/radio-group.tsx and v2/radio-group.tsx are deleted, with all call sites on base/radio-group.

Previews

The foundry preview environment now renders real app components, not just design-system primitives, so a base-component change can be judged against the compositions that actually ship. New previews cover Card, StatCard, NotFound, RadioGroup and BillingPlanPicker. The temporary per-call-site migration inventories that tracked ui/card and v2/card have been deleted now that both are gone.

Other fixes on this branch

  • Fix DropdownMenuSubContent overflow
  • Add a shared scrollbar style
  • Fix the insights-and-alerts seed: write the plan's real usage limits (org creation always applies HOBBY's column defaults whatever plan you pick) and clamp the backfill to that plan's retention
  • Raise max_partitions_per_insert_block to 10000 for local dev ClickHouse only...the minutely tables partition by hour, so a 30-day backfill exceeds the default of 100 and puts the usage ingestor into a replay loop
  • Refactor SchemaEditor to contain theme resolving
  • Simplify SubPageLayout and replace its Card usage
  • Remove unused DocsNote
  • Clean up DocsLink and ProductUpdatesLink
  • CSS updates: scroll styling, basic semantic colors, update Tailwind's @variant

🤖 Generated with Claude Code

@theguild-bot

theguild-bot commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/apollo 0.48.7-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/cli 0.63.2-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/core 0.22.5-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/envelop 0.40.12-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-plugin-console-sdk 0.1.6-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/laboratory 0.3.0-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/render-laboratory 0.1.19-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
@graphql-hive/yoga 0.49.6-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎
hive 11.13.0-alpha-20260910154135-b287dbd00dd2766548936571a91d01c15519a9e5 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.13.0-alpha-27b6add, 27b6add, 27b6addb75a6f6a1aa269eb90d57b7e13d617ed1

@jonathanawesome
jonathanawesome marked this pull request as ready for review September 9, 2026 21:34
jdolle
jdolle previously requested changes Sep 10, 2026

@jdolle jdolle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some of the headings under the various settings pages become gray instead of white.

This happened previously on the schema checks details page as well, and it makes it more difficult to scan due to the less obvious visual separation.

Image

Comment thread docker/configs/clickhouse-dev/insert-partitions.xml
Comment thread packages/web/app/src/components/base/button/button.tsx Outdated
Comment thread packages/web/app/src/components/base/floating/select/select.tsx Outdated
Comment thread packages/web/app/src/components/base/not-found/not-found.tsx Outdated
Comment thread packages/web/app/src/components/base/stat-card/stat-card.tsx
Comment thread packages/web/app/src/components/common/GraphQLSDLBlock.tsx
@theguild-bot
theguild-bot deployed to development September 10, 2026 14:03 Active
@jonathanawesome
jonathanawesome merged commit 388ee98 into main Sep 10, 2026
29 checks passed
@jonathanawesome
jonathanawesome deleted the card-component-consolidation branch September 10, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants