Skip to content

Conversation

@bencmilton
Copy link
Contributor

@bencmilton bencmilton commented Dec 13, 2022

WHY are these changes introduced?

There are two pretty loud validateDOMNesting warnings logged in development that seem to be originating from the VideoThumbnail component:
Screenshot 2022-12-13 at 5 14 02 PM

WHAT is this pull request doing?

I'm hoping that this extremely naive fix might just do the trick, but I have not tested this beyond storybook. If there are any considerations that I missed, please let me know.

Visually, there does not appear to be a difference after the p is changed to a div

Before:
Screenshot 2022-12-13 at 5 15 53 PM

After:
Screenshot 2022-12-13 at 5 15 40 PM

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

I added the snapshot to a Notebooks spin instance, where we have a VideoThumbnail component on the main index page.

  1. Ensure that the validateDOMNesting warnings are now gone from the dev console
  2. Ensure that the VideoThumbnail and timestamp in particular still works and appears the same as before the change

🎩 checklist

@github-actions
Copy link
Contributor

github-actions bot commented Dec 13, 2022

size-limit report 📦

Path Size
polaris-react-cjs 211.21 KB (+0.01% 🔺)
polaris-react-esm 136.42 KB (-0.01% 🔽)
polaris-react-esnext 192.27 KB (-0.01% 🔽)
polaris-react-css 42.13 KB (0%)

@bencmilton bencmilton force-pushed the fix-video-thumbnail-valid-dom-nesting branch from 1648afc to c015e89 Compare December 13, 2022 22:27
@bencmilton
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @bencmilton! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221213223312
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221213223312
yarn add @shopify/polaris@0.0.0-snapshot-release-20221213223312
yarn add @shopify/stylelint-polaris@0.0.0-snapshot-release-20221213223312

@bencmilton bencmilton requested a review from yurm04 December 14, 2022 16:36
@yurm04
Copy link
Contributor

yurm04 commented Dec 14, 2022

This change seems ok to me semantically. My one concern was accessibility support for assistive technologies:

I tested with VoiceOver to confirm there weren't any unintended side effects with changing that p to a div. As far as I can tell from comparing original to updated, VO does not announce that timestamp directly in either and maybe doesn't need to since it does announce the button group and timestamp when focused on the video thumbnail.

before update
Screenshot 2022-12-14 at 11 46 44 AM

After update
Screenshot 2022-12-14 at 11 45 13 AM

I could use a second opinion so will tag in an accessibility engineer to weigh in

Copy link

@menigk-shopify menigk-shopify left a comment

Choose a reason for hiding this comment

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

LGTM. I see no regression in making this change from a

to

.

@bencmilton
Copy link
Contributor Author

Great catch! Thank you for checking on the accessibility @yurm04 and @menigk-shopify!

@bencmilton bencmilton merged commit b26408e into main Dec 14, 2022
@bencmilton bencmilton deleted the fix-video-thumbnail-valid-dom-nesting branch December 14, 2022 19:39
laurkim pushed a commit that referenced this pull request Dec 15, 2022
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris@10.16.1

### Patch Changes

- [#7904](#7904)
[`bdc62ebbb`](bdc62eb)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed a bug where
responsive props would inherit values on Box


- [#7911](#7911)
[`b26408e2f`](b26408e)
Thanks [@bencmilton](https://github.com/bencmilton)! - Fix
validateDOMNesting warning in `VideoThumbnail`

## @shopify/plugin-polaris@0.0.22



## polaris.shopify.com@0.27.3

### Patch Changes

- Updated dependencies
\[[`bdc62ebbb`](bdc62eb),
[`b26408e2f`](b26408e)]:
    -   @shopify/polaris@10.16.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@gwyneplaine gwyneplaine mentioned this pull request Feb 14, 2023
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?
There are two pretty loud `validateDOMNesting` warnings logged in
development that seem to be originating from the `VideoThumbnail`
component:
<img width="712" alt="Screenshot 2022-12-13 at 5 14 02 PM"
src="https://user-images.githubusercontent.com/9685204/207456198-d3b2a437-869a-4f9e-9441-44bbb851839e.png">

<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?
I'm hoping that this extremely naive fix might just do the trick, but I
have not tested this beyond storybook. If there are any considerations
that I missed, please let me know.

Visually, there does not appear to be a difference after the `p` is
changed to a `div`

**Before**:
<img width="737" alt="Screenshot 2022-12-13 at 5 15 53 PM"
src="https://user-images.githubusercontent.com/9685204/207456176-e05c764b-ff91-4d1b-9ad6-e119f9712de4.png">

**After**:
<img width="737" alt="Screenshot 2022-12-13 at 5 15 40 PM"
src="https://user-images.githubusercontent.com/9685204/207456189-bcb7913b-befd-46b9-999f-c23ee023295b.png">

<!-- ℹ️ Delete the following for small / trivial changes -->

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

I added the snapshot to a Notebooks [spin
instance](https://admin.web.video-thumbnail-fix.ben-milton.us.spin.dev/store/shop1/apps/development-notebooks-key/),
where we have a `VideoThumbnail` component on the main index page.
1. Ensure that the `validateDOMNesting` warnings are now gone from the
dev console
2. Ensure that the `VideoThumbnail` and timestamp in particular still
works and appears the same as before the change

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris@10.16.1

### Patch Changes

- [Shopify#7904](Shopify#7904)
[`bdc62ebbb`](Shopify@bdc62eb)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed a bug where
responsive props would inherit values on Box


- [Shopify#7911](Shopify#7911)
[`b26408e2f`](Shopify@b26408e)
Thanks [@bencmilton](https://github.com/bencmilton)! - Fix
validateDOMNesting warning in `VideoThumbnail`

## @shopify/plugin-polaris@0.0.22



## polaris.shopify.com@0.27.3

### Patch Changes

- Updated dependencies
\[[`bdc62ebbb`](Shopify@bdc62eb),
[`b26408e2f`](Shopify@b26408e)]:
    -   @shopify/polaris@10.16.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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