Skip to content

Make the Stats chart loading placeholders cheaper to render - #25940

Open
crazytonyli wants to merge 4 commits into
trunkfrom
task/stats-placeholder-redaction-mode
Open

Make the Stats chart loading placeholders cheaper to render#25940
crazytonyli wants to merge 4 commits into
trunkfrom
task/stats-placeholder-redaction-mode

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Description

This is an alternative to #25931.

There are two main change:

  1. Remove some unneeded UI elements in the chart when it's drawn as a placeholder.
  2. Only generate one copy of mock data to draw the placeholder views. That's an existing issue in the chart: the mock chart data is randomly generated, and you'll notice the placeholder changes after entering the Stats screen.

BarChartView and LineChartView read the redaction reasons from the
environment. While redacted as a placeholder they draw flat fills and
drop the comparison marks, average line, annotations, selection, gestures,
and animations, none of which are visible at placeholder opacity.

Measured on a Debug build, iOS 26.5 simulator: first push into Stats
367 ms -> 343 ms (mean of 12 runs).
A single blank x-axis label keeps the axis height and one preformatted
y-axis label keeps the gutter width, instead of formatting a date or value
per tick.

Measured on a Debug build, iOS 26.5 simulator: 343 ms -> 334 ms (mean of
8 runs); baseline 365 ms.
SparklineChart reads the redaction reasons like the main charts: while
redacted as a placeholder it draws a flat area fill and no previous-day
line.

Measured on a Debug build, iOS 26.5 simulator: about 10 ms off the first
push into Stats.
ChartCard regenerated random mock data on every body evaluation, so each
re-render during loading produced a new ChartData and the placeholder
chart re-laid out with different bars. The view model now keeps one copy
per date range and granularity. The Today card's placeholder data is
generated once per process for the same reason.
@crazytonyli crazytonyli added this to the 27.3 milestone Aug 26, 2026
@crazytonyli
crazytonyli requested a review from jkmassel August 26, 2026 02:04
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33981
VersionPR #25940
Bundle IDcom.jetpack.alpha
Commite86fe1d
Installation URL7drrv01997ljg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33981
VersionPR #25940
Bundle IDorg.wordpress.alpha
Commite86fe1d
Installation URL4fieee0fvnj78
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants