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

docs(two-column-layout-example): add products plugin #909

Conversation

FabienMotte
Copy link
Contributor

@FabienMotte FabienMotte commented Mar 2, 2022

This PR adds the products plugin to the Autocomplete two columns layout example.

Main PR: #908

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 2, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9384542:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
algolia/autocomplete Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration

@FabienMotte FabienMotte force-pushed the docs/two-columns-layout-example-2 branch from 6b57c2e to d988a02 Compare March 3, 2022 10:50
@FabienMotte FabienMotte marked this pull request as ready for review March 3, 2022 11:57
@FabienMotte FabienMotte requested review from a team, dhayab and sarahdayan and removed request for a team March 3, 2022 11:57
Copy link
Member

@sarahdayan sarahdayan left a comment

Choose a reason for hiding this comment

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

I've noticed a few things in the UI:

  • The title "Products" is very discreet. Why not use the header template from the theme?
  • When there are less than 3 products, they fill the space, meaning they grow in height too. Couldn't we instead keep them at the same size?
  • When images are loading, the space isn't "reserved" so there's layout shift. Also, with the blurhash we likely have three possible states: empty image, blurred image and crisp image instead of going from not loaded to loaded. Do we think it's good UX?
  • When resizing the browser (large to narrow) there's a moment when the panel has a weird width (while resizing). It's particularly visible on Firefox. Is this caused by the custom CSS, or was it already there?

examples/two-columns-layout/src/app.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/components/Blurhash.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/components/Blurhash.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/components/Blurhash.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/components/Icons.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-columns-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
@sarahdayan
Copy link
Member

sarahdayan commented Mar 8, 2022

Another UI comment: I'm not a big fan of the color and styles for the star rating system, I find the blue a bit too "system" and it overpowers the rest.

Here's a suggestion, wdyt? These are the colors we use for the star rating system on the docs' solutions. I also reduced the descriptive text and used a more muted color.

Capture d’écran 2022-03-08 à 11 05 17

@FabienMotte FabienMotte changed the title docs(two-columns-layout-example): add products plugin docs(two-column-layout-example): add products plugin Mar 8, 2022
@FabienMotte FabienMotte force-pushed the docs/two-columns-layout-example-2 branch from d988a02 to b3e72b0 Compare March 8, 2022 19:15
@FabienMotte
Copy link
Contributor Author

Thanks for your comments! 🙏

I've noticed a few things in the UI:

  • The title "Products" is very discreet. Why not use the header template from the theme?

It should be better like this. I removed the line at the end because the title is using a white background, conflicting with the background color on all products added by the smart preview feature.
I'll see how to handle this specific case in the relevant PR.

image

  • When there are less than 3 products, they fill the space, meaning they grow in height too. Couldn't we instead keep them at the same size?

Indeed, thanks!

image

  • When images are loading, the space isn't "reserved" so there's layout shift. Also, with the blurhash we likely have three possible states: empty image, blurred image and crisp image instead of going from not loaded to loaded. Do we think it's good UX?

When the image wasn't loaded, the body part was taking all the available height, hiding the Blurhash canvas. Now it should work properly. The blur placeholder is not an image, so it should be visible as the same time as the results.
I added a timeout + network throttling to see the states in the below video.

Screen.Recording.2022-03-08.at.18.43.11.mov
  • When resizing the browser (large to narrow) there's a moment when the panel has a weird width (while resizing). It's particularly visible on Firefox. Is this caused by the custom CSS, or was it already there?

I think it is due to media queries that update the max-width of the container, I removed them, can you try again?

@FabienMotte
Copy link
Contributor Author

Another UI comment: I'm not a big fan of the color and styles for the star rating system, I find the blue a bit too "system" and it overpowers the rest.

Here's a suggestion, wdyt? These are the colors we use for the star rating system on the docs' solutions. I also reduced the descriptive text and used a more muted color.

Capture d’écran 2022-03-08 à 11 05 17

It's looking much better, thank you (and using one less SVG)!

image

@sarahdayan
Copy link
Member

Regarding the blurash placeholder, it will only show once Algolia has responded (not visible in your video). Until then we don't have the hash so we need to display something.

examples/two-column-layout/src/components/Icons.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/style.css Outdated Show resolved Hide resolved
examples/two-column-layout/style.css Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
examples/two-column-layout/src/plugins/productsPlugin.tsx Outdated Show resolved Hide resolved
@FabienMotte
Copy link
Contributor Author

FabienMotte commented Mar 9, 2022

Regarding the blurash placeholder, it will only show once Algolia has responded (not visible in your video). Until then we don't have the hash so we need to display something.

Is it possible that the state you mentioned is displayed at some point?
Items should not be visible until we get the results from Algolia, right?

