Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Conversation

@Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Dec 30, 2022

This PR updates the styles of the FormTokenField component to fix some regressions caused by @wordpress/components update. cc @kmanijak

Screenshots

Before After
imatge imatge

Testing

User Facing Testing

  1. Create a post or page with three filter blocks: Filter by Attribute, Filter by Stock and Filter by Rating. In all of them set the display mode to Dropdown, and in some of them set it to Single and in ohter to Multiple.
  2. In the frontend, verify there are no visual regressions, the inputs have the same size and the user can add and remove values without problems.
  • Do not include in the Testing Notes

WooCommerce Visibility

  • WooCommerce Core
  • Feature plugin
  • Experimental

@Aljullu Aljullu added focus: components Work that introduces new or updates existing components. skip-changelog PRs that you don't want to appear in the changelog. block-type: filter blocks Issues related to all of the filter blocks. labels Dec 30, 2022
@Aljullu Aljullu self-assigned this Dec 30, 2022
@woocommercebot woocommercebot requested review from a team and sunyatasattva and removed request for a team December 30, 2022 10:42
@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2022

The release ZIP for this PR is accessible via:

https://wcblocks.wpcomstaging.com/wp-content/uploads/woocommerce-gutenberg-products-block-8051.zip

Script Dependencies Report

The compare-assets action has detected some changed script dependencies between this branch and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Removed
all-products.js wp-deprecated, wp-dom, wp-warning 🎉
attribute-filter.js wp-a11y, wp-deprecated, wp-dom, wp-keycodes, wp-warning 🎉
stock-filter.js wp-deprecated, wp-dom, wp-keycodes, wp-warning 🎉
rating-filter.js wp-compose, wp-deprecated, wp-dom, wp-keycodes, wp-warning 🎉
cart.js wp-warning 🎉
checkout.js wp-warning 🎉
mini-cart-contents.js wp-components wp-compose, wp-deprecated, wp-warning
single-product.js wp-deprecated, wp-dom, wp-warning 🎉

This comment was automatically generated by the ./github/compare-assets action.

TypeScript Errors Report

  • Files with errors: 409
  • Total errors: 2010

⚠️ ⚠️ This PR introduces new TS errors on 16 files:

Details assets/js/base/components/button/index.tsx

assets/js/base/components/cart-checkout/address-form/test/index.js

assets/js/base/context/event-emit/test/emitters.js

assets/js/blocks-registry/block-components/test/index.js

assets/js/blocks-registry/payment-methods/test/payment-method-config-helper.ts

assets/js/blocks-registry/payment-methods/test/registry.ts

assets/js/blocks/attribute-filter/test/block.tsx

assets/js/blocks/cart/test/block.js

assets/js/blocks/cart/test/slots.js

assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/test/block.js

assets/js/blocks/checkout/inner-blocks/checkout-terms-block/test/edit.js

assets/js/blocks/checkout/inner-blocks/checkout-terms-block/test/frontend.js

assets/js/blocks/mini-cart/test/block.js

assets/js/blocks/rating-filter/test/block.tsx

assets/js/blocks/stock-filter/test/block.tsx

packages/checkout/components/text-input/test/validated-text-input.tsx

comments-aggregator

@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2022

Size Change: +2 B (0%)

Total Size: 836 kB

