thunder icon indicating copy to clipboard operation
thunder copied to clipboard

Improvements to feed page and app bars

Open hjiangsu opened this issue 9 months ago • 0 comments

Pull Request Description

This PR applies some improvements to the feed page to reduce a few sources of potential jank. In particular:

  • The showAppBarTitle logic has been moved from FeedPage to its respective app bar widgets (FeedPageAppBar and AccountPageAppBar). This change ensures that setState calls are handled within the app bar widgets and prevents unnecessary rebuilds of the entire FeedPage when showAppBarTitle updates.
  • A new widget was created FeedEndIndicator to display the appropriate element at the end of the feed (e.g., a loading icon or an "end of feed" message). While this change doesn't directly impact performance, it improves the experience when attempting to perform profiling on Thunder.

For some context on FeedEndIndicator:

  • Previously, a loading indicator was always displayed at the end of the feed if additional items could be fetched from the API. This made it difficult to profile the app and detect jank frames as the loading animation constantly created new frames, causing any jank frames to disappear from the profiling tools.
  • To improve profiling, I've adjusted the logic so that the loading indicator only appears when the user scrolls near the end of the feed. This prevents unnecessary frame generation and makes it easier to analyze and diagnose jank frames.

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

Checklist

  • [ ] If a new package was added, did you ensure it uses an appropriate license and is actively maintained?
  • [ ] Did you use localized strings (and added appropriate descriptions) where applicable?
  • [ ] Did you add semanticLabels where applicable for accessibility?

hjiangsu avatar Mar 13 '25 17:03 hjiangsu