I added a background color to the blurred div with an opacity animation so even if the hash is undefined, we have a displayed loading state.

@FabienMotte FabienMotte force-pushed the docs/two-columns-layout-example-2 branch from 47c2540 to f26f445 Compare March 9, 2022 17:36
@seafoox
Copy link
Member

seafoox commented Mar 10, 2022

  • Can we add a "See all products (x)" as done in the "[Desktop] Multi category results" view in the Ecom UI Design Kit?

  • Same for the "See all" displayed next to the articles

  • Could we add some debouncing so it reduces this flickering effect, while keeping it on the left items composed of the QuerySuggestions. So this way the end users can better focus on the left part, before focusing on the right part later on.

  • Could we work on adding the highlighting on the product hits?

@FabienMotte FabienMotte force-pushed the docs/two-columns-layout-example-2 branch from f26f445 to f2306a9 Compare March 28, 2022 16:32
…ns (#910)

* chore(two-columns-layout-example): add categories plugin

* chore(two-columns-layout-example): add brands plugin

* chore(two-columns-layout-example): add faq plugin

* apply suggestions from code review

* remove debug option

* docs(two-column-layout-example): add articles and popular plugins (#911)

* chore(two-columns-layout-example): add articles plugin

* chore(two-columns-layout-example): add popular plugin

* apply suggestions from code review

* docs(two-column-layout-example): add reshape functions and quick access plugin (#912)

* chore(two-columns-layout-example): add reshape functions

* docs(two-columns-layout-example): add quick access plugin

* chore: move reshape functions at file top-level

* apply suggestions from code review

* docs(two-column-layout-example): add smart preview feature (#913)

* docs(two-columns-layout-example): add smart preview feature

* docs(two-columns-layout-example): add faq article preview

* apply suggestions from code review

* docs(two-column-layout-example): add no results state and popular categories plugin (#914)

* docs(two-columns-layout-example): add no results state and popular categories plugin

* chore: fix empty div with Fragment

* chore: fix empty div when no recent searches exist

* chore: fix casing

* apply suggestions from code review

* apply suggestions from pair session

* fix empty recent searches

* fix linting

* apply suggestion from code review

* smart preview no longer depends on the DOM

* apply suggestions from feedback

* apply suggestions from feedback

* apply suggestion from code review

* apply suggestion from feedback
@FabienMotte FabienMotte merged commit 3688dcb into docs/two-columns-layout-example-1 Mar 28, 2022
@FabienMotte FabienMotte deleted the docs/two-columns-layout-example-2 branch March 28, 2022 16:42
FabienMotte added a commit that referenced this pull request Mar 29, 2022
* docs(examples): scaffold two columns layout example

* fix consistent naming

* chore: fix linting

* chore: fix styles

* chore: fix deps

* chore: add missing dep for Codesandbox

* apply suggestions from code review

* remove useless media queries

* apply suggestions from code review

* docs(two-column-layout-example): add products plugin (#909)

* docs(two-columns-layout-example): add products plugin

* apply suggestions from review

* remove useless type

* use classic header for recent searches and fix padding

* apply suggestions from code review

* docs(two-column-layout-example): add categories, brands and faq plugins (#910)

* chore(two-columns-layout-example): add categories plugin

* chore(two-columns-layout-example): add brands plugin

* chore(two-columns-layout-example): add faq plugin

* apply suggestions from code review

* remove debug option

* docs(two-column-layout-example): add articles and popular plugins (#911)

* chore(two-columns-layout-example): add articles plugin

* chore(two-columns-layout-example): add popular plugin

* apply suggestions from code review

* docs(two-column-layout-example): add reshape functions and quick access plugin (#912)

* chore(two-columns-layout-example): add reshape functions

* docs(two-columns-layout-example): add quick access plugin

* chore: move reshape functions at file top-level

* apply suggestions from code review

* docs(two-column-layout-example): add smart preview feature (#913)

* docs(two-columns-layout-example): add smart preview feature

* docs(two-columns-layout-example): add faq article preview

* apply suggestions from code review

* docs(two-column-layout-example): add no results state and popular categories plugin (#914)

* docs(two-columns-layout-example): add no results state and popular categories plugin

* chore: fix empty div with Fragment

* chore: fix empty div when no recent searches exist

* chore: fix casing

* apply suggestions from code review

* apply suggestions from pair session

* fix empty recent searches

* fix linting

* apply suggestion from code review

* smart preview no longer depends on the DOM

* apply suggestions from feedback

* apply suggestions from feedback

* apply suggestion from code review

* apply suggestion from feedback

* remove smart preview for now

* add quick access selected transition

* fix see all link margin

* add getItemInputValue for faq

* apply feedback

* apply feedback

* apply feedback

* apply last fixes
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