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(headless): add sample for smart snippet controller #920

Merged
merged 10 commits into from
Jun 23, 2021
Merged

Conversation

olamothe
Copy link
Member

  • Re-exporting things I had removed from global exports
  • some missing documentation

https://coveord.atlassian.net/browse/KIT-782

@github-actions
Copy link

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Bundle Size

File Compression Old (kb) New (kb) Change (%)
dist/browser/headless.js bundled 492.1 492.3 0
minified 204.1 204.3 0.1
gzipped 58.9 59 0.1
dist/browser/headless.esm.js bundled 477.1 477.3 0
minified 260.8 260.8 0
gzipped 65.2 65.2 0
dist/browser/case-assist/headless.js bundled 0.5 0.5 0
minified 0.3 0.3 0
gzipped 0.2 0.2 0
dist/browser/case-assist/headless.esm.js bundled 0.1 0.1 0
minified 0 0 0
gzipped 0.1 0.1 0
dist/browser/recommendation/headless.js bundled 342.5 342.5 0
minified 152.2 152.2 0
gzipped 44.5 44.5 0
dist/browser/recommendation/headless.esm.js bundled 333.7 333.7 0
minified 188.4 188.4 0
gzipped 48.8 48.8 0
dist/browser/product-recommendation/headless.js bundled 344.2 344.2 0
minified 153.2 153.2 0
gzipped 44.6 44.6 0
dist/browser/product-recommendation/headless.esm.js bundled 335.3 335.3 0
minified 189.8 189.8 0
gzipped 48.9 48.9 0

return (
<div style={{textAlign: 'left'}}>
People also ask:
<dl>
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting tag choices, first time I learn of them. Are dl, dd they recommended for this kind of UI? I'm not clear on what the difference between a description list and unordered is

Copy link
Member Author

@olamothe olamothe Jun 23, 2021

Choose a reason for hiding this comment

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

I thought it fits well for a quick sample demo.

OOTB, it indents the answer under each question.

The

HTML element represents a description list. The element encloses a list of groups of terms (specified using the
element) and descriptions (provided by
elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs).

} = this.state;

if (!answerFound) {
return <div>Sorry, no answer has been found for this query.</div>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just return null in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

For a sample purpose, I find it more meaningful to be more explicit about what that state mean.

That's a pattern we see in quite a lot of sample (eg: search status), that I find very useful.

I don't expect users to blindly copy paste that as is in their own app, but to get a general understanding of what it's about.

marginBottom: '10px',
maskImage: maskImage(),
WebkitMaskImage: maskImage(),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the mask image for?

Copy link
Member Author

Choose a reason for hiding this comment

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

Adds a "blur" effect at the bottom of the answer when it is collapsed, to give a better sense that "this can be expanded".

@olamothe olamothe merged commit a23b638 into master Jun 23, 2021
@olamothe olamothe deleted the KIT-782 branch June 23, 2021 15:12
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.

3 participants