Skip to content

feat(search): virtualise results list with 500-result soft cap (#677)#678

Merged
astar-development-jb merged 4 commits into
mainfrom
feature/677-search-virtualise
Jun 22, 2026
Merged

feat(search): virtualise results list with 500-result soft cap (#677)#678
astar-development-jb merged 4 commits into
mainfrom
feature/677-search-virtualise

Conversation

@jaybarden1

Copy link
Copy Markdown
Contributor

Summary

  • Caps search results at 500 with a localised notice ("Showing top 500 results. Refine your search to see more.") when the limit is hit — IsCapped property drives visibility
  • Replaces WrapPanel with VirtualizingStackPanel in SyncedFileSearchView so only visible containers incur layout and render cost
  • Defers thumbnail loading to Avalonia's ContainerPrepared event and cancels on ContainerClearing via a per-VM CancellationTokenSource, eliminating off-screen thumbnail decodes
  • Bumps ApplicationVersion 0.26.00.27.0

Closes #677

Type of change

  • Feature

Related issues / links

Closes #677

How was this tested?

  • Unit tests added/updated

New tests in GivenASyncedFileSearchViewModel:

  • cap boundary at exactly 500 (not capped) and 501 (capped)
  • Results.Count and ResultCount both capped at 500
  • CappedNoticeText delegates to localisation service
  • thumbnail is NOT loaded automatically after SearchAsync (deferred to container)

New test in GivenASyncedFileResultViewModel:

  • CancelThumbnailLoad() aborts an in-progress decode and leaves Thumbnail null

Impacted areas

apps/desktop/AStar.Dev.OneDrive.Sync.Client — search view, search VM, result VM, localisation files


TDD Checklist (required)

  • Builds locally
  • Tests pass (dotnet test)
  • No new analyzer warnings
  • Public API changes reviewed
  • Documentation updated (if applicable)

How to run tests locally

dotnet restore AStar.Dev.slnx
dotnet test --verbosity normal

Notes for reviewers

  • VirtualizingStackPanel implements ILogicalScrollable in Avalonia 11, so placing it inside the existing ScrollViewer (* row, MinHeight="0") gives a correctly-bounded viewport — scroll delegation passes to the panel, enabling virtualisation.
  • CancelThumbnailLoad() posts Thumbnail = null via the dispatcher to handle the race where a fast decode completes before cancel is processed.

🤖 Generated with Claude Code

jaybarden1 and others added 3 commits June 22, 2026 19:30
…#677)

4 compile errors expected — IsCapped, CappedNoticeText, CancelThumbnailLoad not yet implemented.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add IsCapped / CappedNoticeText to SyncedFileSearchViewModel; results
  capped at 500 with localised notice when limit is hit
- Replace WrapPanel with VirtualizingStackPanel in SyncedFileSearchView
  so only visible containers incur layout/render cost
- Defer thumbnail loading to ContainerPrepared; cancel on ContainerClearing
  via CancellationTokenSource in SyncedFileResultViewModel
- Bump ApplicationVersion 0.26.0 → 0.27.0

Closes #677

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jaybarden1 jaybarden1 requested a review from a team June 22, 2026 19:03
@astar-development-jb astar-development-jb enabled auto-merge (squash) June 22, 2026 19:04
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Test results

2 522 tests  +33   2 521 ✅ +34   4m 2s ⏱️ + 3m 26s
   10 suites + 1       1 💤 ± 0 
   10 files   + 1       0 ❌  -  1 

Results for commit d57b51f. ± Comparison against base commit 2d4483e.

♻️ This comment has been updated with latest results.

…#677)

500-result cap bounds render cost without requiring layout change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@astar-development-jb astar-development-jb merged commit 3b52076 into main Jun 22, 2026
7 checks passed
@astar-development-jb astar-development-jb deleted the feature/677-search-virtualise branch June 22, 2026 19:16
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.

feat(search): virtualise search results list with 500-result soft cap

2 participants