Skip to content

Add shimmer loading state for favorites on Home - #6

Merged
IgnacioLD merged 1 commit into
masterfrom
3-add-shimmer-effect-on-favorites-it-rn-does-nothing-before-loading-favs
Jul 31, 2026
Merged

Add shimmer loading state for favorites on Home#6
IgnacioLD merged 1 commit into
masterfrom
3-add-shimmer-effect-on-favorites-it-rn-does-nothing-before-loading-favs

Conversation

@IgnacioLD

Copy link
Copy Markdown
Owner

Closes #3

What

Favorites on the Home screen used to flash the empty state and then pop in, because the stops catalog emits an empty list before its first network fetch resolves. This shows shimmer placeholder cards while favorites are pending instead.

Changes

  • Shimmer loading: new FavoriteStopCardSkeleton that mirrors the real FavoriteStopCard layout; HomeUiState.Ready gains an isLoading flag (true when the user has favorited stops but they haven't resolved yet), and HomeScreen renders the skeleton during that window.
  • Fix pull-to-refresh getting stuck:
    • The polling loop consumed refresh signals without breaking its wait, so arrivals only re-fetched on the 30s cadence. The loop now breaks on signal for an immediate fetch (arrivals + alerts).
    • AnimatedContent was keyed on the whole state, recreating PullToRefreshBox mid-gesture. Keyed it on the state kind (contentKey) instead.
    • The spinner now dismisses on a fixed timer instead of waiting on data arrival (which can be deduped by distinctUntilChanged and leave it stuck).
  • Fix bottom inset: the nested Home Scaffold re-applied the system navigation-bar inset even though the host Scaffold already insets above the bottom bar, cutting into the list. Set contentWindowInsets = WindowInsets(0).

Tested

Built and ran on a physical device: favorites shimmer while loading, pull-to-refresh updates instantly and the spinner dismisses promptly, and the list bottom is no longer cut off.

Favorites previously flashed the empty state then popped in: the stops
catalog emits an empty list before its first network fetch, so the
favorites list appeared empty then suddenly filled. Show shimmer
placeholder cards while favorites are pending instead.

Also fixes pull-to-refresh getting stuck:
- The polling loop consumed refresh signals without breaking its wait, so
  arrivals only re-fetched on the 30s cadence. The loop now breaks on
  signal for an immediate fetch.
- AnimatedContent was keyed on the whole state, recreating PullToRefreshBox
  mid-gesture. Keyed it on the state kind instead.
- The spinner now dismisses on a fixed timer instead of waiting on data
  arrival (which can be deduped and leave it stuck).

Removes a double bottom system-bar inset on the nested Home Scaffold that
cut into the list.

Signed-off-by: IgnacioLD <nadeloyeda@gmail.com>
@IgnacioLD IgnacioLD linked an issue Jul 31, 2026 that may be closed by this pull request
@IgnacioLD
IgnacioLD merged commit c5410f6 into master Jul 31, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Planning TransitOS Jul 31, 2026
@IgnacioLD
IgnacioLD deleted the 3-add-shimmer-effect-on-favorites-it-rn-does-nothing-before-loading-favs branch July 31, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add shimmer effect on Favorites, it RN does nothing before loading FAVS

1 participant