Skip to content

Conversation

@aveline
Copy link
Contributor

@aveline aveline commented Oct 6, 2022

WHY are these changes introduced?

Fixes #7358

WHAT is this pull request doing?

Refactors Banner component to use new layout primitive components

@aveline aveline changed the title Layout banner [Banner] Rebuild with layout components Oct 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

size-limit report 📦

Path Size
polaris-react-cjs 209.05 KB (+0.01% 🔺)
polaris-react-esm 135.54 KB (-0.01% 🔽)
polaris-react-esnext 190.79 KB (-0.06% 🔽)
polaris-react-css 41.46 KB (-0.17% 🔽)

@aveline aveline marked this pull request as ready for review October 7, 2022 15:56
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.

🔥 This looks awesome Aveline 👏

Just worried about removing the ID. I'm not sure what it was added for but we'd need some comms around removing it so it doesn't mess anything up in web. Maybe we should hold off on removing it until v11

if (title) {
headingID = `${id}Heading`;
headingMarkup = (
<div className={styles.Heading} id={headingID}>
Copy link
Member

Choose a reason for hiding this comment

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

Removing id is likely a breaking change. I imagine this was added for analytics or tracking of some kind. Makes me a bit uncomfortable to remove it but I want to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that's a good call about analytics tracking. The thinking in this case was the id was maybe used for semantics and aria labelling. I do have another PR to add id and could refactor this if we are game to merge that in #7363

Copy link
Member

Choose a reason for hiding this comment

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

There is no way for teams to know the ID as it's generated with useUniqueId. I think this should be safe to remove. Other ID's though this could be the case.

Copy link
Member

Choose a reason for hiding this comment

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

@BPScott do you remember why banners needed unique ids?

Copy link
Member

Choose a reason for hiding this comment

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

It is because they don't use semantic heading elements so they get aria roles to link the ID. This should be fixed with HTML.

contentID = `${id}Content`;
contentMarkup = (
<div className={styles.Content} id={contentID}>
<Box paddingTop="05" paddingBottom="05">
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we could do something like this until we can remove id:

Suggested change
<Box paddingTop="05" paddingBottom="05">
<Box paddingTop="05" paddingBottom="05">
<div id={contentID} />

We'd have to ping the person who contributed the id prop to the component to see if this would be sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be some context here #3199

@aveline aveline self-assigned this Oct 7, 2022
@laurkim laurkim force-pushed the layout-components-beta branch from 88856f7 to e45e174 Compare October 14, 2022 14:56
Copy link
Contributor

@laurkim laurkim left a comment

Choose a reason for hiding this comment

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

Nice! 💯

@aveline aveline merged commit 41aea8b into layout-components-beta Oct 18, 2022
@aveline aveline deleted the layout-banner branch October 18, 2022 14:35
laurkim pushed a commit that referenced this pull request Oct 27, 2022
### WHY are these changes introduced?

Fixes #7358 

### WHAT is this pull request doing?

Refactors `Banner` component to use new layout primitive components
laurkim pushed a commit that referenced this pull request Oct 28, 2022
### WHY are these changes introduced?

Fixes #7358 

### WHAT is this pull request doing?

Refactors `Banner` component to use new layout primitive components
laurkim pushed a commit that referenced this pull request Oct 28, 2022
### WHY are these changes introduced?

Fixes #7358 

### WHAT is this pull request doing?

Refactors `Banner` component to use new layout primitive components
chazdean pushed a commit that referenced this pull request Nov 22, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
chazdean pushed a commit that referenced this pull request Nov 22, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
laurkim pushed a commit that referenced this pull request Nov 23, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
chazdean pushed a commit that referenced this pull request Nov 28, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
laurkim pushed a commit that referenced this pull request Dec 5, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
laurkim pushed a commit that referenced this pull request Dec 7, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
laurkim pushed a commit that referenced this pull request Dec 9, 2022
Fixes #7358

Refactors `Banner` component to use new layout primitive components
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.

4 participants