Skip to content

Show "No results found." instead of an endless loading message - #730

Merged
ZeldaZach merged 1 commit into
mainfrom
fix-no-search-results
Sep 8, 2026
Merged

ZeldaZach merged 1 commit into
mainfrom
fix-no-search-results

Conversation

@ZeldaZach

Copy link
Copy Markdown
Member

Fixes #709

Problem

DownloadList.vue used one condition to represent two different states:

div(v-if="resultsTotalLength === 0")
  p.results-message Loading...

resultsTotalLength starts at 0 and is also 0 when a search matches nothing, so filtering All Sets or All Decks by something like "blah blah blah" left the page stuck on "Loading..." forever.

Changes

  • Loading is now derived from the fetched data itself (isLoading = defaultList.length === 0), and an empty result set gets its own No results found. message.
  • Counts are seeded by a watch on defaultList with immediate: true rather than onMounted. SetList/DeckList are fetched in Layout.vue's onMounted, so the old hook read an empty array on every load.
  • DownloadSorter.vue watches props.list and re-applies the active search/filters when the data lands. Its only prior onHandleChange call was a 300ms timeout fired at mount, which raced the API response.

Testing

eslint clean on both components, vitepress build succeeds, and the jest suite passes (26 tests). The interaction itself was not driven in a browser.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xba7S7uYsrKAVdniqNcfhS

The All Sets and All Decks lists used `resultsTotalLength === 0` to decide
whether the data was still loading, so a search that matched nothing was
indistinguishable from a fetch that had not finished and the page sat on
"Loading..." forever.

Loading is now derived from the fetched list itself, and an empty result set
gets its own message. The counts are also seeded from a watcher rather than
onMounted, and the sorter re-applies the active search/filters when the list
lands, since both components mount before the API response arrives.

Fixes #709

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xba7S7uYsrKAVdniqNcfhS
@ZeldaZach
ZeldaZach merged commit 837d31d into main Sep 8, 2026
3 checks passed
@ZeldaZach
ZeldaZach deleted the fix-no-search-results branch September 8, 2026 17:45
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5d085ec) to head (e93abc4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #730   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           69        69           
  Branches        27        27           
=========================================
  Hits            69        69           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 results shows a loading message indefinitely

1 participant