Skip to content

Avoid duplicate tab search requests - #1241

Open
slick-daddy wants to merge 1 commit into
stashapp:masterfrom
slick-daddy:opt-16
Open

Avoid duplicate tab search requests#1241
slick-daddy wants to merge 1 commit into
stashapp:masterfrom
slick-daddy:opt-16

Conversation

@slick-daddy

Copy link
Copy Markdown
Contributor

When searching from the global search page, SearchLayout previously executed the combined SearchAll query for every search route.

That caused redundant work on dedicated tabs:

  • /search/performers?q=... executed both SearchAll and SearchPerformers.
  • /search/scenes?q=... executed both SearchAll and SearchScenes.
  • SearchAll searches both performers and scenes, even when only one result type is being displayed.

Changes

  • Detect whether the current route is the exact /search All tab.
  • Run SearchAll only on the All tab.
  • Keep SearchPerformers responsible for performer-tab results and counts.
  • Keep SearchScenes responsible for scene-tab results and counts.
  • Pass dedicated-tab counts back to SearchLayout through typed React Router outlet context so navigation badges remain available.
  • Preserve the existing search term, pagination, performer filters, result rendering, and All-tab behavior.

Result

Opening the Performers or Scenes tab no longer triggers an unnecessary combined performer-and-scene search. No GraphQL schema, backend API, or database changes are required.

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.

1 participant