Filename Size Change
build/wc-blocks-style-rtl.css 24.5 kB +1 B (0%)
build/wc-blocks-style.css 24.4 kB +1 B (0%)
ℹ️ View Unchanged
Filename Size
build/active-filters-frontend.js 7.74 kB
build/active-filters-wrapper--attribute-filter-wrapper--price-filter-wrapper--rating-filter-wrapper--stoc--78b62dd5-frontend.js 1.71 kB
build/active-filters-wrapper-frontend.js 4.73 kB
build/active-filters.js 7.34 kB
build/all-products-frontend.js 11.2 kB
build/all-products.js 33.4 kB
build/all-reviews.js 7.65 kB
build/attribute-filter-frontend.js 10 kB
build/attribute-filter-wrapper-frontend.js 7.02 kB
build/attribute-filter.js 12.3 kB
build/blocks-checkout.js 20.6 kB
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.37 kB
build/cart-blocks/cart-cross-sells-frontend.js 253 B
build/cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js 6.18 kB
build/cart-blocks/cart-cross-sells-products-frontend.js 4.81 kB
build/cart-blocks/cart-express-payment--checkout-blocks/express-payment-frontend.js 5.08 kB
build/cart-blocks/cart-express-payment-frontend.js 720 B
build/cart-blocks/cart-items-frontend.js 299 B
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.29 kB
build/cart-blocks/cart-line-items-frontend.js 1.06 kB
build/cart-blocks/cart-order-summary-frontend.js 1.25 kB
build/cart-blocks/cart-totals-frontend.js 321 B
build/cart-blocks/empty-cart-frontend.js 343 B
build/cart-blocks/filled-cart-frontend.js 782 B
build/cart-blocks/order-summary-coupon-form-frontend.js 1.78 kB
build/cart-blocks/order-summary-discount-frontend.js 2.12 kB
build/cart-blocks/order-summary-fee-frontend.js 273 B
build/cart-blocks/order-summary-heading-frontend.js 454 B
build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js 5.81 kB
build/cart-blocks/order-summary-shipping-frontend.js 428 B
build/cart-blocks/order-summary-subtotal-frontend.js 273 B
build/cart-blocks/order-summary-taxes-frontend.js 435 B
build/cart-blocks/proceed-to-checkout-frontend.js 1.24 kB
build/cart-frontend.js 28 kB
build/cart.js 46.9 kB
build/checkout-blocks/actions-frontend.js 1.86 kB
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 3.87 kB
build/checkout-blocks/billing-address-frontend.js 1.12 kB
build/checkout-blocks/contact-information-frontend.js 2 kB
build/checkout-blocks/express-payment-frontend.js 1.13 kB
build/checkout-blocks/fields-frontend.js 343 B
build/checkout-blocks/order-note-frontend.js 1.13 kB
build/checkout-blocks/order-summary-cart-items-frontend.js 3.66 kB
build/checkout-blocks/order-summary-coupon-form-frontend.js 1.94 kB
build/checkout-blocks/order-summary-discount-frontend.js 2.29 kB
build/checkout-blocks/order-summary-fee-frontend.js 275 B
build/checkout-blocks/order-summary-frontend.js 1.25 kB
build/checkout-blocks/order-summary-shipping-frontend.js 603 B
build/checkout-blocks/order-summary-subtotal-frontend.js 273 B
build/checkout-blocks/order-summary-taxes-frontend.js 436 B
build/checkout-blocks/payment-frontend.js 7.55 kB
build/checkout-blocks/shipping-address-frontend.js 1.11 kB
build/checkout-blocks/shipping-methods-frontend.js 4.92 kB
build/checkout-blocks/terms-frontend.js 1.56 kB
build/checkout-blocks/totals-frontend.js 325 B
build/checkout-frontend.js 29.3 kB
build/checkout.js 40.9 kB
build/customer-account.js 3.08 kB
build/featured-category.js 13 kB
build/featured-product.js 13.3 kB
build/filter-wrapper-frontend.js 13.7 kB
build/filter-wrapper.js 2.39 kB
build/general-style-rtl.css 988 B
build/general-style.css 988 B
build/handpicked-products.js 7.17 kB
build/legacy-template.js 2.84 kB
build/mini-cart-component-frontend.js 19.9 kB
build/mini-cart-contents-block/empty-cart-frontend.js 366 B
build/mini-cart-contents-block/filled-cart-frontend.js 387 B
build/mini-cart-contents-block/footer-frontend.js 2.82 kB
build/mini-cart-contents-block/items-frontend.js 237 B
build/mini-cart-contents-block/products-table-frontend.js 591 B
build/mini-cart-contents-block/shopping-button-frontend.js 312 B
build/mini-cart-contents-block/title-frontend.js 368 B
build/mini-cart-contents.js 16.7 kB
build/mini-cart-frontend.js 1.88 kB
build/mini-cart.js 4.26 kB
build/price-filter-frontend.js 13.6 kB
build/price-filter-wrapper-frontend.js 5.71 kB
build/price-filter.js 8.4 kB
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js 227 B
build/product-add-to-cart--product-button--product-image--product-rating--product-title.js 151 B
build/product-add-to-cart-frontend.js 1.6 kB
build/product-add-to-cart.js 8.47 kB
build/product-best-sellers.js 7.5 kB
build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js 441 B
build/product-button--product-image--product-rating--product-sale-badge--product-title.js 302 B
build/product-button-frontend.js 2.15 kB
build/product-button.js 3.84 kB
build/product-categories.js 2.37 kB
build/product-category-list-frontend.js 1.14 kB
build/product-category-list.js 503 B
build/product-category.js 8.49 kB
build/product-image-frontend.js 2.16 kB
build/product-image.js 3.93 kB
build/product-new.js 7.5 kB
build/product-on-sale.js 7.82 kB
build/product-price-frontend.js 2.17 kB
build/product-price.js 1.54 kB
build/product-query.js 5.94 kB
build/product-rating-frontend.js 1.59 kB
build/product-rating.js 918 B
build/product-sale-badge-frontend.js 1.39 kB
build/product-sale-badge.js 811 B
build/product-search.js 2.62 kB
build/product-sku-frontend.js 629 B
build/product-sku.js 377 B
build/product-stock-indicator-frontend.js 1.27 kB
build/product-stock-indicator.js 644 B
build/product-summary-frontend.js 1.53 kB
build/product-summary.js 920 B
build/product-tag-list-frontend.js 1.13 kB
build/product-tag-list.js 498 B
build/product-tag.js 8 kB
build/product-title-frontend.js 1.58 kB
build/product-title.js 3.32 kB
build/product-top-rated.js 7.74 kB
build/products-by-attribute.js 8.41 kB
build/rating-filter-frontend.js 8.6 kB
build/rating-filter-wrapper-frontend.js 5.58 kB
build/rating-filter.js 7.36 kB
build/reviews-by-category.js 11.1 kB
build/reviews-by-product.js 12.2 kB
build/reviews-frontend.js 6.87 kB
build/single-product-frontend.js 17.3 kB
build/single-product.js 9.9 kB
build/stock-filter-frontend.js 8.74 kB
build/stock-filter-wrapper-frontend.js 5.71 kB
build/stock-filter.js 8.1 kB
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--671ca56f-frontend.js 5.26 kB
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.14 kB
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping--checkout-block--dda5866c-frontend.js 8.25 kB
build/wc-blocks-data.js 21.1 kB
build/wc-blocks-editor-style-rtl.css 5.41 kB
build/wc-blocks-editor-style.css 5.41 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-middleware.js 931 B
build/wc-blocks-registry.js 2.91 kB
build/wc-blocks-shared-context.js 1.51 kB
build/wc-blocks-shared-hocs.js 1.72 kB
build/wc-blocks-vendors-style-rtl.css 1.96 kB
build/wc-blocks-vendors-style.css 1.96 kB
build/wc-blocks-vendors.js 22.8 kB
build/wc-blocks.js 2.62 kB
build/wc-payment-method-bacs.js 816 B
build/wc-payment-method-cheque.js 811 B
build/wc-payment-method-cod.js 909 B
build/wc-payment-method-paypal.js 837 B
build/wc-settings.js 2.6 kB

