Skip to content

Conversation

fatimasajadi
Copy link
Contributor

@fatimasajadi fatimasajadi commented Feb 27, 2023

WHY are these changes introduced?

Fixes #8511

The IndexTable component's bulkActions prop has an optional onMouseEnter prop in its type (ActionListSection) that is passed down to the ActionList/Components/Item/Item.tsx component, but it's not used in the Item.tsx. I need to use the onMouseEnter prop for a prefetch task that I am working on, and I don't have access to this prop until it's properly used in the Item.tsx component.

WHAT is this pull request doing?

Using the onMouseEnter Prop in the Item.tsx component.

How to 🎩

1- Use this spin link, and select any number of products in product index page.
2- Open the console on your browser.
3- Open up the bulk edit modal and observe when you hover over the Add available channel(s), and Hello World will be logged to your console.

Screen.Recording.2023-03-01.at.2.32.18.PM.mov

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@fatimasajadi fatimasajadi marked this pull request as draft February 27, 2023 23:02
@github-actions github-actions bot added the cla-needed Added by a bot. Contributor needs to sign the CLA Agreement. label Feb 27, 2023
@fatimasajadi fatimasajadi changed the title add onMouseEnter prop to the each item on the actionList component Add onMouseEnter prop to the each item on the ActionList component Feb 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2023

size-limit report 📦

Path Size
polaris-react-cjs 220.33 KB (+0.01% 🔺)
polaris-react-esm 140.06 KB (+0.02% 🔺)
polaris-react-esnext 195.84 KB (+0.01% 🔺)
polaris-react-css 42.33 KB (0%)

@fatimasajadi fatimasajadi force-pushed the onMouseEnter-available-items branch 4 times, most recently from 3d52163 to f9a027b Compare February 28, 2023 17:07
@fatimasajadi fatimasajadi force-pushed the onMouseEnter-available-items branch from f9a027b to f49ad38 Compare March 1, 2023 14:32
@github-actions github-actions bot removed the cla-needed Added by a bot. Contributor needs to sign the CLA Agreement. label Mar 1, 2023
@fatimasajadi fatimasajadi force-pushed the onMouseEnter-available-items branch 3 times, most recently from 317e758 to b5dcc5a Compare March 1, 2023 15:45
@fatimasajadi fatimasajadi force-pushed the onMouseEnter-available-items branch from b5dcc5a to 95bab70 Compare March 1, 2023 16:56
@fatimasajadi
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

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

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

yarn add @shopify/polaris-cli@0.0.0-snapshot-release-20230301180438
yarn add @shopify/polaris-icons@0.0.0-snapshot-release-20230301180438
yarn add @shopify/polaris@0.0.0-snapshot-release-20230301180438

@fatimasajadi fatimasajadi marked this pull request as ready for review March 2, 2023 14:05
@fatimasajadi fatimasajadi requested a review from pamelahicks March 2, 2023 15:10
@pamelahicks
Copy link
Contributor

@fatimasajadi can you go through the description's checklist and either fulfill the items or explain why you didn't need to fulfill them?

@fatimasajadi
Copy link
Contributor Author

@fatimasajadi can you go through the description's checklist and either fulfill the items or explain why you didn't need to fulfill them?

Oh sorry, I missed that part.

@fatimasajadi
Copy link
Contributor Author

@fatimasajadi can you go through the description's checklist and either fulfill the items or explain why you didn't need to fulfill them?

@pamelahicks, I went through all the checklist items. I checked the second item but based on the provided information on the checklist, I don't think my change requires any of the other items to be checked in the checklist (mobile, accessibility, updating the readme.md, and documentation).

@pamelahicks
Copy link
Contributor

I don't think my change requires any of the other items to be checked in the checklist (mobile, accessibility, updating the readme.md, and documentation).

@fatimasajadi I think a good callout to make about the README not needing to be updated is that the IndexTable README's bulk actions prop type definition already points to mouseEnter as being available and this PR makes that become true.

Copy link
Member

@kyledurand kyledurand left a comment

Choose a reason for hiding this comment

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

