Skip to content

PAINTROID-723: Fix CircularProgressIndicator animation on landing page - #176

Open
aryanorastar wants to merge 1 commit into
Catrobat:developfrom
aryanorastar:bug/PAINTROID-723-progress-indicator-animation
Open

aryanorastar wants to merge 1 commit into
Catrobat:developfrom
aryanorastar:bug/PAINTROID-723-progress-indicator-animation

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Aug 16, 2026 •

Copy link
Copy Markdown

Ticket: https://catrobat.atlassian.net/browse/PAINTROID-723

New Features and Enhancements

  • None

Refactorings and Bug Fixes

  • Landing page passed a new _getProjects() future into FutureBuilder on every rebuild, which restarted CircularProgressIndicator and made the spinner look stuck / non-animated.
  • Cache the projects Future on State; recreate it when returning from Pocket Paint and when ProjectDatabase is replaced after invalidate (delete/rename).
  • Widget test: while the list future is pending, rebuilds do not call getProjects() again.

Checklist

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Add the link to the ticket in Jira in the description of the PR
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines (Wiki)
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Add new information to the Wiki

Verification

  • flutter test test/widget/landing_page/landing_page_test.dart — 21/21 passed
  • Physical device / emulator animation smoke not run here

Cache the projects Future so FutureBuilder does not restart the
indicator on every rebuild. Refresh after returning from Pocket Paint
and when ProjectDatabase is invalidated.
@aryanorastar
aryanorastar force-pushed the bug/PAINTROID-723-progress-indicator-animation branch from 7845df8 to 05f792c Compare August 16, 2026 06:27
},
);

testWidgets(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this test catches the regression. Nothing rebuilds LandingPage while the completer is pending, because the bare tester.pump() calls don't trigger a rebuild. On develop, the build during loading fails on the uninitialized database before it reaches the mock, so getProjects() is called exactly once there as well. called(1) would pass without the fix.

}

void _refreshProjectsFuture() {
_projectsFuture = _getProjects();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the future is cached, one failed getProjects() call leaves the page on the spinner .

Could we handle the error state, e.g. show an error or retry option when snapshot.hasError, or reset _projectsFuture on error? This is fine as a follow-up if it's out of scope here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants