Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

search: activate smart search by default#44395

Merged
rvantonder merged 1 commit into
mainfrom
rvt/smart-search-default-xyz
Nov 16, 2022
Merged

search: activate smart search by default#44395
rvantonder merged 1 commit into
mainfrom
rvt/smart-search-default-xyz

Conversation

@rvantonder

@rvantonder rvantonder commented Nov 15, 2022

Copy link
Copy Markdown
Contributor

This activates the smart search feature by default (the toggle always shows up). It also adds a setting where the default toggle state can be set by search.defaultMode.

See inline comments for more details.

After this PR I will update changelog and continue testing/refining things.

Extra notes, about VSCode extension:

After some manual testing, I think it makes sense to keep the smart search toggle in VScode, which is what this PR does. Because:

  1. It works as expected and consistent with web app behavior (this because the streaming search endpoint sees the smart search value)

  2. It is really ugly and messy to try and introduce a setting/bool to not display certain toggle buttons when in VSCode mode and not worth the tradeoff IMO. We would effectively have a need for divergent UIs. If we really want to disable smart search for VSCode we should first do the work that completely separates it, and it's UI (Toggles, SearchBox) from the web app. That does not seem like the desired approach, we want to keep webapp and VSCode components consistent.

  3. There are two cons to the tradeoff. The main one is that the VSCode extension doesn't display the alerts/info box (it doesn't appear to display any server side alerts). I think this is a gap in the extension that we should address swiftly. I wasn't aware of it being absent before, so this is already a divergence that really seems like something we should support in VSCode. Second, there isn't a direct URL that corresponds to the web app (at least, I'm not sure there is a web URL can copy from the VSCode environment). But at least, now if a user had smart search toggled in VSCode, and sees results, they can get the same behavior in the webapp as well. That can also be mitigated with a "open in browser" if that doesn't exist already.

Test plan

Existing tests + manual testing

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot Bot added the cla-signed label Nov 15, 2022
@rvantonder rvantonder force-pushed the rvt/smart-search-default-xyz branch 3 times, most recently from 55d0d2a to 11c1096 Compare November 15, 2022 07:05
@rvantonder rvantonder marked this pull request as ready for review November 15, 2022 07:06
@sourcegraph-bot

sourcegraph-bot commented Nov 15, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 923a15a...562ddb1.

Notify File(s)
@fkling client/search-ui/src/input/toggles/SmartSearchToggle.tsx
client/search-ui/src/input/toggles/Toggles.tsx
client/web/src/search/home/SearchPageInput.tsx
client/web/src/search/results/StreamingSearchResults.test.tsx
client/web/src/search/results/StreamingSearchResults.tsx
@limitedmage client/search-ui/src/input/toggles/SmartSearchToggle.tsx
client/search-ui/src/input/toggles/Toggles.tsx
client/web/src/integration/search.test.ts
client/web/src/search/home/SearchPageInput.tsx
client/web/src/search/results/StreamingSearchResults.test.tsx
client/web/src/search/results/StreamingSearchResults.tsx

@rvantonder rvantonder force-pushed the rvt/smart-search-default-xyz branch 2 times, most recently from 3a208df to f1c3143 Compare November 15, 2022 07:14
@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Nov 15, 2022

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (+0.03 kb) 0.00% (+0.28 kb) 0.00% (+0.25 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 562ddb1 and ab43aac or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

Comment on lines 80 to 92

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't decide anything based on defaultPatternType any longer.

Comment on lines 194 to 199

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

smart toggle is always shown. its default state can be set by search.defaultMode.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On app load default mode is SmartSearch (can be overridden by search.defaultMode setting).

@rvantonder rvantonder requested review from a team, limitedmage and novoselrok November 15, 2022 07:27

@novoselrok novoselrok left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Tried it out locally, default mode flag works.

@rvantonder rvantonder force-pushed the rvt/smart-search-default-xyz branch 4 times, most recently from f1a5a40 to 6857c6b Compare November 15, 2022 19:35
Base automatically changed from rvt/smart-search-default to main November 15, 2022 19:49
@rvantonder rvantonder force-pushed the rvt/smart-search-default-xyz branch from 6857c6b to 6eacae1 Compare November 15, 2022 19:50
@rvantonder rvantonder enabled auto-merge (squash) November 15, 2022 19:50

@limitedmage limitedmage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@rvantonder rvantonder force-pushed the rvt/smart-search-default-xyz branch 2 times, most recently from 636d04a to 0da9af8 Compare November 16, 2022 19:33
@rvantonder rvantonder force-pushed the rvt/smart-search-default-xyz branch from 0da9af8 to 562ddb1 Compare November 16, 2022 19:52
@rvantonder rvantonder merged commit 3bc1d5c into main Nov 16, 2022
@rvantonder rvantonder deleted the rvt/smart-search-default-xyz branch November 16, 2022 20:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants