Skip to content

feat(collections): gridJS table with pagination and column sorting#1270

Open
fhennig wants to merge 5 commits into
mainfrom
feat/gridjs-collections-overview
Open

feat(collections): gridJS table with pagination and column sorting#1270
fhennig wants to merge 5 commits into
mainfrom
feat/gridjs-collections-overview

Conversation

@fhennig

@fhennig fhennig commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #1269

Summary

  • Replaces the hand-rolled DaisyUI table in CollectionsOverview.tsx with a GridJS <Grid> component
  • All four columns (ID, Name, Description, Variants) are sortable client-side
  • Pagination at 20 rows per page
  • Cells wrapped in <a> tags via GridJS h() formatter, preserving proper link behaviour (hover cursor, right-click, middle-click)
  • Adds a Vite alias pointing gridjs-react at its ESM dist file directly, working around Vite's CJS package scanner misidentifying the named exports

Styling

Overrides the mermaid theme via an inline <style> block to match the site's design language:

  • No rounded corners or drop shadow
  • Outer left/right border frames the table
  • No horizontal row lines — vertical column separators only
  • Zebra striping using DaisyUI's --color-base-200 (theme-aware, works in dark mode)
  • Tighter padding and font sizes
  • display: block on .gridjs-container so the table squishes on narrow screens instead of scrolling

Column widths: ID 7%, Name 25%, Variants 10%, Description takes the rest. Long descriptions are truncated with a CSS ellipsis.

Screenshot

image

Test plan

  • Verify sorting works on all columns
  • Verify pagination appears when there are more than 20 rows
  • Verify clicking a row navigates to the collection detail page
  • Verify description truncation with ellipsis on long descriptions
  • Verify table squishes (no horizontal scroll) on narrow screens (~1000px)
  • Run browser spec tests: npm run test

🤖 Generated with Claude Code

…+ sorting)

Closes #1269

- Installs gridjs and gridjs-react
- Replaces the hand-rolled DaisyUI table with a GridJS <Grid> component
- All four columns (ID, Name, Description, Variants) are sortable client-side
- Pagination at 20 rows per page
- Cells wrapped in <a> tags via gridjs h() formatter for proper link behaviour
- Aliases gridjs-react to its ESM dist file in Vite config to work around
  Vite's CJS package scanner misidentifying the named exports
- Temporarily disables excludeSystemCollections filter for testing (TODO to restore)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jun 11, 2026 9:33am

Request Review

fhennig and others added 2 commits June 11, 2026 11:02
… appearance

- Remove rounded corners and drop shadow
- Add outer left/right border to frame the table
- Remove horizontal row lines, keep vertical column separators
- Add zebra striping using DaisyUI theme colour
- Reduce cell and header padding and font sizes
- Scale sort arrow buttons to match smaller header
- Tighten pagination footer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sponsive fix

- Fix ID, Name, Variants column widths using percentages (7/25/10%)
- Remove manual 80-char description truncation; use CSS ellipsis on the td instead
- Switch gridjs-container from inline-block to block so table squishes on narrow screens

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ter params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig fhennig changed the title feat(collections): GridJS table with pagination and column sorting feat(collections): gridJS table with pagination and column sorting Jun 11, 2026
…ridJS role

- Restore excludeSystemCollections: true (was temporarily commented out for testing)
- Update test to use getByRole('grid') — GridJS renders <table role="grid"> for
  sortable grids, so getByRole('table') no longer matches

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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

This PR updates the collections overview UI to use GridJS for richer client-side table functionality (sorting + pagination) and adds a Vite alias workaround to ensure gridjs-react is consumed as ESM in the Astro/Vite build.

Changes:

  • Replaces the DaisyUI <table> implementation with a GridJS <Grid> configured with sorting and 20-row pagination.
  • Adds inline CSS overrides to restyle the Mermaid theme to better match the site’s design.
  • Adds gridjs / gridjs-react dependencies and a Vite alias to force the ESM build of gridjs-react.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
website/src/components/collections/overview/CollectionsOverview.tsx Replaces hand-rolled table with GridJS, adds pagination/sorting, and applies style overrides.
website/src/components/collections/overview/CollectionsOverview.browser.spec.tsx Updates the rendered-table assertion to target the GridJS output.
website/package.json Adds gridjs and gridjs-react dependencies.
website/package-lock.json Locks newly added GridJS dependencies.
website/astro.config.mjs Adds a Vite alias to route gridjs-react imports to its ESM dist file.
Files not reviewed (1)
  • website/package-lock.json: Generated file

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

Comment on lines +75 to +78
<style>{`
/* Remove the mermaid theme's rounded corners and drop shadow; add outer left/right border to frame the table */
.gridjs-wrapper, .gridjs-footer { border-radius: 0; box-shadow: none; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; }

Comment on lines +76 to +77
/* Remove the mermaid theme's rounded corners and drop shadow; add outer left/right border to frame the table */
.gridjs-wrapper, .gridjs-footer { border-radius: 0; box-shadow: none; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; }
Comment on lines +91 to +92
/* Tighten up cell padding and reduce font to match the rest of the UI */
td.gridjs-td { padding: 6px 16px; font-size: 0.875rem; }
Comment on lines +137 to +139
cell != null
? h('span', { className: 'text-gray-500' }, cell as string)
: h('span', { className: 'text-gray-300' }, '—'),
Comment on lines +150 to +152
data={collections.map((c) => [c.id, c.name, c.description, c.variantCount])}
pagination={{ limit: 20 }}
sort={true}
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.

feat(collections): use GridJS table for collections overview with pagination and sorting

2 participants