Repository navigation
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
|
|
@Expensify/design This is how the skeletons currently look for charts on the Home page and in the Search Page. Skeleton.charts.high.res.mp4A few questions: Should skeletons have some minimum duration? Right now they can sometimes be shown for such a short time that the transition feels a bit jarring. Another one is about bar charts. The mocks look good with the aspect ratio that the real cards have on the Home page, but in the Search Page, the charts are kind of stretched out. That works fine for pie charts and even line charts imo, but a stretched-out bar chart doesn’t look great. Insights.high.res.mp4A related question is how this fits with the upcoming Insights tab. The charts there have a similar aspect ratio to the ones on the Home page, so the stretched-out bar chart issue doesn’t really exist there. However, bar charts in Insights can also be horizontal, whereas so far we’ve only had vertical bar charts, so that would call for a different skeleton. I’m mostly wondering how much we should optimize for the current Search Page behavior here. If Insights is coming relatively soon, it might not make much sense to spend too much time on a perfect solution for the stretched-out bar chart if we’ll be using the same components there anyway. Do we know roughly how long Insights is expected to be behind the beta? |
|
@MelvinBot review |
|
@MelvinBot find regressions |
ReviewThe approach looks sound. I found one real layout-shift bug, one edge case to harden, and one cleanup request. 1. The pie placeholder reserves a legend row even when the chart hides its legend. 2. On web, the placeholder never goes away if the chart body renders no canvas.
Today's callers mostly filter out empty data first. Even so, these cases would now shimmer forever over a hidden chart, where they used to show a blank area. I haven't reproduced this in the app. To harden it, release the overlay when the body renders without a canvas. One way is for the body to render its own placeholder, or report an empty state, in those branches. 3. Unrelated comment removals (minor). Checked and fine
|
Regression checkI found one new regression risk. It adds to the two issues in my earlier review. 1. On web, every chart stays hidden forever if patch 005 is missing. I hit this myself. The web test environment had the PR code but not the new patch. "Spend over time", "Top categories" and "Top merchants" all stayed on their placeholders: Fix: Add a fallback that reveals the chart anyway. For example, drop the overlay after a short timeout once the lazy component has mounted. Or reveal it on the frame after mount if no first-draw event arrives. A dev-only warning when the timeout fires would also catch a dropped patch early. Still open from my earlier review:
What I checked and couldn't verify
|
|
Replying to this comment. 1 is fixed in On 2, the placeholder only stays up when a pie's groups all total 0. Every chart with something to draw mounts a canvas, and Insights and Home send empty data to their empty state before the chart mounts (InsightsChartWidget.tsx:80-81). That rests on the backend never sending all-zero groups, which nothing here enforces, since the callers only check the row count (resolveChartData.ts:55). If that data ever shows up, it should resolve to the empty state, which unmounts the placeholder along with the chart, so I'm not adding a release to SkiaWebChart. |
|
Replying to this comment. Not a bug: a patch that fails to apply can't get into a build, and removing it on purpose goes through the entry that says what depends on it. Install runs patch-package with |
|
@codex review |
|
@MelvinBot review |
Re-review (
|
I don't think we should have a minimum duration as that would hide the real data for longer than we need. I think it's only really jarring when the skeleton and graph has a bigger mismatch. It looks better on the insights page and on the pie chart. I wonder if there's a way to align them a bit more with what realistically will show up.
Agree. I think we'd want that if we go this route. I do overall quite like it on the insights page. The spend over time transition feels good to me. Very curious for what @Expensify/design thinks as well. I could also just see us not doing the charts at all if we think this feels too weird. The biggest question to me is: A) does it make it feel quicker and more responsive than the spinner and B) does the transition from skelly to real feel elegant. If the answer to A is no, then I think we drop it. If the answer is yes, then I think we work on just fixing the B thing. |
|
I'm also curious for @JmillsExpensify's thoughts here, but this is my take: I like them better on the Insight's page than eslewhere, but to me personally, these are not adding a whole lot of value. Especially on Home/Spend. I think a spinner with a little fade in on the chart would be nicer. But this is just my 2 cents of course. I think I argued for the spinner at the get go but everyone gravitated towards the chart skeletons, so I'm fine with continuing on if people are digging them. My perspective is just that they're never going to really match the end state, so the transition is always going to feel a bit jumpy. |
I'm fine with this. I think they sounded like a good idea, but seeing it I'm not fully convinced so if you think it's not a good idea then I think we don't go for it 👍 I think we just do the spinner |
|
@shawnborton @JmillsExpensify could you weigh in here? @dubielzyk-expensify and @dannymcclain are leaning toward dropping the chart skeletons in favor of a spinner with a fade-in on the chart, and I'd like to lock the direction before putting more work into this. The options I see:
Which one should I go with? |
|
Personally I am more than happy to try out just the spinner approach and see how that feels. Basically keep an eye on load times and if we feel like the page is feeling sluggish as a result of these, let's revisit with more specific skeleton styles. |
@shawnborton just want to make sure we're aligned on this one. So you mean this?
|
|
Yes, but I defer to Danny and Jon. |
Yeah this is a good shout—if we find that the spinners are feeling super slow we can revisit. |
|
Sounds good to me too 👍 |
|
Alright, I hear you. I’ll close this PR in favor of the fade-in spinners once I have them ready. |
|
Closed in favor of #103210 |

Explanation of Change
Each chart content component returned an
ActivityIndicatorwhile loading, andSkiaWebChartshowed a secondone while the web chart engine downloads. Both now draw
ChartSkeleton, one shape per chart view, and so does theSkeleton Wall's chart card, a spinner since #99560. Charts in messages
keep today's fallback.
ChartWidthBoxmeasures the width above the lazy chart boundary, and each chart body passes it to victory-native asexplicitSizewith plot bounds fromgetCartesianPlotBounds, so the chart draws in its first frame at theplaceholder's size. On web the canvas paints blank for a frame after mount, so
SkiaWebChartkeeps the chart hiddenunder the placeholder until the canvas dispatches
skia-first-draw, added by the005+emit-first-draw-eventSkiapatch.
Important
Spend over timeby default.insightsPagebeta) shows the vertical bar placeholder, and its body still measures its own width after mount.Fixed Issues
$ #98968
PROPOSAL:
Tests
Preconditions:
Spend over time.insightsPagein Settings > Troubleshoot > Beta overrides, in a browser window wider than the narrow layout breakpoint.1. Home shows one shape from the first painted frame to the chart (Account A, then Account B)
2. The web handover has no blank frame (Account A, web)
3. Each chart type holds its shape and its size (Account A, web)
main.4. Narrow layout and native (Account A)
Offline tests
QA Steps
Same as tests 1, 3 and 4. Test 2 needs the DevTools Performance panel, so it is developer facing.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari