Skip to content

refactor: split search requests from LeftSidebar#18686

Open
Antreesy wants to merge 2 commits into
mainfrom
feat/noid/global-search-preps
Open

refactor: split search requests from LeftSidebar#18686
Antreesy wants to merge 2 commits into
mainfrom
feat/noid/global-search-preps

Conversation

@Antreesy

Copy link
Copy Markdown
Contributor

☑️ Resolves

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

🖌️ UI Checklist

🏁 Checklist

  • 🌏 Tested with different browsers / clients:
    • Chromium (Chrome / Edge / Opera / Brave)
    • Firefox
    • Safari
    • Talk Desktop
    • Integrations with Files sidebar and other apps
    • Not risky to browser differences / client
  • 🖌️ Design was reviewed, approved or inspired by the design team
  • ⛑️ Tests are included or not possible
  • 📗 User documentation in https://github.com/nextcloud/documentation/tree/master/user_manual/talk has been updated or is not required

Antreesy added 2 commits July 16, 2026 15:31
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- introduce new composable with search-related methods and refs
- improve promises handling (single toast for errors, GC for cancel functions)
- extendable to search-messages feature

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy added this to the ⛅ Next Major (35) milestone Jul 16, 2026
@Antreesy
Antreesy requested a review from DorraJaouad July 16, 2026 13:44
@Antreesy Antreesy self-assigned this Jul 16, 2026
Comment on lines +134 to +140
if (
cancelSearchListedConversations !== null
|| cancelSearchPossibleConversations !== null
) {
// New search request was triggered, do not proceed
return
}

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.

It means that the current search is more recent and hence the cancel of the previous search should be cancelled instead of skipping the current one

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.

Recent search triggers cancel for previous one. Here we catching the case "previous request cancelled, promises resolved, proceeding with this function" - but we should not proceed for previous one
Or comment itself is confusing?

Comment on lines +25 to +26
let cancelSearchListedConversations: ReturnType<typeof CancelableRequest>['cancel'] | null = null
let cancelSearchPossibleConversations: ReturnType<typeof CancelableRequest>['cancel'] | null = null

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.

This seems part of the composable state, do we want a shared state across all search instances that's why they are outside?

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.

We don't need more than one instance, but agreed that this might be the limitation, fixed if we put it inside

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants