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(search): more search improvements #18705

Merged
merged 25 commits into from
Nov 20, 2023
Merged

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Nov 17, 2023

Problem

The search had some problems... see below.

Changes

This PR:

  • allows filtering search results by entity type (i.e. insight, dashboard, ...), so that when you click on a tab only results for that tab will be loaded. this is necessary as the limit in the query applies to all results and there might not be any or just very few results for a given tab otherwise.
  • allows selecting extra_fields by entity. this is necessary to show alternative name fields like derived_name for insights.
  • allows searching a weighted set of search_fields. this is necessary to search alternative names like title for notebooks or key for feature flags. this means we can also search descriptions with a lesser weight.
  • adds a basic preview to search results

How did you test this code?

Added tests & clicked around

Copy link
Contributor

github-actions bot commented Nov 17, 2023

Size Change: -14.9 kB (-1%)

Total Size: 1.99 MB

Filename Size Change
frontend/dist/toolbar.js 1.99 MB -14.9 kB (-1%)

compressed-size-action

@thmsobrmlr thmsobrmlr marked this pull request as ready for review November 20, 2023 11:23
@thmsobrmlr thmsobrmlr requested a review from a team November 20, 2023 11:23
@PostHog PostHog deleted a comment from posthog-bot Nov 20, 2023
@Twixes Twixes force-pushed the search-improvements-2 branch from 4b64e1c to f1d60f2 Compare November 20, 2023 15:49
@Twixes Twixes force-pushed the search-improvements-2 branch from f1d60f2 to 8d3666a Compare November 20, 2023 16:16
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Love search now, the results seem pretty good.
As you may notice, I pushed a small change to make skeleton sizing joy-sparking. One visual bug I noticed: in one spot we're using bg-bg-3000-light, which seems pretty wrong, because that's the light mode version being hard-coded. Should be bg-bg-3000. Just pushed a fix.
The whole command bar is also in a dire need of hover/focus states, it's pretty hard to use otherwise. So I'm gonna give the green check now, but we that's one improvement we've got to make before rolling this out.

@@ -12,7 +12,7 @@ const globals = {
}

module.exports = {
ignorePatterns: ['node_modules', 'plugin-server'],
ignorePatterns: ['node_modules', 'plugin-server', 'cypress'],
Copy link
Member

Choose a reason for hiding this comment

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

Had to add this as ESLint was complaining about issues due to our Cypress code not being properly typed

@@ -39,7 +39,9 @@ export function CommandBar(): JSX.Element | null {
return (
<CommandBarOverlay>
<div
className="w-full h-160 max-w-lg bg-bg-3000 rounded overflow-hidden flex flex-col border shadow"
className={`w-full ${
Copy link
Member

Choose a reason for hiding this comment

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

shadow amounts to a border-bottom in 3000 mode, which makes sense for buttons, but does not look great here IMO. Are we getting rid of the modal shadow in 3000 completely @corywatilo?

@thmsobrmlr thmsobrmlr enabled auto-merge (squash) November 20, 2023 17:03
@Twixes Twixes force-pushed the search-improvements-2 branch from 59969fd to b12c93f Compare November 20, 2023 17:10
@PostHog PostHog deleted a comment from posthog-bot Nov 20, 2023
@PostHog PostHog deleted a comment from posthog-bot Nov 20, 2023
@thmsobrmlr thmsobrmlr merged commit 2a3945b into master Nov 20, 2023
74 checks passed
@thmsobrmlr thmsobrmlr deleted the search-improvements-2 branch November 20, 2023 17:43
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