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

feat(search): remove keyword toggle#63584

Merged
jtibshirani merged 7 commits into
mainfrom
jtibs/keyword-toggle
Jul 3, 2024
Merged

feat(search): remove keyword toggle#63584
jtibshirani merged 7 commits into
mainfrom
jtibs/keyword-toggle

Conversation

@jtibshirani

@jtibshirani jtibshirani commented Jul 1, 2024

Copy link
Copy Markdown
Contributor

This PR removes the keyword search toggle as part of making the feature GA. It
removes the keyword search toggle and popover, but keeps the "call to action"
on the search landing page,

Main changes:

  • Remove toggle on search results page
  • Stop checking experimentalFeatures.keywordSearch. (Instead, users should
    set search.defaultPatternType: standard)
  • Remove LegacyToggles and all references. This duplicated Toggles and is
    no longer needed since we unified the implementations.

Closes SPLF-111

Test plan

Added new unit test on patterntype + smart search interactions. Manually tested, including

  • Manually adding patterntype=standard to URL, to check we surface it explicitly
  • Toggling regexp and case sensitivity on/ off
  • Testing both search.defaultPatternType to regexp and standard

Changelog

The keyword search toggle has been removed from the search results page. Keyword search is now enabled by default for all searches in the Sourcegraph web app.

@cla-bot cla-bot Bot added the cla-signed label Jul 1, 2024
@github-actions github-actions Bot added team/product-platform team/search-platform Issues owned by the search platform team labels Jul 1, 2024
@jtibshirani jtibshirani force-pushed the jtibs/keyword-toggle branch from 740abb6 to d5fdbf4 Compare July 1, 2024 23:31
@jtibshirani

Copy link
Copy Markdown
Contributor Author

Note: although I removed the toggle and popover, I kept the Send Feedback link because we've found it interesting to see the queries that users include in feedback. Let me know what you think! Not sure about the styling here :)

Screenshot 2024-07-01 at 4 30 35 PM

@jtibshirani jtibshirani force-pushed the jtibs/keyword-toggle branch from d5fdbf4 to 49d6ed1 Compare July 2, 2024 00:33
@jtibshirani jtibshirani marked this pull request as ready for review July 2, 2024 00:35
@jtibshirani jtibshirani requested a review from a team July 2, 2024 00:35
@jtibshirani jtibshirani force-pushed the jtibs/keyword-toggle branch from 49d6ed1 to 209b0dd Compare July 2, 2024 00:47
Comment thread .vscode/settings.json
*/
export function defaultSearchModeFromSettings(settingsCascade: SettingsCascadeOrError): SearchMode | undefined {
// When the 'keyword search' language update is enabled, make sure to disable smart search
if (isKeywordSearchEnabled(settingsCascade)) {

@jtibshirani jtibshirani Jul 2, 2024

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.

Before, we were force overriding the default search mode when keyword search was enabled. This doesn't seem correct, so I simplified and removed this. This required updating the default to SearchMode.Precise in some other places.

Soon it won't even be relevant, since we plan to remove smart search completely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we planning to remove smart sort before the upcoming release? If not, I would feel better if we disabled smart search if keyword search is active.

@jtibshirani jtibshirani Jul 2, 2024

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.

@stefanhengl and I discussed this offline. He highlighted an important risk: maybe we told a customer to enable search.defaultSearchMode: smart many releases ago, now they upgrade, and all searches start to fail.

Instead, we will continue to ignore this setting when keyword search is enabled (always using precise), and explicitly deprecate it.

Comment thread internal/search/job/jobutil/job.go
@jtibshirani jtibshirani requested a review from a team July 2, 2024 00:53
@stefanhengl

Copy link
Copy Markdown
Member

Note: although I removed the toggle and popover, I kept the Send Feedback link because we've found it interesting to see the queries that users include in feedback. Let me know what you think! Not sure about the styling here :)

Screenshot 2024-07-01 at 4 30 35 PM

Not sure about this. IMO it is not obvious anymore what "Send feedback" should relate to. We already have the issue that most feedback sent from this link is empty (apart from the query) and we are not sure if users click on send accidentally. There is already a way to send feedback in the user menu. Would that be enough?

Comment thread schema/settings.schema.json Outdated
@jtibshirani

Copy link
Copy Markdown
Contributor Author

Not sure about this. IMO it is not obvious anymore what "Send feedback" should relate to.

Good point, I hadn't realized the existing feedback was so noisy. I will remove this. We can revisit this in the future, through a better design that encourages users to give more context.

@jtibshirani jtibshirani requested a review from stefanhengl July 2, 2024 17:12
@jtibshirani jtibshirani merged commit 6c6448a into main Jul 3, 2024
@jtibshirani jtibshirani deleted the jtibs/keyword-toggle branch July 3, 2024 17:53
@jtibshirani jtibshirani changed the title Search: remove keyword toggle feat(search): remove keyword toggle Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/search-platform Issues owned by the search platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants