Skip to content

Improve first-open performance of the new Stats screen - #25931

Closed
crazytonyli wants to merge 2 commits into
trunkfrom
task/new-stats-first-open-performance
Closed

Improve first-open performance of the new Stats screen#25931
crazytonyli wants to merge 2 commits into
trunkfrom
task/new-stats-first-open-performance

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Two changes:

  • Lazy load some charts.
  • Use placeholder graphs, instead of redacted real charts.
Before After
loading-top-before loading-top-after

@crazytonyli
crazytonyli requested a review from jkmassel August 24, 2026 02:02
@crazytonyli crazytonyli added this to the 27.3 milestone Aug 24, 2026
@crazytonyli
crazytonyli marked this pull request as ready for review August 24, 2026 02:03
@crazytonyli
crazytonyli enabled auto-merge August 24, 2026 02:04
@wpmobilebot

wpmobilebot commented Aug 24, 2026

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 Number33963
VersionPR #25931
Bundle IDorg.wordpress.alpha
Commitb1cc092
Installation URL3plgre04dm0l8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Aug 24, 2026

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 Number33963
VersionPR #25931
Bundle IDcom.jetpack.alpha
Commitb1cc092
Installation URL5uisvr0aqs1i0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jkmassel jkmassel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems generally good, but the bar width is pretty different between the placeholder and the actual data – the screenshots on the PR actually show the issue decently well.

Apart from that it seems good – I tested on two devices side-by-side and the loading is very nice and smooth.

@crazytonyli

Copy link
Copy Markdown
Contributor Author

but the bar width is pretty different between the placeholder and the actual data

I did not try to match the look, because I don't want to overly complicate the skeleton placeholder view. If we want to match the look, we'd need to pass the selected date range to the placeholder SwiftUI view, which then calculate number of the data points (7 for 7 days, 30 for a month, 12 for a year, plus there is custom date range) and then calculate the width based on that. I feel like that's too much for a placeholder view that's basically a loading indicator.

@crazytonyli
crazytonyli requested a review from jkmassel August 24, 2026 21:18
@jkmassel

Copy link
Copy Markdown
Contributor

As it stands now, this would be a visual regression – I understand the desire to keep it simple, but I'm not sure it's with the loss of polish. It's especially pronounced on a chart that shows 30 bar lines 😞

@crazytonyli
crazytonyli force-pushed the task/new-stats-first-open-performance branch from 0872a07 to ef439c5 Compare August 25, 2026 22:17
@crazytonyli
crazytonyli disabled the stack merge August 25, 2026 22:17
@crazytonyli
crazytonyli changed the base branch from trunk to task/stats-lazy-card-list August 25, 2026 22:17
@crazytonyli
crazytonyli force-pushed the task/new-stats-first-open-performance branch from ef439c5 to be48d6a Compare August 25, 2026 22:31
Base automatically changed from task/stats-lazy-card-list to trunk August 26, 2026 00:00
While the first data set loads, ChartCard and TodayCard rendered real
Swift Charts filled with mock data purely as redacted placeholders.
Instantiating Swift Charts (and compiling its Metal shaders) inside the
navigation transition was a measurable part of the first-open lag.

The placeholders are now lightweight shapes drawn in the metric color:
the chart card shows rounded bars or a polyline matching the selected
chart type, and the Today card shows a gently rising polyline echoing
the bell-curve flank its old fixture data produced. Both are replaced
by the real charts as soon as data arrives, and previews for the
placeholder states are included.
@crazytonyli

Copy link
Copy Markdown
Contributor Author

@jkmassel I decided to go with another direction (see #25940). If we coupled the new placeholder views in this PR too much with the original chart, it means we'll need to basically re-draw the chart in a different code, which I think is not ideal.

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