Skip to content

feat(core): drive the unified search modal from the search controller#62093

Open
pringelmann wants to merge 3 commits into
masterfrom
feat/search-controller-adapter
Open

feat(core): drive the unified search modal from the search controller#62093
pringelmann wants to merge 3 commits into
masterfrom
feat/search-controller-adapter

Conversation

@pringelmann

@pringelmann pringelmann commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves search orchestration out of the modal and into UnifiedSearchController, wired up through a new useUnifiedSearch composable. The modal now just renders the controller's per-category state.

-> Preview link <-

Per-category filter params (date, person, provider) are forwarded so filters page correctly on "Load more".

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI (mostly tests)

…roller

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann self-assigned this Jul 14, 2026
@pringelmann pringelmann force-pushed the feat/search-controller-adapter branch 2 times, most recently from e85573a to 74dab71 Compare July 14, 2026 14:13
private revealTimer: ReturnType<typeof setTimeout> | null = null
private pendingCancels: (() => void)[] = []

constructor(private onChange?: (states: Record<string, CategorySearchState>) => void) {}

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.

The controller now takes one onChange callback. I opted for this approach to keep things simple (instead of an event bus or a store). There's a single owner and a single consumer: useUnifiedSearch creates the controller, adapts the callback to a shallowRef, and disposes it on unmount. A callback keeps the controller plain TS with no framework dependency, so it unit-tests without mounting Vue. Pub/sub would add subscriber bookkeeping for listeners that don't exist, and a store would pull in reactivity the core doesn't need.

Happy to debate :)

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the feat/search-controller-adapter branch from 74dab71 to c3ee5c2 Compare July 14, 2026 14:37
@pringelmann pringelmann added enhancement 3. to review Waiting for reviews feature: search team: IDP Code maintained by 🪪 IDP team labels Jul 14, 2026
@pringelmann pringelmann added this to the Nextcloud 35 milestone Jul 14, 2026
@pringelmann pringelmann marked this pull request as ready for review July 14, 2026 14:39
@pringelmann pringelmann requested a review from a team as a code owner July 14, 2026 14:39
@pringelmann pringelmann requested review from CarlSchwan, nfebe, skjnldsv, sorbaugh and susnux and removed request for a team July 14, 2026 14:39
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.

Vue adapter + wire the loading controller into the modal

2 participants