Split the DAP Impact New vs returning panel
What does this MR do and why?
Fixes the "New vs returning" panel on the DAP Impact dashboard's Adoption view. It queried AiUsageEvent grouped by feature — users per feature, not new vs returning.
Now it queries DuoWorkflow with joinedUsersCount and returningUsersCount, rendered as a bar list with one row per metric.
- Added
%{rangeDays}and%{previousStartDate}to the analytics GLQL data source soreturningUsersCounthas a prior bucket to compare against. They're not substituted into the comparison query, so they don't combine withshowTrends. - Added a
metricRows: trueoption to the bar list presenter, since one-row-per-metric used to require a query with no dimension, and this query can't drop its date dimension.
Known gap: if the selected range has no sessions but the previous one does, the panel shows the previous window's numbers instead. Same root cause as #598302.
Replaces the bar chart approach flagged in earlier review here. All 46 dashboard queries still compile on GLQL 0.39.0; the 109 bar list and data source specs pass in Vue 3 mode.
Note on the axis
The mockup has a value axis, 0 to 1.8k, gridlines. This doesn't — bar list always hides its value axis and sizes bars as a share of the track, and the row labels already carry the value and share (New · 438 · 22%), so an axis would be redundant. A real one needs a new bar chart mode with metrics on the category axis, which doesn't exist yet. Same reason for one blue instead of the mockup's two shades — bar list is single-color by design.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Enable the feature flag in a rails console:
Feature.enable(:dap_impact_v1). - Make sure Siphon is replicating into ClickHouse (
siphon.enabled: trueingdk.yml, Postgres running withwal_level = logical). - Open the DAP Impact dashboard's Adoption view and check the "New vs returning" panel.
Local seed data is thin, often a single distinct user, so the split looks sparse even when it's working.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.