Skip to content

Conversation

SuaYoo
Copy link
Member

@SuaYoo SuaYoo commented Oct 7, 2025

Precedes #2862

Changes

In preparation for #2862, the client-side search index for org-wide collection names has been moved to a new searchOrgContext. The context currently only supports fuzzy searching by collection name.

Also addresses feedback in #2871

Manual testing

Log in as a crawler and regression test the following:

  1. Dashboard > Create New -> Upload -> Add to Collection search
  2. Crawling > New Workflow > Collections > Auto-Add to Collection search
  3. Crawling > Workflow > Edit Workflow Settings > Collections > Auto-Add to Collection search
  4. Archived Items > Upload WACZ > Add to Collection search
  5. Collections > Search by name

Follow-ups

Left this implementation generic so that it's fairly simple to incorporate or migrate to https://github.com/webrecorder/browsertrix/tree/frontend-data-fetching-exploration in the future.

@SuaYoo SuaYoo requested review from emma-sg and ikreymer October 7, 2025 19:03
@SuaYoo SuaYoo force-pushed the frontend-org-search-context branch from 24390ad to 4ebc5eb Compare October 7, 2025 21:11
Copy link
Member

@emma-sg emma-sg left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall! I think this is a nice step towards easier access to search across the app — and if/when we have some sort of backend search service/tool/whatever it'll likely be easy to drop in fetches to that instead of Fuse. Got a few questions about some things, but nothing that necessarily should prevent a merge. Nice work!

}

const results = this.searchOrg.collections
?.search(this.searchByValue)
Copy link
Member

Choose a reason for hiding this comment

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

Small thing, but we might want to put a limit on the results returned from fuse for perf reasons. Conservatively, we could probably do 5 + the number of items that have been selected?

Suggested change
?.search(this.searchByValue)
?.search(this.searchByValue, {
limit: 5 + this.nameSearchMap.keys.length,
})

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call on limit, addressed the selected items by enabling extended search patterns: 077bb97

Copy link
Member

@emma-sg emma-sg Oct 8, 2025

Choose a reason for hiding this comment

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

This is a clever approach, but there are some edge cases that break it. For example, if a collection's name starts with " then it will be the only search result that ever shows up if it's selected as an auto-add collection for a workflow:

Screen.Recording.2025-10-08.at.6.34.19.PM.mov

I don't know for sure how often this'll come up, but it doesn't seem entirely unfeasible.

Copy link
Member Author

@SuaYoo SuaYoo Oct 8, 2025

Choose a reason for hiding this comment

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

Hmm yeah I can't think of a user realistically having a collection named " <something> since it's the space after the double quote that breaks search, not just starting with double quotes. Quotes in the middle of the name break as well. Looking to see if there's a quick fix.

@SuaYoo SuaYoo requested a review from emma-sg October 8, 2025 17:06
Copy link
Member

@emma-sg emma-sg left a comment

Choose a reason for hiding this comment

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

It looks like this has an edge case that breaks the search, see my comment here: #2880 (comment)

@SuaYoo SuaYoo requested a review from emma-sg October 9, 2025 00:38
@emma-sg
Copy link
Member

emma-sg commented Oct 9, 2025

Nice, looking good!

@SuaYoo SuaYoo merged commit eb2d359 into main Oct 9, 2025
29 checks passed
@SuaYoo SuaYoo deleted the frontend-org-search-context branch October 9, 2025 17:49
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.

2 participants