-
Notifications
You must be signed in to change notification settings - Fork 437
feat(dashboard): table tile header separator and optional alternate row background #2519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e5b2148
feat(dashboard): table tile header separator and optional alternate r…
alex-fedotyev 39a99ac
refactor(dashboard): rename table display-options gate for clarity
alex-fedotyev 0bb9449
Merge branch 'main' into alex/HDX-4601-table-tile-row-styling
pulpdrew faa16a9
Merge branch 'main' into alex/HDX-4601-table-tile-row-styling
alex-fedotyev e81b3ef
feat(dashboard): enable Alternate Row Background on SQL table tiles
alex-fedotyev 450d6d6
fix(dashboard): persist alternateRowBackground on SQL and PromQL tabl…
alex-fedotyev ed30bb6
Merge branch 'main' into alex/HDX-4601-table-tile-row-styling
alex-fedotyev 58e3d35
test(dashboard): cover alternateRowBackground on the PromQL table con…
alex-fedotyev ead9924
test(dashboard): keep app lint under the warning ceiling
alex-fedotyev 6905815
Merge branch 'main' into alex/HDX-4601-table-tile-row-styling
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@hyperdx/app": patch | ||
| "@hyperdx/common-utils": patch | ||
| --- | ||
|
|
||
| feat(dashboard): table tile header separator and optional alternate row background | ||
|
|
||
| Add an always-on separator between a table tile's sticky header and its rows so the boundary stays clear as rows scroll underneath. Add a new **Alternate Row Background** display setting (off by default) that zebra-stripes table tiles for easier scanning on wide tables. Both work in light and dark color modes. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import React from 'react'; | ||
| import type { Meta, StoryObj } from '@storybook/nextjs'; | ||
|
|
||
| import { Table } from './HDXMultiSeriesTableChart'; | ||
|
|
||
| const columns = [ | ||
| { id: 'service', dataKey: 'ServiceName', displayName: 'Service' }, | ||
| { id: 'count', dataKey: 'Count', displayName: 'Count' }, | ||
| { id: 'p95', dataKey: 'P95', displayName: 'p95 (ms)' }, | ||
| ]; | ||
|
|
||
| const data = Array.from({ length: 18 }, (_, i) => ({ | ||
| ServiceName: `service-${i + 1}`, | ||
| Count: (i + 1) * 137, | ||
| P95: 40 + i * 11, | ||
| })); | ||
|
|
||
| // Fixed-size frame so the virtual list renders rows and the sticky header | ||
| // has content to scroll over, surfacing the header separator. | ||
| const meta: Meta<typeof Table> = { | ||
| title: 'HDXMultiSeriesTableChart', | ||
| component: Table, | ||
| parameters: { layout: 'padded' }, | ||
| decorators: [ | ||
| Story => ( | ||
| <div style={{ height: 320, width: 640 }}> | ||
| <Story /> | ||
| </div> | ||
| ), | ||
| ], | ||
| args: { | ||
| data, | ||
| columns, | ||
| sorting: [], | ||
| onSortingChange: () => {}, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof Table>; | ||
|
|
||
| // Header separator only; rows share the body background. | ||
| export const Plain: Story = { | ||
| args: { alternateRowBackground: false }, | ||
| }; | ||
|
|
||
| // Zebra striping on odd rows plus the always-on header separator. | ||
| export const Striped: Story = { | ||
| args: { alternateRowBackground: true }, | ||
| }; | ||
|
|
||
| // Striped rows that also resolve to a click destination, so the stronger | ||
| // hover background can be checked over a stripe. | ||
| export const StripedWithRowActions: Story = { | ||
| args: { | ||
| alternateRowBackground: true, | ||
| getRowAction: (row: { ServiceName: string }) => ({ | ||
| url: `/search?service=${row.ServiceName}`, | ||
| description: `Search ${row.ServiceName}`, | ||
| }), | ||
| }, | ||
| }; |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.