Skip to content

fix: show progress while loading deb search - #2192

Open
skdas20 wants to merge 2 commits into
ubuntu:mainfrom
skdas20:fix/deb-search-loading-indicator
Open

skdas20 wants to merge 2 commits into
ubuntu:mainfrom
skdas20:fix/deb-search-loading-indicator

Conversation

@skdas20

@skdas20 skdas20 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What

  • Keep Debian search results in a loading state while AppStream initializes.
  • Preserve the existing fast autocomplete behavior through a dedicated provider.
  • Add a widget regression test that switches the package source from Snap to Deb.

Why

When the package source changes to Deb before AppStream has initialized, the provider currently emits an empty result first. The results page therefore shows the empty state while the search is still running instead of displaying its progress indicator.

Fixes #2094.

Testing

  • flutter test --no-pub (233 tests passed)
  • flutter analyze --no-pub --fatal-infos
  • Dart formatting and git diff --check

@ogres

ogres commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the fix, @skdas20! The approach of keeping autocomplete on the original provider and using a separate one for the results page looks good.

One concern: I ran shows progress when switching to deb search against the base versions of appstream_search.dart and search_page.dart, and it still passes. It finds a YaruCircularProgressIndicator even without the fix, so it wouldn't catch a regression. Could you tighten it so it fails on the old code? For example, assert that the "no results" text is absent while init() is pending and present after initialized.complete(), and scope the indicator lookup to the deb results.

Also, the CLA check is failing, so it will need to be signed before this can be merged.

Thanks again!

@skdas20

skdas20 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ogres, good catch. The CLA is now signed. I'll tighten the test so it fails on the base version: assert the "no results" text is absent while init() is pending and present after initialized.complete(), and scope the progress-indicator lookup to the deb results.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused changes preserve autocomplete behavior and cover the loading-state regression, with no blocking issues identified.

No open issues 🎉

What changed in this PR

Fixes #2094 by keeping Debian search results in a loading state while AppStream initializes, so Ubuntu App Center shows progress instead of a premature empty state.

Changes:

  • Adds a loading-aware search provider while preserving fast autocomplete behavior.
  • Updates Debian results and retry handling to use the new provider.
  • Adds a widget regression test for switching from Snap to Deb during initialization.
File Description
packages/​app_center/​test/​search_page_test.dart Tests progress during initialization and the empty state after completion.
packages/​app_center/​lib/​search/​search_page.dart Uses the loading-aware provider for Debian results and retries.
packages/​app_center/​lib/​appstream/​appstream_search.dart Shares search logic between autocomplete and loading-aware providers.

Review effort: Balanced

(
ref,
query,
) => _search(query, returnBeforeInitialization: true),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we actually need this? Where do we use it?

@skdas20

skdas20 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Yes. appstreamSearchProvider is still used by search_provider.dart for autocomplete, where returning an empty list while AppStream initializes keeps typing responsive. The new appstreamSearchWithLoadingProvider is used only by the full Debian results page and its retry path, where waiting for initialization lets the UI show progress instead of a premature empty result. They share _search; the separate providers preserve those two behaviors.

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.

No search progress indication after changing package source

3 participants