feat(analytics): #34353 wire engagement dashboard to real API and fix visual issues#34758
Merged
oidacra merged 5 commits intoissue-33882-primeng-updatefrom Feb 26, 2026
Merged
Conversation
Legal RiskThe following dependencies were released under a license that RecommendationWhile merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue. MPL-2.0
|
…cate detection, file classification, issue validation, SCSS/HTML style review, team routing, and test quality
- Added new interface to support current and previous period data for sparkline visualization. - Updated engagement-related components to utilize the new sparkline data structure, allowing for meaningful trend comparisons. - Refactored the feature to include conversion rate measures in the sparkline data. - Adjusted HTML templates and component logic to reflect changes in data handling and improve user experience. - Removed language platform metrics from the analytics dashboard to streamline data presentation. These enhancements aim to provide clearer insights into engagement trends over time, improving the overall analytics dashboard functionality.
9c93ace to
12e2e82
Compare
5 tasks
… analytics dashboard - Wire up Engagement report to real API via withEngagement signal store feature - Add sparkline comparison between current and previous periods - Scope ::ng-deep, merge duplicate ng-deep blocks, replace inline styles with Tailwind - Fix Spectator setInput patterns (NG0950), mockProvider, byTestId across all spec files - Fix SparklineDataPoint import path (relative → @dotcms/portlets/dot-analytics/data-access) - Normalize report section gaps to gap-10 (rows) and gap-6 (columns) - Add "Got it" button to engagement calculation dialog - Add i18n keys for new engagement UI elements
- Deleted the README.md files for both the agents and skills directories as they contained redundant information and were no longer necessary for the current project structure. - This cleanup helps streamline the documentation and focuses on the most relevant resources for developers.
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.
Summary
Enhance the analytics engagement dashboard with dual-period sparkline comparison, improved chart interactions, and UI refinements across engagement and pageview reports.
CleanShot.2026-02-25.at.16.50.41.mp4
Changes Made
Frontend - Engagement Sparkline (Current vs Previous Period)
DotAnalyticsSparklineComponentto accept an array ofSparklineDatasetobjects instead of a single data series, enabling multi-line sparkline comparisonSparklineDatasetinterface withlabel,data,color,dashed,borderWidth, andfillOpacityproperties for per-dataset customizationwith-engagement.feature.tsstore to fetch both current and previous period data usingforkJoinandgetPreviousPeriod(), mapping results toEngagementSparklineDataEngagementSparklineDatainterface toengagement.types.tsto hold current and previous sparkline dataFrontend - Chart Interactions & Plugins
sparkline-crosshair.plugin.ts- a Chart.js plugin that draws a vertical crosshair line and custom hover points at the active index, bypassing Chart.js internal clipping at chart edgesgradient-fill.plugin.tsto apply gradient fills to ALL filled datasets (not just the first), using each dataset'sborderColorand optional_fillOpacitymultiplierFrontend - Engagement Platforms Table
PlatformsData, template, store query, utils, specs) - only Device and Browser remaintoEngagementPlatforms()andgetEmptyEngagementPlatforms()utilitiesFrontend - Top Performing Pages Table
[paginator]="true", 10 rows per page, no rows-per-page selector)p-cardwrapper - table renders directly for a cleaner layoutcentertorightp-datatable-smclass for better row heightjustify-centeron flex container)Backend - ClickHouse Schema
DEPENDS ONclauses between downstream MVs andsession_facts_rmvfor correct refresh orderingutc_timefromDateTimetoDateTime64(3,'UTC')for millisecond precisiontoDate(session_start)->toDate(session_start, 'UTC')contextSiteIddimension tositeIdacross all Cube.js schemas for consistencyEngagementDaily.jsCube schema explaining whyconversionRateshould be used instead ofengagementRatefor day-level trendsi18n
analytics.engagement.sparkline.period-currentandanalytics.engagement.sparkline.period-previoustranslation keys toLanguage.propertiesEvent Generator
User-AgentHTTP header passthrough so device profiles (Desktop/Mobile/Tablet) are correctly classified by the backend UA parserTechnical Details
The sparkline now shows two lines: current period (blue, 2px, gradient fill) and previous period (gray, 1px, subtle gradient with
fillOpacity: 0.35). The gradient fill plugin was generalized to iterate all datasets withfill: true, reading each dataset'sborderColorfor the gradient color and an optional_fillOpacitycustom property as an opacity multiplier.Native Chart.js hover points are disabled (
hoverRadius: 0) because they get clipped at chart edges. Instead, the crosshair plugin draws custom hover circles usingctx.arc()in theafterDrawhook, which renders outside the chart area clipping boundary.Breaking Changes
PlatformsDatainterface no longer includeslanguagepropertySparklineDataset[]input replaces the previous single-seriesdatainput onDotAnalyticsSparklineComponentTABLE_CONFIGno longer includesVIRTUAL_SCROLL_ITEM_SIZEorSCROLL_HEIGHTTesting
Related Issues
Closes #34353
This PR fixes: #34353