Skip to content

[DLS-606] feat(storybook): add stories for Table, DataTable, Dialog and ListItem#655

Open
desirendr wants to merge 6 commits intomainfrom
DLS-606-storybook-table-actionbar-select-trigger
Open

[DLS-606] feat(storybook): add stories for Table, DataTable, Dialog and ListItem#655
desirendr wants to merge 6 commits intomainfrom
DLS-606-storybook-table-actionbar-select-trigger

Conversation

@desirendr
Copy link
Copy Markdown

@desirendr desirendr commented Apr 23, 2026

Closes DLS-606.

Changes

DataTable

  • `WithClientSideColumnFilter` — `TableActionBar` with a `Select` using a `MediaButton` as custom trigger, wired to TanStack's `columnFilters` state + `getFilteredRowModel`
  • `WithServerSideFilters` — `manualFiltering: true` with `onColumnFiltersChange` / `onGlobalFilterChange` callbacks (simulated backend)
  • `WithClientSideFilters` — global search + two simultaneous column selects (category + gainers/losers) with a custom `filterFn`

Table

  • `WithActionBarAndSelectTrigger` — `TableActionBar` with category `Select` / `MediaButton` trigger
  • `WithNetworkAndMediaIcon` — `TableCellContent` with `CryptoIcon` (network icon) and `MediaImage` (media icon) as `leadingContent`

Dialog

  • `InfoStateVariants` — dialog body with gradient overlay for error, success, and muted info-state patterns

ListItem

  • `CompositionShowcase` — updated to include `CryptoIcon` and `MediaImage` as primary `ListItemLeading` elements

@desirendr desirendr requested a review from a team as a code owner April 23, 2026 12:11
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

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

Project Deployment Actions Updated (UTC)
ldls Ready Ready Preview, Comment May 6, 2026 0:27am
ldls-react-native Ready Ready Preview, Comment May 6, 2026 0:27am

Request Review

Comment thread libs/ui-react/src/lib/Components/Dialog/Dialog.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/Table/Table.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/ListItem/ListItem.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/ListItem/ListItem.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/ListItem/ListItem.stories.tsx
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new Storybook examples to document richer usage patterns for core UI components (Table/DataTable filtering & action bars, Dialog “muted” info state, and ListItem leading icon patterns) within libs/ui-react.

Changes:

  • Add Table stories demonstrating an action bar with a Select using a MediaButton trigger, plus TableCellContent leading-content icon patterns (CryptoIcon / MediaImage).
  • Add multiple DataTable stories showcasing client-side and server-side filtering patterns (TanStack columnFilters, manualFiltering, and combined filters).
  • Extend Dialog stories with a “Muted” info-state variant using the bg-gradient-muted overlay.
  • Add a ListItem story demonstrating network vs media icon leading patterns.

Reviewed changes

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

File Description
libs/ui-react/src/lib/Components/Table/Table.stories.tsx Adds new Table stories for action bar + Select trigger and leading icon patterns.
libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Adds new DataTable filtering stories (client-side, server-side, multiple filters) using Select triggers.
libs/ui-react/src/lib/Components/Dialog/Dialog.stories.tsx Adds “Muted” info-state dialog variant with gradient overlay + docs snippet.
libs/ui-react/src/lib/Components/ListItem/ListItem.stories.tsx Adds ListItem story demonstrating CryptoIcon vs MediaImage leading patterns.

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

Comment thread libs/ui-react/src/lib/Components/Table/Table.stories.tsx
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx Outdated
Comment thread libs/ui-react/src/lib/Components/Dialog/Dialog.stories.tsx
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Comment thread libs/ui-react/src/lib/Components/DataTable/DataTable.stories.tsx
Comment thread libs/ui-react/src/lib/Components/Dialog/Dialog.stories.tsx
Comment thread libs/ui-react/src/lib/Components/ListItem/ListItem.stories.tsx
Comment on lines +388 to +404
<ListItem density='expanded' onClick={() => {}}>
<ListItemLeading>
<CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
<ListItemContent>
<ListItemTitle>Bitcoin</ListItemTitle>
<ListItemDescription>BTC · Layer 1</ListItemDescription>
</ListItemContent>
</ListItemLeading>
<ListItemTrailing>
<ListItemContent>
<ListItemTitle>$43,250.00</ListItemTitle>
<ListItemDescription className='text-success'>
+2.5%
</ListItemDescription>
</ListItemContent>
</ListItemTrailing>
</ListItem>
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.

