Skip to content

feat(core): add unified search loading controller#61941

Merged
CarlSchwan merged 8 commits into
masterfrom
feat/search-loading-controller
Jul 10, 2026
Merged

feat(core): add unified search loading controller#61941
CarlSchwan merged 8 commits into
masterfrom
feat/search-loading-controller

Conversation

@pringelmann

@pringelmann pringelmann commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a standalone controller for unified search's loading and ordering, pulled out of the UI so it can be unit-tested on its own. Nothing consumes it yet; the wiring is a follow-up.

Implements the algorithm described in #60241.

What it does

  • Per-category state machine: loading / loaded / blocked / failed.
  • Renders results in priority order. A lower-priority category stays blocked until the ones above it arrive, or a 1500ms timer reveals it, so results stop reshuffling on screen once they're shown.
  • Cancels in-flight requests when a new search starts and drops stale responses.
  • Cursor-based pagination per category. A failed page fetch keeps the results already shown and flags itself so it can be retried.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit) are included
  • Screenshots before/after for front-end changes (no visual changes)
  • Documentation has been updated or is not required
  • Backports requested where applicable
  • Labels added where applicable
  • Milestone added for target branch/version

AI

  • The content of this PR was partly generated using AI (jsdocs, test scaffolding and specs. All reviewed by me)

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
* @param {string} options.until the search
* @param {string} options.limit the search
* @param {string} options.person the search
* @param {object} options.extraQueries additional queries to filter search results

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Small cleanup since the param docs were copy-paste stubs. No behaviour change.

@pringelmann pringelmann added enhancement feature: search team: IDP Code maintained by 🪪 IDP team labels Jul 9, 2026
@pringelmann pringelmann self-assigned this Jul 9, 2026
@pringelmann pringelmann added this to the Nextcloud 35 milestone Jul 9, 2026
@pringelmann pringelmann added the 3. to review Waiting for reviews label Jul 9, 2026
@pringelmann pringelmann marked this pull request as ready for review July 9, 2026 13:17
@pringelmann pringelmann requested a review from a team as a code owner July 9, 2026 13:17
@pringelmann pringelmann requested review from nfebe, skjnldsv, sorbaugh and susnux and removed request for a team July 9, 2026 13:17
Comment thread core/src/services/UnifiedSearchController.ts
Comment thread core/src/services/UnifiedSearchController.ts Outdated
Comment thread core/src/services/UnifiedSearchController.ts Outdated
@pringelmann pringelmann requested a review from susnux July 9, 2026 14:20

@susnux susnux left a comment

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.

looks good

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the feat/search-loading-controller branch from 224d7a6 to 68bfa34 Compare July 9, 2026 15:25
@CarlSchwan CarlSchwan merged commit eb85e51 into master Jul 10, 2026
208 of 218 checks passed
@CarlSchwan CarlSchwan deleted the feat/search-loading-controller branch July 10, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement feature: search team: IDP Code maintained by 🪪 IDP team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading/order algorithm + cancellation + pagination

3 participants