This repository was archived by the owner on Sep 30, 2024. It is now read-only.
feat(svelte): Add search query syntax introduction#63753
Merged
Conversation
This adds the search query syntax introduction component to the search homepage. I tried to replicate the React version as closely as possible. I originally wanted to reuse the logic to generate the example sections but since it had depdencies on wildcard I duplicated it instead. Noteable additional changes: - Added a `value` method to the temporary settings store to make it easier to get the current value of the settings store. It only resolves (or rejects) once the data is loaded. - Extended the tabs component to not show the tab header if there is only a single panel. This makes it easier for consumers to render tabs conditionally. - Added the `ProductStatusBadge` compontent - Various style adjustments
camdencheek
approved these changes
Jul 10, 2024
| .tabs-header { | ||
| --icon-color: var(--header-icon-color); | ||
|
|
||
| width: 100%; |
Member
Contributor
Author
There was a problem hiding this comment.
I reverted the change and instead used :global([data-tab-header]) to set the width. I made some changes to the tabs component to avoid this in the future and clean up the CSS a bit.
vovakulikov
approved these changes
Jul 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes srch-494
This adds the search query syntax introduction component to the search homepage. I tried to replicate the React version as closely as possible.
I originally wanted to reuse the logic to generate the example sections but since it had dependencies on wildcard I duplicated it instead.
Notable additional changes:
valuemethod to the temporary settings store to make it easier to get the current value of the settings store. It only resolves (or rejects) once the data is loaded.ProductStatusBadgecomponentFor reference, the relevant parts of the React version are in https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/branded/src/search-ui/components/useQueryExamples.tsx and https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/branded/src/search-ui/components/QueryExamples.tsx
Comparison between React and Svelte:
Test plan
Manual testing. I manually set the value received from temporary settings to
null(in code) to force trigger the compute logic.