Dashboard Pages v2#6262
Open
RobertJoonas wants to merge 25 commits intomasterfrom
Open
Conversation
8 tasks
136b190 to
05e3235
Compare
05e3235 to
fc2c551
Compare
|
- instead of importing Metric from types/query-api.d.ts, define a Metric type in metrics.ts (including all internally available metrics) and use that as the single Metric type everywhere - add metric labelling logic in metrics.ts - move MetricValue type from fetch-main-graph.ts -> api.ts, and use it for Top Stats metric value as well
This commit introduces use-order-by-legacy.ts and use-order-by-legacy.test.ts files as copies of the current modules. The intent is to make the diff easier to review -- all components currently using the hook will use the legacy variant instead, and the actual file will change into v2 in the following commit.
* breakdown-modal.tsx -> breakdown-modal-legacy.tsx * breakdown-table.tsx -> breakdown-table-legacy.tsx * table.tsx -> table-legacy.tsx ...and use the legacy variants everywhere. The existing files will be transformed into v2 in the following commit.
- Cache whole api responses (including meta and query), not only results - AfterFetchData & afterFetchNextPage -> onDataReady. The function now also runs when fetch is a cache hit. - Avoid usePaginatedQueryAPI for IndexBreakdown. Unnecessary complexity because pagination is not needed. Instead let IndexBreakdown call useQuery directly
- add order by [dim, asc] to Index and DetailsBreakdowns - Define pagination field in StatsQuery and ReportParams
7968504 to
1ab079a
Compare
In details modals, instead of fixing the dimension cell width and leaving a gap between dimension and metric columns, distribute the empty space evenly between all columns. This is the current prod behaviour in breakdown modals.
1ab079a to
f629618
Compare
apata
reviewed
May 5, 2026
| align={align} | ||
| {columns.map((col) => ( | ||
| <td | ||
| key={`${col.key}_${rowKey}`} |
Contributor
There was a problem hiding this comment.
nitpick, non-blocking: due to limit + offset pagination, the same dimension/page name can actually appear on multiple pages
apata
reviewed
May 5, 2026
| } from '../../util/filters' | ||
| import { addFilter, revenueAvailable } from '../../dashboard-state' | ||
| import BreakdownModal from './breakdown-modal' | ||
| import BreakdownModal from './breakdown-modal-legacy' |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes (code-structure oriented description)
useQueryFadeIncomponent with a simple set of Tailwind classes. The animation duration is set to 300ms to make it noticeable.usePaginatedQueryAPIhook which uses a StatsQuery object in itsqueryKeyrather than a DashboardState.afterFetchDataprops ->onDataReady(Same as for IndexBreakdown. Instead of a separate function for next page vs initial page, the single handler now receives all pages of results which will be needed in the conversions report to determine whether revenue metrics should be displayed or not)onDataReadycallback instead ofafterFetchDataandafterFetchNextPage-- need to fire the callback when response is read from cache too, not only after a real fetch call)apiResponse.queryandapiResponse.metaby letting TanStack query cache both as part of the response.ColumnConfigurationfor defining columns. In order to generate columns, actual data is needed. Unlike the legacyColumnConfiguration, the new version enforces bothrenderLabelandrenderCellas functions, therefore leaving the rendering components (BreakdownTable and IndexBreakdownRenderer) dumb about any special cases around dimension/metric values/labels.metrics.ts. Note: it is already extended to components that are not yet migrated (e.g. conversions). Currently dead code but will be used soon.Recap of user facing changes
Tests
Changelog
Documentation
Dark mode