Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(studio): sortable search results, search phrases, experimental config #3764

Merged
merged 10 commits into from
Oct 19, 2022

Conversation

robinpyon
Copy link
Contributor

@robinpyon robinpyon commented Oct 16, 2022

Description

This PR introduces the search improvements introduced in V2 here with a few notable differences:

  • Dark mode support
  • Search provider and context are now in separate files to workaround HMR issues in vite
  • Added experimental search config types (__experimental_search and __experimental_omnisearch_visibility) to the document schema definition (so they should appear when using defineType)
  • Added Workshop stories for <SearchPopover> and <SearchDialog>

Notable refactoring

  1. Functions to generate weighted search (also used by reference and cross dataset reference input components) have been moved into src/core/search (previously src/core/studio/components/navbar/search/search). This felt natural since generating weighted search is a cross-cutting concern and not necessarily tied to the navbar.
  2. Some internal shared preview functions used by both <PaneItemPreview> and <SearchResultItemPreview> have been moved into core/preview/utils.

Perhaps in future there's an opportunity to export a general purpose document list preview component that also takes care of fetching / creating preview values – which could be useful for plugins such as documents-pane or scheduled publishing.

Known issues

  • Text input fields in Omnisearch temporarily have borders. This is due to an issue where border=false on TextInput components aren't respected in the studio navbar. Currently investigating whether this is a bug or intentional. (fixed in "@sanity/ui": "1.0.0-beta.30")
  • Omnisearch works when changing between light / dark mode, but won't render the correct colours after changing the colour mode twice.
  • Virtualized lists don't appear to be as performant as in V2 (Try do a search for "a" in test studio and drag the scrollbar). There is notable 'pop-in' in V3 which wasn't present in V2, but it's still quite snappy and won't hang the main thread.

@robinpyon robinpyon added the v3 label Oct 16, 2022
@vercel
Copy link

vercel bot commented Oct 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Oct 19, 2022 at 0:09AM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
studio-workshop ⬜️ Ignored (Inspect) Oct 19, 2022 at 0:09AM (UTC)

Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

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

Feels a bit wierd to say "LGTM" on such a big PR, but I recognize a lot of the code and it is mostly moving files right?

Awesome job!

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