-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #467 add data error alert notice #478
Conversation
</style> | ||
|
||
{#if alertVisible} | ||
<div class="alert-notice" transition:fade={{easing: cubicOut}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
65:46 error A space is required after '{' object-curly-spacing
65:63 error A space is required before '}' object-curly-spacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yay fade!
// Required: Which localStorage key to check whether this notice has been dismissed. | ||
export let toggleKey = ''; | ||
|
||
$: alertVisible = window.localStorage.getItem(KEY_PREFIX + toggleKey) !== 'true'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Slack, Rob Miller mentioned that he'd like the message to reappear daily if it's not too much engineering effort, or if that would be too much engineering effort, to use sessionStorage
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the $:
reactivity do in this case? It doesn't seem that manually altering localStorage
has any immediate effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, just an artifact of some earlier testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a remnant of an earlier approach, and yep I added the check against today
|
||
// So we don't pollute the entire LS namespace. | ||
const KEY_PREFIX = 'alertNotice-'; | ||
export let dismissText = 'dismiss'; // Label of 'dismiss' button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the sake of consistency, I'd suggest putting all of the props just below the imports.
border-radius: var(--border-radius-base); | ||
padding: var(--space-2x); | ||
align-items: center; | ||
grid-gap: var(--space-3x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't do anything in display: flex
, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I guess it does. Guess I need to brush up.
padding: var(--space-2x); | ||
align-items: center; | ||
grid-gap: var(--space-3x); | ||
width: fit-content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. I've never used this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be used here? Firefox says it's an invalid value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea another remnant of an earlier approach. Good catch.
src/routing/wrappers/Layout.svelte
Outdated
@@ -71,4 +72,7 @@ | |||
<Footer /> | |||
</ContentFooter> | |||
</Content> | |||
<AlertNotice toggleKey="dataErrorsWarning"> | |||
<p>The staging and development instances of GLAM are likely to have data issues and UI bugs.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think this copy is great. The only thing I'd suggest is maybe being more specific about "data issues" if we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose if someone is on dev, they may not care about stage, and vice versa. Maybe something like this.
"This dashboard is under active development. Bugs and [data accuracy issues] may exist."
But I'd defer to Rob for the final copy.
} | ||
|
||
.alert-notice-action button { | ||
padding: var(--space-base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're way ahead of Elon!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we really should make this --space-1x
across the board.
|
||
<style> | ||
.alert-notice { | ||
position: absolute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe position: sticky
instead, so that it remains at the bottom-left when the page scrolls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a little intrusive but I'll see what the consensus is. Easy to change.
<style> | ||
.alert-notice { | ||
position: absolute; | ||
left: var(--space-4x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, it feels more natural to me on the right. I want to say it's because of some common UI convention or something, but it may just be personal preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great @spasovski. Thanks for getting this together so quickly.
- I'd love to see a dismiss icon as well. If only a new icon set could be easily and effortlessly applied, gosh. (maybe the
Close
icon). These icons don't require any other stylesheet so they can be used without postcss, so it should be as easy as npm installing the package and then importing the one you want to use. I think the story shows all the icons + the names if you want to peruse. - I'd like to see a slight shadow to the element, if possible, to bring it a bit off the page. I think we might have some barely-used
box-shadow
variables that could be applied. - made a suggestion for the copy that gives more context.
</style> | ||
|
||
{#if alertVisible} | ||
<div class="alert-notice" transition:fade={{easing: cubicOut}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might suggest transition:fly
with a y: 10
or so and a duration
of maybe 200?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I appreciate the instinct to apply a transition!)
src/routing/wrappers/Layout.svelte
Outdated
@@ -71,4 +72,7 @@ | |||
<Footer /> | |||
</ContentFooter> | |||
</Content> | |||
<AlertNotice toggleKey="dataErrorsWarning"> | |||
<p>This dashboard is under active development. Bugs and data accuracy issues may exist.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>This dashboard is under active development. Bugs and data accuracy issues may exist.</p> | |
<p>Thank you for testing the GLAM prototype! | |
This tool is still in active development. UX bugs and data issues may exist. | |
Help us make it suit your needs by directing questions or feedback to the #glam Slack channel.</p> |
} | ||
|
||
.alert-notice-action button { | ||
padding: var(--space-base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we really should make this --space-1x
across the board.
Do
localStorage.clear()
in your console to see again after dismissing.Updated with John's copy: