Skip to content

fix(search): drop the stray log and the sort that always gave NaN - #567

Open
Dx-Alz-xD wants to merge 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/search-cleanup
Open

Dx-Alz-xD wants to merge 1 commit into
CodeChefVIT:stagingfrom
Dx-Alz-xD:krish/search-cleanup

Conversation

@Dx-Alz-xD

Copy link
Copy Markdown

📌 Purpose

The home search bar logged the whole subject list to the console on every load. Both search bars also sorted results with (a.score ?? Infinity) - (b.score ?? Infinity), but Fuse was set up without includeScore, so every comparison was Infinity - Infinity = NaN.


Corresponding issue: closes #547


🖼️ Showcase

No visible change. Fuse already returns results best match first, so the order users see is the same.


🔧 Changes

  • Removed console.log(initialSubjects) from searchbar-child.tsx
  • Removed the NaN sort from searchbar-child.tsx and pinned-searchbar.tsx

➕ Additional Notes

  • I checked that Fuse's default order matches a real score sort for the same query

the search bar logged the whole subject list on every load, and both
search bars sorted results by score although fuse was set up without
includeScore, so every comparison was Infinity - Infinity. fuse already
returns the best matches first, so the sort goes

This branch has not been deployed

No deployments
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.

Search Bar NaN Sorting & Console Log Spam

1 participant