Skip to content

Comments

Add pull-to-refresh to HomePage for both layouts#264

Merged
ZanderCowboy merged 6 commits intodevelopfrom
copilot/implement-refresh-manual-functionality
Feb 9, 2026
Merged

Add pull-to-refresh to HomePage for both layouts#264
ZanderCowboy merged 6 commits intodevelopfrom
copilot/implement-refresh-manual-functionality

Conversation

Copy link

Copilot AI commented Feb 9, 2026

Enables manual refresh via pull-to-refresh gesture on HomePage, triggering fresh DB fetch and displaying confirmation message.

Changes

  • Wrapped both layout widgets with RefreshIndicator

    • Horizontal layout: Direct wrap on CustomScrollView
    • Vertical layout: Wrapped with SingleChildScrollView to enable vertical pull on horizontally-scrolling content
  • Added _HomeRefreshHelper extension on BuildContext

    • Dispatches HomeEvent.refresh()
    • Waits for BLoC state update via bloc.stream.firstWhere(!isLoading) with 5s timeout
    • Shows floating "Refreshed." SnackBar with theme-based text color for proper contrast
extension _HomeRefreshHelper on BuildContext {
  Future<void> performHomeRefresh() async {
    final bloc = read<HomeBloc>();
    bloc.add(const HomeEvent.refresh());
    
    await bloc.stream
        .firstWhere((state) => !state.isLoading)
        .timeout(const Duration(seconds: 5));
    
    if (mounted) {
      ScaffoldMessenger.of(this).showSnackBar(/* ... */);
    }
  }
}

Notes

Vertical layout requires nested scroll structure (outer vertical for refresh, inner horizontal for tabs) - intentional trade-off for consistent UX across layouts.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement Refresh Manual Functionality</issue_title>
<issue_description>Add functionality to the HomePage for the user to be able to pull down from the top of the page and see the circular indicator for refreshing. We should then do a fresh fetch from the DB and update the UI.

This should work for both layouts, horizontal and vertical.

After updating, indicate to the user with a floating text message with no background at the bottom of the page, that the page was updated: "Refreshed."</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 9, 2026 11:44
Co-authored-by: ZanderCowboy <59666243+ZanderCowboy@users.noreply.github.com>
Co-authored-by: ZanderCowboy <59666243+ZanderCowboy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add refresh manual functionality to HomePage Add pull-to-refresh to HomePage for both layouts Feb 9, 2026
Copilot AI requested a review from ZanderCowboy February 9, 2026 11:47
@ZanderCowboy ZanderCowboy linked an issue Feb 9, 2026 that may be closed by this pull request
@ZanderCowboy ZanderCowboy added this to the Release 3 milestone Feb 9, 2026
@ZanderCowboy ZanderCowboy added enhancement New feature or request feature Create a new feature labels Feb 9, 2026
@ZanderCowboy ZanderCowboy marked this pull request as ready for review February 9, 2026 13:02
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

@ZanderCowboy ZanderCowboy merged commit 815b79c into develop Feb 9, 2026
6 checks passed
@ZanderCowboy ZanderCowboy deleted the copilot/implement-refresh-manual-functionality branch February 9, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature Create a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Refresh Manual Functionality

2 participants