Not sure this is what was requested in the ticket, it might have not been clear but the exemple we needed to add is a list item with a description that has a crypto icon .

And I see that we already have it

Image

so you can remove these two added exemples

Copy link
Copy Markdown
Collaborator

@gamegee gamegee left a comment

Choose a reason for hiding this comment

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

Comment on lines +877 to +882
/**
* Client-side column filtering powered by TanStack's built-in `columnFilters` state
* and `getFilteredRowModel`. The Select updates `columnFilters` via
* `onColumnFiltersChange`; TanStack handles matching rows automatically.
* Combine with `DataTableGlobalSearchInput` for full-text + column filtering.
*/
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.

can remove the coms ✂️


<Dialog>
<DialogTrigger asChild>
<Button appearance='base'>Muted</Button>
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.

Image

this sadly looks broken :/

Comment on lines +966 to +972
/**
* Server-side filtering with `manualFiltering: true`. Filter state is owned by
* the component and synced to the backend via `onColumnFiltersChange` and
* `onGlobalFilterChange`. In this demo the "API call" is simulated locally, but
* the pattern is identical to a real fetch: change a filter → callback fires →
* you refetch with the new params → pass fresh data back as `data`.
*/
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.

can remove the coms ✂️

<DialogHeader density='compact' className='relative' />
<DialogBody>
<div className='flex flex-col items-center gap-24 overflow-hidden'>
<div className='relative flex flex-col items-center gap-24 overflow-hidden'>
Copy link
Copy Markdown
Collaborator

@aammami-ledger aammami-ledger Apr 30, 2026

Choose a reason for hiding this comment

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

revert this it broke the story

Image

<DialogHeader density='compact' className='relative' />
<DialogBody>
<div className='flex flex-col items-center gap-24 overflow-hidden'>
<div className='relative flex flex-col items-center gap-24 overflow-hidden'>
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.

Suggested change
<div className='relative flex flex-col items-center gap-24 overflow-hidden'>
<div className='flex flex-col items-center gap-24 overflow-hidden'>

Copy link
Copy Markdown
Collaborator

@gamegee gamegee left a comment

Choose a reason for hiding this comment

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

You should define a width to the SelectContent otherwise it will crop the content

Image

desirendr and others added 6 commits May 6, 2026 14:24
- DataTable: add WithClientSideColumnFilter (tanstack columnFilters API),
  WithServerSideFilters (manualFiltering with simulated backend), and
  WithMultipleFilters (global search + two simultaneous column selects)
- Dialog: add WithGradientMuted story (bg-gradient-muted overlay pattern)
- ListItem: add WithNetworkAndMediaIcon story (CryptoIcon + MediaImage as
  primary leading elements)
- Table: add WithNetworkAndMediaIcon story (CryptoIcon + MediaImage in
  TableCellContent leadingContent)

Made-with: Cursor
- DataTable/Table WithActionBarAndSelectTrigger: wrap filteredData in
  useMemo to prevent infinite re-render loop (new array reference on
  every render was causing TanStack to reprocess and re-render in a loop)
- Dialog: merge WithGradientMuted into InfoStateVariants alongside the
  existing error/success variants instead of a separate story

Made-with: Cursor
- DataTable: remove WithActionBarAndSelectTrigger (filters already documented)
- DataTable: rename WithMultipleFilters → WithClientSideFilters, drop JSDoc
- Table: remove JSDoc comment above WithNetworkAndMediaIcon
- ListItem: remove WithNetworkAndMediaIcon story; move CryptoIcon examples
  (BTC/ETH) into CompositionShowcase; remove MediaImage items per review

Made-with: Cursor
…log gradient

- Add '__all__' sentinel to Select items in Table and DataTable stories so
  selecting "All categories" / "All performance" is an explicit item rather
  than relying on clearing state; updates value binding and onValueChange
  accordingly across WithActionBarAndSelectTrigger, WithClientSideColumnFilter,
  WithServerSideFilters, and WithClientSideFilters
- Add `relative` positioning to the gradient-overlay wrapper div in all six
  Dialog info-state stories (InfoStateVariants + standalone error/success/muted)
  so the absolute overlay is contained within its sibling block

Made-with: Cursor
- Dialog: revert 'relative' from info-state gradient wrappers (aammami-ledger)
- DataTable: remove JSDoc comments above new filter stories (gamegee)
- DataTable: remove redundant WithClientSideFilters story (gamegee)
- Table/DataTable: add w-208 to SelectContent to prevent content cropping (gamegee)

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

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.

5 participants