@fatimasajadi fatimasajadi merged commit b77c1fe into main Mar 2, 2023
@fatimasajadi fatimasajadi deleted the onMouseEnter-available-items branch March 2, 2023 19:40
laurkim pushed a commit that referenced this pull request Mar 6, 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-migrator@0.15.0

### Minor Changes

- [#8229](#8229)
[`e21fd8d79`](e21fd8d)
Thanks [@aveline](https://github.com/aveline)! - Created migration to
rename `Card` to `LegacyCard`

### Patch Changes

- Updated dependencies
\[[`6c0dda128`](6c0dda1)]:
    -   @shopify/polaris-tokens@6.7.0
    -   @shopify/stylelint-polaris@8.0.1

## @shopify/polaris@10.33.0

### Minor Changes

- [#8514](#8514)
[`78d686db5`](78d686d)
Thanks [@lgriffee](https://github.com/lgriffee)! - Add additional
changes for migrating `legacy` custom properties from `v10` to `v11`


- [#8512](#8512)
[`b77c1fe51`](b77c1fe)
Thanks [@fatimasajadi](https://github.com/fatimasajadi)! - Add
onMouseEnter prop to the each item on the ActionList component


- [#8530](#8530)
[`bec50d4d8`](bec50d4)
Thanks [@kyledurand](https://github.com/kyledurand)! - Removed alignment
defaults from Inline and AlphaStack


- [#8448](#8448)
[`590e495fd`](590e495)
Thanks [@alex-page](https://github.com/alex-page)! - [Text] adds
optional numeric font variant to render characters with a monospace
apperance and consistent height and width


- [#8130](#8130)
[`6c0dda128`](6c0dda1)
Thanks [@mrcthms](https://github.com/mrcthms)! - - Added a `suffix` prop
to `Tooltip`
- Improved the UX of `Tooltip` by refining open and close animations and
adding an arrow pointing to the center of the `activator`
- Added the `EmpemeralPresenceManager` to manage the presence of
non-blocking overlays, like `Tooltip` and `Toast`


- [#8556](#8556)
[`de3a925a7`](de3a925)
Thanks [@laurkim](https://github.com/laurkim)! - Deprecated `Stack` and
`Stack.Item` and updated documentation on style guide


- [#8498](#8498)
[`624751155`](6247511)
Thanks [@lgriffee](https://github.com/lgriffee)! - Migrated `legacy`
custom properties from `v10` to `v11`

### Patch Changes

- [#8534](#8534)
[`eeb8a4fc5`](eeb8a4f)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated usage of
`Stack` to `LegacyStack`


- [#8540](#8540)
[`70c166290`](70c1662)
Thanks [@Ipriyankrajai](https://github.com/Ipriyankrajai)! - Fixed
`ActionList` item `suffix` having extra padding when wrapped


- [#8523](#8523)
[`f644ad671`](f644ad6)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed deprecation
warning on Card


- [#8531](#8531)
[`7ecc8a9a6`](7ecc8a9)
Thanks [@chloerice](https://github.com/chloerice)! - - Fixed header of
`IndexTable` with `bulkActions` not having border radius
- Fixed header of `selectable` `ResourceList` not having border radius
- Fixed `selectable` `ResourceList` with no `bulkActions` having extra
bottom padding in select mode
- Fixed last `ResourceItem` in a `selectable` `ResourceList` with
`bulkActions` having a border radius when in select mode
- Updated dependencies
\[[`6c0dda128`](6c0dda1),
[`886da4fc3`](886da4f)]:
    -   @shopify/polaris-tokens@6.7.0
    -   @shopify/polaris-icons@6.11.3

## @shopify/polaris-tokens@6.7.0

### Minor Changes

- [#8130](#8130)
[`6c0dda128`](6c0dda1)
Thanks [@mrcthms](https://github.com/mrcthms)! - - Added a `suffix` prop
to `Tooltip`
- Improved the UX of `Tooltip` by refining open and close animations and
adding an arrow pointing to the center of the `activator`
- Added the `EmpemeralPresenceManager` to manage the presence of
non-blocking overlays, like `Tooltip` and `Toast`

## @shopify/polaris-cli@0.1.14

### Patch Changes

- Updated dependencies
\[[`e21fd8d79`](e21fd8d)]:
    -   @shopify/polaris-migrator@0.15.0

## @shopify/polaris-icons@6.11.3

### Patch Changes

- [#8505](#8505)
[`886da4fc3`](886da4f)
Thanks [@lfroms](https://github.com/lfroms)! - Converted percentage
fill-opacity to float in two icons for better compatibility

## @shopify/stylelint-polaris@8.0.1

### Patch Changes

- Updated dependencies
\[[`6c0dda128`](6c0dda1)]:
    -   @shopify/polaris-tokens@6.7.0

## polaris.shopify.com@0.38.0

### Minor Changes

- [#8129](#8129)
[`6d3843755`](6d38437)
Thanks [@jesstelford](https://github.com/jesstelford)! - Patterns
documentation is now written in Markdown to match all other site
content.


- [#8130](#8130)
[`6c0dda128`](6c0dda1)
Thanks [@mrcthms](https://github.com/mrcthms)! - - Added a `suffix` prop
to `Tooltip`
- Improved the UX of `Tooltip` by refining open and close animations and
adding an arrow pointing to the center of the `activator`
- Added the `EmpemeralPresenceManager` to manage the presence of
non-blocking overlays, like `Tooltip` and `Toast`


- [#8559](#8559)
[`668afa51c`](668afa5)
Thanks [@jjgali](https://github.com/jjgali)! - Update voice and tone of
Trustworthy experience value.

### Patch Changes

- [#8534](#8534)
[`eeb8a4fc5`](eeb8a4f)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated usage of
`Stack` to `LegacyStack`


- [#8519](#8519)
[`f411cf0b6`](f411cf0)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added missing
redirect, updated content


- [#8553](#8553)
[`d2672648a`](d267264)
Thanks [@gwyneplaine](https://github.com/gwyneplaine)! - Fix legacy
patterns wrongly being categorised as deprecated. These are now
correctly labeled "legacy"


- [#8556](#8556)
[`de3a925a7`](de3a925)
Thanks [@laurkim](https://github.com/laurkim)! - Deprecated `Stack` and
`Stack.Item` and updated documentation on style guide


- [#8493](#8493)
[`a6fb3fbb7`](a6fb3fb)
Thanks [@kyledurand](https://github.com/kyledurand)! - Moved props.json
to cache and automate generation


- [#8528](#8528)
[`191ff96df`](191ff96)
Thanks [@jesstelford](https://github.com/jesstelford)! - Fixed grid
alignment on component group page

- Updated dependencies
\[[`eeb8a4fc5`](eeb8a4f),
[`78d686db5`](78d686d),
[`70c166290`](70c1662),
[`b77c1fe51`](b77c1fe),
[`bec50d4d8`](bec50d4),
[`f644ad671`](f644ad6),
[`590e495fd`](590e495),
[`6c0dda128`](6c0dda1),
[`de3a925a7`](de3a925),
[`886da4fc3`](886da4f),
[`7ecc8a9a6`](7ecc8a9),
[`624751155`](6247511)]:
    -   @shopify/polaris@10.33.0
    -   @shopify/polaris-tokens@6.7.0
    -   @shopify/polaris-icons@6.11.3

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
…hopify#8512)

<!--
  ☝️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?

Fixes #[8511](Shopify#8511) <!-- link
to issue if one exists -->

The
[`IndexTable`](https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/IndexTable/IndexTable.tsx)
component's bulkActions prop has an optional `onMouseEnter` prop in its
type (`ActionListSection`) that is passed down to the
[`ActionList/Components/Item/Item.tsx`](https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/ActionList/components/Item/Item.tsx)
component, but it's not used in the `Item.tsx`. I need to use the
`onMouseEnter` prop for a prefetch task that I am working on, and I
don't have access to this prop until it's properly used in the
`Item.tsx` component.
<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?
Using the `onMouseEnter` Prop in the
[Item.tsx](https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/ActionList/components/Item/Item.tsx)
component.
<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

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

### How to 🎩
1- Use this [spin
link](https://admin.web.polaris-onmouseenter-fix.fatima-sajadi.us.spin.dev/store/shop1/products?selectedView=all),
and select any number of products in product index page.
2- Open the console on your browser.
3- Open up the bulk edit modal and observe when you hover over the `Add
available channel(s)`, and `Hello World` will be logged to your console.


https://user-images.githubusercontent.com/6689267/222245173-1fe2b1f0-7034-4955-a078-08a184d69409.mov



🖥 [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)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] 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-migrator@0.15.0

### Minor Changes

- [Shopify#8229](Shopify#8229)
[`e21fd8d79`](Shopify@e21fd8d)
Thanks [@aveline](https://github.com/aveline)! - Created migration to
rename `Card` to `LegacyCard`

### Patch Changes

- Updated dependencies
\[[`6c0dda128`](Shopify@6c0dda1)]:
    -   @shopify/polaris-tokens@6.7.0
    -   @shopify/stylelint-polaris@8.0.1

## @shopify/polaris@10.33.0

### Minor Changes

- [Shopify#8514](Shopify#8514)
[`78d686db5`](Shopify@78d686d)
Thanks [@lgriffee](https://github.com/lgriffee)! - Add additional
changes for migrating `legacy` custom properties from `v10` to `v11`


- [Shopify#8512](Shopify#8512)
[`b77c1fe51`](Shopify@b77c1fe)
Thanks [@fatimasajadi](https://github.com/fatimasajadi)! - Add
onMouseEnter prop to the each item on the ActionList component


- [Shopify#8530](Shopify#8530)
[`bec50d4d8`](Shopify@bec50d4)
Thanks [@kyledurand](https://github.com/kyledurand)! - Removed alignment
defaults from Inline and AlphaStack


- [Shopify#8448](Shopify#8448)
[`590e495fd`](Shopify@590e495)
Thanks [@alex-page](https://github.com/alex-page)! - [Text] adds
optional numeric font variant to render characters with a monospace
apperance and consistent height and width


- [Shopify#8130](Shopify#8130)
[`6c0dda128`](Shopify@6c0dda1)
Thanks [@mrcthms](https://github.com/mrcthms)! - - Added a `suffix` prop
to `Tooltip`
- Improved the UX of `Tooltip` by refining open and close animations and
adding an arrow pointing to the center of the `activator`
- Added the `EmpemeralPresenceManager` to manage the presence of
non-blocking overlays, like `Tooltip` and `Toast`


- [Shopify#8556](Shopify#8556)
[`de3a925a7`](Shopify@de3a925)
Thanks [@laurkim](https://github.com/laurkim)! - Deprecated `Stack` and
`Stack.Item` and updated documentation on style guide


- [Shopify#8498](Shopify#8498)
[`624751155`](Shopify@6247511)
Thanks [@lgriffee](https://github.com/lgriffee)! - Migrated `legacy`
custom properties from `v10` to `v11`

### Patch Changes

- [Shopify#8534](Shopify#8534)
[`eeb8a4fc5`](Shopify@eeb8a4f)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated usage of
`Stack` to `LegacyStack`


- [Shopify#8540](Shopify#8540)
[`70c166290`](Shopify@70c1662)
Thanks [@Ipriyankrajai](https://github.com/Ipriyankrajai)! - Fixed
`ActionList` item `suffix` having extra padding when wrapped


- [Shopify#8523](Shopify#8523)
[`f644ad671`](Shopify@f644ad6)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed deprecation
warning on Card


- [Shopify#8531](Shopify#8531)
[`7ecc8a9a6`](Shopify@7ecc8a9)
Thanks [@chloerice](https://github.com/chloerice)! - - Fixed header of
`IndexTable` with `bulkActions` not having border radius
- Fixed header of `selectable` `ResourceList` not having border radius
- Fixed `selectable` `ResourceList` with no `bulkActions` having extra
bottom padding in select mode
- Fixed last `ResourceItem` in a `selectable` `ResourceList` with
`bulkActions` having a border radius when in select mode
- Updated dependencies
\[[`6c0dda128`](Shopify@6c0dda1),
[`886da4fc3`](Shopify@886da4f)]:
    -   @shopify/polaris-tokens@6.7.0
    -   @shopify/polaris-icons@6.11.3

## @shopify/polaris-tokens@6.7.0

### Minor Changes

- [Shopify#8130](Shopify#8130)
[`6c0dda128`](Shopify@6c0dda1)
Thanks [@mrcthms](https://github.com/mrcthms)! - - Added a `suffix` prop
to `Tooltip`
- Improved the UX of `Tooltip` by refining open and close animations and
adding an arrow pointing to the center of the `activator`
- Added the `EmpemeralPresenceManager` to manage the presence of
non-blocking overlays, like `Tooltip` and `Toast`

## @shopify/polaris-cli@0.1.14

### Patch Changes

- Updated dependencies
\[[`e21fd8d79`](Shopify@e21fd8d)]:
    -   @shopify/polaris-migrator@0.15.0

## @shopify/polaris-icons@6.11.3

### Patch Changes

- [Shopify#8505](Shopify#8505)
[`886da4fc3`](Shopify@886da4f)
Thanks [@lfroms](https://github.com/lfroms)! - Converted percentage
fill-opacity to float in two icons for better compatibility

## @shopify/stylelint-polaris@8.0.1

### Patch Changes

- Updated dependencies
\[[`6c0dda128`](Shopify@6c0dda1)]:
    -   @shopify/polaris-tokens@6.7.0

## polaris.shopify.com@0.38.0

### Minor Changes

- [Shopify#8129](Shopify#8129)
[`6d3843755`](Shopify@6d38437)
Thanks [@jesstelford](https://github.com/jesstelford)! - Patterns
documentation is now written in Markdown to match all other site
content.


- [Shopify#8130](Shopify#8130)
[`6c0dda128`](Shopify@6c0dda1)
Thanks [@mrcthms](https://github.com/mrcthms)! - - Added a `suffix` prop
to `Tooltip`
- Improved the UX of `Tooltip` by refining open and close animations and
adding an arrow pointing to the center of the `activator`
- Added the `EmpemeralPresenceManager` to manage the presence of
non-blocking overlays, like `Tooltip` and `Toast`


- [Shopify#8559](Shopify#8559)
[`668afa51c`](Shopify@668afa5)
Thanks [@jjgali](https://github.com/jjgali)! - Update voice and tone of
Trustworthy experience value.

### Patch Changes

- [Shopify#8534](Shopify#8534)
[`eeb8a4fc5`](Shopify@eeb8a4f)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated usage of
`Stack` to `LegacyStack`


- [Shopify#8519](Shopify#8519)
[`f411cf0b6`](Shopify@f411cf0)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added missing
redirect, updated content


- [Shopify#8553](Shopify#8553)
[`d2672648a`](Shopify@d267264)
Thanks [@gwyneplaine](https://github.com/gwyneplaine)! - Fix legacy
patterns wrongly being categorised as deprecated. These are now
correctly labeled "legacy"


- [Shopify#8556](Shopify#8556)
[`de3a925a7`](Shopify@de3a925)
Thanks [@laurkim](https://github.com/laurkim)! - Deprecated `Stack` and
`Stack.Item` and updated documentation on style guide


- [Shopify#8493](Shopify#8493)
[`a6fb3fbb7`](Shopify@a6fb3fb)
Thanks [@kyledurand](https://github.com/kyledurand)! - Moved props.json
to cache and automate generation


- [Shopify#8528](Shopify#8528)
[`191ff96df`](Shopify@191ff96)
Thanks [@jesstelford](https://github.com/jesstelford)! - Fixed grid
alignment on component group page

- Updated dependencies
\[[`eeb8a4fc5`](Shopify@eeb8a4f),
[`78d686db5`](Shopify@78d686d),
[`70c166290`](Shopify@70c1662),
[`b77c1fe51`](Shopify@b77c1fe),
[`bec50d4d8`](Shopify@bec50d4),
[`f644ad671`](Shopify@f644ad6),
[`590e495fd`](Shopify@590e495),
[`6c0dda128`](Shopify@6c0dda1),
[`de3a925a7`](Shopify@de3a925),
[`886da4fc3`](Shopify@886da4f),
[`7ecc8a9a6`](Shopify@7ecc8a9),
[`624751155`](Shopify@6247511)]:
    -   @shopify/polaris@10.33.0
    -   @shopify/polaris-tokens@6.7.0
    -   @shopify/polaris-icons@6.11.3

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