Make the Stats chart loading placeholders cheaper to render - #25940
Open
crazytonyli wants to merge 4 commits into
Open
Make the Stats chart loading placeholders cheaper to render#25940crazytonyli wants to merge 4 commits into
crazytonyli wants to merge 4 commits into
Conversation
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.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33981 | |
| Version | PR #25940 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | e86fe1d | |
| Installation URL | 7drrv01997ljg |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33981 | |
| Version | PR #25940 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | e86fe1d | |
| Installation URL | 4fieee0fvnj78 |
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.


Description
This is an alternative to #25931.
There are two main change: