-
Notifications
You must be signed in to change notification settings - Fork 39
docs(atomic): Migrating atomic-did-you-mean doc to storybook
#6669
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
Open
eguyon-coveo
wants to merge
7
commits into
main
Choose a base branch
from
DOC-18114
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
145a23f
generated article
eguyon-coveo 2565911
Merge remote-tracking branch 'origin/main' into DOC-18114
eguyon-coveo 4e8b8e7
Refactoried file
eguyon-coveo 1266c02
typo
eguyon-coveo eaf7370
Merge branch 'main' into DOC-18114
eguyon-coveo 06b2a70
Merge remote-tracking branch 'origin/main' into DOC-18114
eguyon-coveo ce65374
PR fixes
eguyon-coveo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
packages/atomic/src/components/search/atomic-did-you-mean/atomic-did-you-mean.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import { Meta } from '@storybook/addon-docs/blocks'; | ||
| import * as AtomicDidYouMeanStories from './atomic-did-you-mean.new.stories'; | ||
| import { AtomicDocTemplate } from '../../../../storybook-utils/documentation/atomic-doc-template'; | ||
|
|
||
| <Meta of={AtomicDidYouMeanStories} /> | ||
|
|
||
| <AtomicDocTemplate | ||
| stories={AtomicDidYouMeanStories} | ||
| githubPath="search/atomic-did-you-mean/atomic-did-you-mean.ts" | ||
| tagName="atomic-did-you-mean" | ||
| className="AtomicDidYouMean" | ||
| > | ||
| This component is typically placed within the "status" section of the layout. | ||
|
|
||
| ```html | ||
| <atomic-search-interface> | ||
| ... | ||
| <atomic-search-layout> | ||
| ... | ||
| <atomic-layout-section section="main"> | ||
| ... | ||
| <atomic-layout-section section="status"> | ||
|
|
||
| <atomic-did-you-mean></atomic-did-you-mean> | ||
|
|
||
| </atomic-layout-section> | ||
| </atomic-layout-section> | ||
| </atomic-search-layout> | ||
| </atomic-search-interface> | ||
| ``` | ||
|
|
||
| Using the _Did You Mean_ component with your search page is a best practice, especially if your index has search terms that can be misinterpreted as an error. | ||
| The relevance of the corrections improves with the size of the index, as more terms become available for comparison. | ||
|
|
||
| It's possible to define certain phrases or terms in an organization’s thesaurus, which will expand or replace the query expression before executing the query. | ||
| However, the _Did You Mean_ component won’t process queries expanded by the thesaurus. | ||
|
|
||
|
|
||
| ### Common Use Cases | ||
| * When a query returns no results but finds a possible query correction, the component automatically triggers a new query with the suggested term. This prevents the user having to rewrite their query, which saves them time. | ||
| * When the current query returns results, but the index has more frequently occurring terms with similar spelling, the component presents a link containing the new terms. | ||
| When clicked, the link triggers a new query using the corrected keywords. | ||
| * A soft nudge asking users if that's what they meant can direct them to the most relevant results. | ||
|
|
||
| ## Reference | ||
|
|
||
| <a href="https://uxmag.com/articles/designing-search-staying-on-track" target="_blank">Designing Search: Staying on Track</a> | ||
| <br/> | ||
| <a href="https://www.google.com/search?q=guitr&oq=guitr&aqs=chrome..69i57j0i10i433l3j69i60j69i65j69i60l2.538j0j7&sourceid=chrome&ie=UTF-8" target="_blank">Searching "guitr" with Google</a> | ||
|
|
||
| </AtomicDocTemplate> | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.