compressed-size-action

Copy link
Contributor

@sunyatasattva sunyatasattva left a comment

Choose a reason for hiding this comment

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

Tested and it works correctly! Added a small question to the code, but otherwise all seems good.

I'd probably like to see us using less hard-coded numbers there, but that's a much bigger topic. 😬

.components-form-token-field__token-text,
input[type="text"].components-form-token-field__input {
min-height: 30px;
min-height: calc(31.5px - 0.5em);
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, could you explain what problem is this solving? I tried removing this and breaking it in various ways, and I didn't manage. What is the min-height needed for? Also, if that's needed, wouldn't this kind of pixel perfect approach be somewhat fragile? Since em depend on the font-size it seems that you can get into a very small min height on larger font sizes.

But, again, as I don't really get why this is here, perhaps I'm getting it all wrong.

Copy link
Contributor Author

@Aljullu Aljullu Dec 30, 2022

Choose a reason for hiding this comment

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

Good catch, I think that was a left-over from a previous approach to fix it. I removed it in 37654f6.

@github-actions github-actions bot added this to the 9.3.0 milestone Dec 30, 2022
@Aljullu
Copy link
Contributor Author

Aljullu commented Dec 30, 2022

Thanks for the review, @sunyatasattva!

I'd probably like to see us using less hard-coded numbers there, but that's a much bigger topic. 😬

💯 completely agree. I will try to take a look at this as a follow-up. We should also unify the duplicated styles across blocks (related to #7875).

@Aljullu Aljullu force-pushed the fix/update-form-token-field-styles-after-wordpress/components-update branch from 65fd96e to 37654f6 Compare December 30, 2022 15:50
@Aljullu
Copy link
Contributor Author

Aljullu commented Dec 30, 2022

@kmanijak do you want me to merge this branch into yours?

@thealexandrelara
Copy link
Contributor

thealexandrelara commented Dec 30, 2022

Thank you for working on this. I was testing it in my environment and I got the following:
image

It seems that depending on the number of characters, the selector creates an additional space that makes it becomes bigger. Can you reproduce it? This is my environment:

  • WordPress 6.1.1
  • PHP 8.1.9
  • Gutenberg 14.8.4
  • WooCommerce 7.2.2
  • Theme: Twenty Twenty-Three

@sunyatasattva
Copy link
Contributor

I can reproduce, but I am not sure this is an error. This is due to the fact that in that extra space you see at the bottom, the user can focus the cursor and type. It could be argued that this is not necessary as there is still space on the top row, but the space is very small and is competing with the dropdown caret, so I'd say in this case it's ok for accessibility and clarity reasons.

But that's just my opinion. @Aljullu what do you think?

On the other hand, I noticed something I'd like to be different, that the caret has no cursor: pointer (I guess, an old friend of ours 😂 pca54o-2At-p2). I think that it is unclear, I myself have clicked it a bunch of times and thought it was glitching 🤦‍♀️

@Aljullu Aljullu removed this from the 9.3.0 milestone Jan 2, 2023
@github-actions
Copy link
Contributor

This PR has been marked as stale because it has not seen any activity within the past 7 days. Our team uses this tool to help surface pull requests that have slipped through review.

If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label.

@github-actions github-actions bot added the status: stale Stale issues and PRs have had no updates for 60 days. label Jan 10, 2023
@Aljullu
Copy link
Contributor Author

Aljullu commented Jan 11, 2023

I can reproduce, but I am not sure this is an error. This is due to the fact that in that extra space you see at the bottom, the user can focus the cursor and type. It could be argued that this is not necessary as there is still space on the top row, but the space is very small and is competing with the dropdown caret, so I'd say in this case it's ok for accessibility and clarity reasons.

But that's just my opinion. @Aljullu what do you think?

Yes, I agree. When the existing chip is too wide, the input breaks into another line. I think that's fine as you mention for a11y reasons and to make it clear that new values can be added.

On the other hand, I noticed something I'd like to be different, that the caret has no cursor: pointer (I guess, an old friend of ours 😂 pca54o-2At-p2). I think that it is unclear, I myself have clicked it a bunch of times and thought it was glitching 🤦‍♀️

It's not clear to me what do you mean by "caret" in this context?

@sunyatasattva
Copy link
Contributor

It's not clear to me what do you mean by "caret" in this context?

The little “arrow down” on the right side that usually signifies the part of a dropdown with which you can interact and, often, indicates the expanded/collapsed state of the suggestions.

@github-actions github-actions bot removed the status: stale Stale issues and PRs have had no updates for 60 days. label Jan 12, 2023
Copy link
Contributor

@thealexandrelara thealexandrelara left a comment

Choose a reason for hiding this comment

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

Great, since that is not considered an issue, I'm also approving the PR. Thank you Lucio and Albert for your insights

@github-actions github-actions bot added this to the 9.4.0 milestone Jan 13, 2023
@Aljullu Aljullu removed this from the 9.4.0 milestone Jan 16, 2023
@gigitux gigitux added this to the 9.5.0 milestone Jan 16, 2023
@github-actions
Copy link
Contributor

This PR has been marked as stale because it has not seen any activity within the past 7 days. Our team uses this tool to help surface pull requests that have slipped through review.

If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label.

@github-actions github-actions bot added the status: stale Stale issues and PRs have had no updates for 60 days. label Jan 24, 2023
@nielslange nielslange merged commit fd8423e into try/update-wordpress-components-no-framer-motion Jan 30, 2023
@nielslange nielslange deleted the fix/update-form-token-field-styles-after-wordpress/components-update branch January 30, 2023 08:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

block-type: filter blocks Issues related to all of the filter blocks. focus: components Work that introduces new or updates existing components. skip-changelog PRs that you don't want to appear in the changelog. status: stale Stale issues and PRs have had no updates for 60 days.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants