Skip to content

Conversation

@stewx
Copy link
Contributor

@stewx stewx commented Mar 13, 2023

WHY are these changes introduced?

While investigating another issue, I noticed we can't actually test switching between navigation entries in our Storybook stories.

This helps with testing.

WHAT is this pull request doing?

This makes the Storybook stories change the selected navigation item when you click on a different item.

I also removed duplicateRootItem from the story and docs page because it appears to not exist in the actual implementation.

How to 🎩

🖥 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

@stewx stewx requested review from alex-page and kyledurand March 13, 2023 17:40
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2023

size-limit report 📦

Path Size
polaris-react-cjs 221.34 KB (0%)
polaris-react-esm 140.79 KB (0%)
polaris-react-esnext 197.54 KB (0%)
polaris-react-css 43.09 KB (0%)

@stewx stewx merged commit e3e2496 into main Mar 14, 2023
@stewx stewx deleted the feature/navigation-story-improvement branch March 14, 2023 12:17
stewx added a commit that referenced this pull request Mar 14, 2023
…uring collapse/expand (#8655)

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

Resolves #8653

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

### WHAT is this pull request doing?

There is a synchronization issue in which we have a sort of half-open
state for navigation sections. This moves the style from that half-open
state to the fully-open state.

The half-open state might still exist (because `Secondary` uses
`Collapsible` which wants to do animations) but AFAIK it's not causing
any unwanted behaviour.


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

### How to 🎩

This can be tested if you check out my Navigation storybook improvements
in #8652 and cherry pick this commit over to that branch, or vice versa.
Try switching between sections, and record a high-speed video of it to
see the difference.

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

### 🎩 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)
- [x] 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
<!--
  ☝️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?

While investigating another issue, I noticed we can't actually test
switching between navigation entries in our Storybook stories.

This helps with testing.

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

### WHAT is this pull request doing?

This makes the Storybook stories change the selected navigation item
when you click on a different item.

I also removed `duplicateRootItem` from the story and docs page because
it appears to not exist in the actual implementation.

<!--
  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 🎩

🖥 [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)
- [ ] 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
…uring collapse/expand (Shopify#8655)

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

Resolves Shopify#8653

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

### WHAT is this pull request doing?

There is a synchronization issue in which we have a sort of half-open
state for navigation sections. This moves the style from that half-open
state to the fully-open state.

The half-open state might still exist (because `Secondary` uses
`Collapsible` which wants to do animations) but AFAIK it's not causing
any unwanted behaviour.


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

### How to 🎩

This can be tested if you check out my Navigation storybook improvements
in Shopify#8652 and cherry pick this commit over to that branch, or vice versa.
Try switching between sections, and record a high-speed video of it to
see the difference.

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

### 🎩 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)
- [x] 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
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.

2 participants