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: search product control implementations #2547

Open
wants to merge 18 commits into
base: feat/quick-order
Choose a base branch
from

Conversation

ramondorosario-ct
Copy link
Collaborator

What's the purpose of this pull request?

This PR is about the implementation of the Quick Order feature. Two other PRs were created, one related to the new SearchProductItemControl component and another handling all the typing.

In this PR, the new component, typing, and some logic related to the overall implementation of the feature are brought together. A small adjustment was also made to the useBuyButton hook to prevent the SliderOver from opening when an item is added to the cart.

Attention This PR has dependencies on PRs: #2543 and #2546.

ps: Once PR #2543 is merged, the number of changes in this PR will decrease.

Printscreens

image

image

ps: the "Select multiple" button is just a regular button used for visualization purposes. Once the SKUMatrix is passed, the SKUMatrix trigger will be displayed.

@ramondorosario-ct ramondorosario-ct added enhancement New feature or request depends on Depends on another PR - Please mention the PR labels Nov 6, 2024
@ramondorosario-ct ramondorosario-ct requested a review from a team as a code owner November 6, 2024 20:14
@ramondorosario-ct ramondorosario-ct requested review from lucasfp13 and lariciamota and removed request for a team November 6, 2024 20:14
Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 13, 2025 6:15pm

@ramondorosario-ct ramondorosario-ct changed the title feaT: search product control implementations feat: search product control implementations Nov 6, 2024
@ramondorosario-ct ramondorosario-ct self-assigned this Nov 6, 2024
@HiagoMoreiraCubos HiagoMoreiraCubos self-assigned this Nov 18, 2024
@ArthurTriis1
Copy link
Contributor

Achei um comportamento esquisito nos meus testes, estou usando esse preview para eles.

Quando faço uma pesquisa na home o nome dos produtos retornados na pesquisa não são os mesmos que temos na loja, exemplo:

Na Loja:
Screenshot 2025-01-07 at 12 03 45

No Preview:
Screenshot 2025-01-07 at 12 03 04

Além disso nas PDPs o QuantitySelector do Quick Order não está aparecendo, exemplo:

No Preview:
Screenshot 2025-01-07 at 12 03 29

@ramondorosario-ct
Copy link
Collaborator Author

ramondorosario-ct commented Jan 13, 2025

Achei um comportamento esquisito nos meus testes, estou usando esse preview para eles.

Quando faço uma pesquisa na home o nome dos produtos retornados na pesquisa não são os mesmos que temos na loja, exemplo:

Na Loja: Screenshot 2025-01-07 at 12 03 45

No Preview: Screenshot 2025-01-07 at 12 03 04

Além disso nas PDPs o QuantitySelector do Quick Order não está aparecendo, exemplo:

No Preview: Screenshot 2025-01-07 at 12 03 29

Fiz os ajustes, da um confere nesse preview: https://starter-jlb8rn4wd-vtex.vercel.app/

@ramondorosario-ct ramondorosario-ct changed the base branch from main to feat/quick-order January 21, 2025 19:40
@lucasfp13
Copy link
Contributor

@ramondorosario-ct testing the latest preview release you sent I noticed this NaN warning happening on mobile when I delete the default value (1) with an empty one before typing the new value. Probably the input validation is happening on every input change, maybe doing this on blur solve the issue.

Screen.Recording.2025-01-29.at.17.10.00.mov

isVariantOf: { name },
unitMultiplier,
Copy link
Contributor

Choose a reason for hiding this comment

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

There are unavailable attributes from this fragment, causing the Property does not exist on type 'ProductSummary_ProductFragment' error.

All the attributes being used here should be added in the ProductSummary_product fragment and generate the GraphQL typings again:

  1. Add the missing attributes to the ProductSummary_product fragment;
  2. Run yarn generate:codegen on the @faststore/core package

)}
</>
)
}, [quickOrder?.enabled])
Copy link
Contributor

Choose a reason for hiding this comment

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

Typescript will complain about the quickOrder variable not being used inside the useCallback scope. Maybe by creating a function outside of the SearchProductItemContent scope can solve this, because the conditions at lines 60 and 62 will already prevent the unexpected re-renderings.

}, [statusAddToCart])

const showSKUMatrixControl = availability && hasVariants
const isMobile = window.innerWidth <= 768
Copy link
Contributor

@lucasfp13 lucasfp13 Jan 31, 2025

Choose a reason for hiding this comment

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

Here we can use this value from useScreenResize hook instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends on Depends on another PR - Please mention the PR enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants