css icon indicating copy to clipboard operation
css copied to clipboard

Refactor Flash alert

Open vdepizzol opened this issue 3 years ago • 10 comments

What are you trying to accomplish?

This PR adds a new Flash component, meant to eventually replace our existing flash alert. This update aims to fix long standing issues found in it, mainly regarding responsive support.

Link to Storybook

Main updates:

Improved alignment and spacing

Screen Shot 2022-03-03 at 15 44 08

Screen Shot 2022-03-03 at 15 47 47

Screen Shot 2022-03-03 at 15 43 01

Screen Shot 2022-03-03 at 15 44 37

Responsive support

Screen Shot 2022-03-03 at 15 45 32

Screen Shot 2022-03-03 at 15 45 05

A lot of the spacing values used in this refactor are hardcoded, and will benefit from the Primer Primitives spacing update once that's available. (link only available for Hubbers).

What approach did you choose and why?

I've kept the current flash alert in place, and created a new flash-refactor.scss file, in a similar fashion to how @langermank has considered the refactor for the Button component (#1874).

After all instances of flash are replaced with this new component (specially after updating its ViewComponent, we can clean up these files.

Are additional changes needed?

As described in https://github.com/github/primer/issues/62 (internal to hubbers), some alerts may have multiple buttons. This refactor hasn't addressed for these use cases specifically.

  • [ ] No, this PR should be ok to ship as is. 🚢

Closes https://github.com/github/primer/issues/154.

vdepizzol avatar Mar 03 '22 23:03 vdepizzol

🦋 Changeset detected

Latest commit: 2b59674ffc25abdc082e031719cf015fe1ce0d88

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Mar 03 '22 23:03 changeset-bot[bot]

I'm moving this back to a draft to update the proposal with full support for accessibility and better naming. Thank you @alliethu and @ashygee 🎉 !

vdepizzol avatar Mar 04 '22 19:03 vdepizzol

@vdepizzol after our conversation we had discussed that the full version of the Banner (Flash) component would be what we currently style as .flash-banner, see screenshot below. I did not see this reflected in Storybook as it still has the border at the top and bottom of the component. Are we still considering making this change?

proposal for Banner full variant to attach to the top of containers

ashygee avatar Mar 09 '22 00:03 ashygee

@ashygee:

after our conversation we had discussed that the full version of the Banner (Flash) component would be what we currently style as .flash-banner, see screenshot below. I did not see this reflected in Storybook as it still has the border at the top and bottom of the component. Are we still considering making this change?

So, I'm no longer including a -banner variant in the component since we'll no longer offer support for sticky banners. From the Primer CSS docs:

A flash message that is fixed positioned at the top of the page. Use for more global events where the content of the page is unknown.

Eventually a system tray should better support system banners. See https://github.com/primer/css/pull/1898.


In the meantime, a -full variant should still work inside bordered Box elements:

Screen Shot 2022-03-14 at 16 40 01

More about Boxes with alerts

:v: :v: :v:

vdepizzol avatar Mar 14 '22 23:03 vdepizzol

@langermank @simurai @ashygee opening this again for review!

I'm not addressing WAI-ARIA requirements at this time, I believe a full audit and decisions can happen once the PVC component is updated.

vdepizzol avatar Mar 14 '22 23:03 vdepizzol

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

github-actions[bot] avatar Jun 19 '22 20:06 github-actions[bot]

👋 @vdepizzol How do you feel about merging this component and start testing it out in production?

siddharthkp avatar Aug 10 '22 15:08 siddharthkp

How do you feel about merging this component and start testing it out in production?

Is there already a need for this in production?

I think the main reason this hasn't shipped is that there is no plan for the PVC implementation yet. And we want to avoid using it with custom markup/HTML. So it would just be un-used CSS for now.

simurai avatar Aug 15 '22 05:08 simurai

Is there already a need for this in production?

No rush, curious because some of the problems identified in this thread were reported again when I was first responder

siddharthkp avatar Aug 15 '22 10:08 siddharthkp

Is there already a need for this in production?

No rush, curious because some of the problems identified in this thread were reported again when I was first responder

FWIW, it's been shipped in Figma.

ashygee avatar Aug 17 '22 19:08 ashygee

Hey everyone! The PVC team has picked this up, see: https://github.com/primer/view_components/pull/1494

camertron avatar Oct 13 '22 23:10 camertron

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

github-actions[bot] avatar Dec 13 '22 00:12 github-actions[bot]

Closing this again since the .Banner styles now live in PVC.

simurai avatar Dec 13 '22 02:12 simurai