Repository navigation
Conversation
|
🚀 Preview Environment Ready! Your preview environment is available at: https://toner-yang-telecommunications-cams.trycloudflare.com This environment will automatically shut down after 5 hours. |
🤖 PR Review
🛡️ Security Review✅ No high-severity vulnerabilities detected. 🚦 Auto-approve🙋 Manual review recommended for the following reason(s):
Automated pre-review — human approval still required. |
🟡 Quality review · 3 findings
High-level — This frontend-only, feature-flagged change uses the server's existing 💬 3 inline comments on the diff. Reviewed against the |
| return isNonEmptyArray(pageFilterValues) | ||
| ? { | ||
| input: { widgetId, pageFilterValues }, | ||
| configuration: { timezone: userTimezone }, |
There was a problem hiding this comment.
🟡 Nit · High-level · engineering architecture
Applying a dashboard filter replaces the widget's saved configuration.timezone with the viewer's timezone
The server uses configuration.timezone for both date bucketing and resolving the page filter (bar-chart-data.service.ts:141). So when a filter is turned on, the chart's day and month buckets move into the viewer's timezone, and the same chart groups differently depending on whether a filter is set. Send the filter timezone in its own field (or take it from the user server-side) and leave the widget's grouping timezone alone.
| colorMode, | ||
| objectMetadataItem, | ||
| } = useGraphBarChartWidgetData({ | ||
| widgetId: widget.id, |
There was a problem hiding this comment.
🟡 Nit · High-level · product & vision
Chart click-through ignores the active dashboard filter, so the drill-down list no longer matches the filtered chart
buildChartDrilldownQueryParams (widgets/graph/utils/buildChartDrilldownQueryParams.ts) only adds configuration.filter and the clicked bucket. A bar that shows 12 records under 'Reporting period: Today' opens a record list with every date. Pass the widget's dashboard filter values into the drill-down params for bar, line and pie charts, or say in the PR that this is a deliberate follow-up.
| value?.operand === filter.defaultValue?.operand && | ||
| value?.value === filter.defaultValue?.value | ||
| ) { | ||
| delete next[filter.id]; |
There was a problem hiding this comment.
🟡 Nit · Low-level · No delete``
The added code uses the delete operator on next[filter.id], which the no-delete rule forbids; build the object without that key or set it through a non-delete approach instead.
Confidence Score: 4/5
[Medium impact] The change affects dashboard viewers and chart queries within the dashboard filter workflow. Fix the loss of dashboard dates after saving a layout before merging. FindingsSummaryAdds viewer date controls below dashboard tabs.
Acknowledged follow-up: ehconitin explicitly deferred chart drilldown in the PR description. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Saved filter defaults] --> C[Viewer date choices]
B[Browser overrides] --> C
C --> D[Values grouped by bound widget]
D --> E[Bar, line, and pie chart requests]
F[Visible charts in active tab] --> G[Date controls]
G --> B
H[Reset] --> A
Reviews (1) · Last reviewed commit: "Add date filter controls for dashboard v..." · Reviewed by Greptile |
| filters { | ||
| id | ||
| type | ||
| label | ||
| icon | ||
| position |
There was a problem hiding this comment.
Saving removes dashboard dates
Saving a layout change on a filtered dashboard removes its date controls and stops applying their dates until the layout reloads. useSavePageLayout replaces the stored layout with the mutation response, but that response does not select filters. The new query loads them initially, while PageLayoutTabsRenderer removes the provider when they are missing.
Include filters in the save response, preserve them during replacement, or refetch the layout after saving.
| const DATE_OPERANDS: ViewFilterOperand[] = getRecordFilterOperands({ | ||
| filterType: 'DATE', | ||
| }) | ||
| .filter((operand) => operand !== ViewFilterOperand.IS_RELATIVE) | ||
| .map((operand) => ViewFilterOperand[operand]); |
There was a problem hiding this comment.
Saved relative dates filter charts, but viewers cannot see or edit the period correctly. The server accepts IS_RELATIVE, while DATE_OPERANDS removes it, so opening such a filter shows IS instead. DashboardDateFilter also cannot format its relative value, leaving only the label and a colon.
Support relative dates with the existing relative-date picker and display helpers so viewers can read the active period and change it.
7085e41
into
ehco/dashboard-filter-chart-queries
LogDetails |
What
Viewers can change a saved dashboard date filter from the bar below the tabs. For example, changing Reporting period narrows the bar, line, and pie charts connected to that filter. A tab shows a chip when one of its visible charts uses that filter.
How
Stacked on #32378. Creating and connecting filters in the editor, record tables, and chart drilldown are follow-ups.
Testing
Passed 11 focused frontend tests across three suites, along with the frontend typecheck and lint. The viewer coverage checks clearing the date, switching tabs, and resetting to the saved default.