-
Notifications
You must be signed in to change notification settings - Fork 64
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/1957 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
de0b65a
to
67df089
Compare
Size Change: -5.09 kB (-1%) Total Size: 808 kB
ℹ️ View Unchanged
|
67df089
to
0dd90f9
Compare
dd5279c
to
630d501
Compare
0dd90f9
to
2aaef47
Compare
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.
Update the ui store
2aaef47
to
252177c
Compare
Sorry, I should have drafted this PR until I updated it with the latest changes.
Thanks for catching, it was caused by the |
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.
Works well for me locally! From my perspective the only thing missing are updates to the e2e test that exercise the cookie and unit tests for the new store methods.
The rest of my feedback is just nit-picks and can be safely ignored, in my opinion.
/** | ||
* We only hide the enabled banner if there is a cookie. | ||
*/ | ||
const shouldShow = ref(!uiStore.isBannerDismissed(props.id)) |
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 is definitely just a nit about how to manage refs and store-derived data: Would it make sense to call isBannerDismissed
inside of a computed callback? That way the dismissBanner
function doesn't have to futz with updating the ref:
const shouldShow = computed(() => !uiStore.isBannerDismissed(props.id))
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
4022ebd
to
6a1e80f
Compare
While adding some code review suggestions, I realized that just like the layout properties, it is best to keep everything inside the |
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.
LGTM! 🚀
VMigrationNotice: () => import('~/components/VBanner/VMigrationNotice.vue'), | ||
VTranslationStatusBanner: () => | ||
import('~/components/VBanner/VTranslationStatusBanner.vue'), |
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.
Does this work asynchronously? 😮 Does it avoid including unused banners?
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.
It allows us to lazily load components. It's probably not as important for small components. We can also add the webpack comment to allow prefetching, although for the banners it doesn't make sense: the banner will only be displayed if the user goes to a language with fewer translated strings, but we would prefetch the code for everyone?
More info about it here:
https://vueschool.io/articles/vuejs-tutorials/lazy-loading-individual-vue-components-and-prefetching/
It would be nice to set up a way of measuring performance to see if things like this are really necessary or not.
@@ -0,0 +1,48 @@ | |||
<template> |
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 really like this abstraction 🚀
Based on the high urgency of this PR, the following reviewers are being gently reminded to review this PR: @zackkrida Excluding weekend1 days, this PR was updated 2 day(s) ago. PRs labelled with high urgency are expected to be reviewed within 2 weekday(s)2. @obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings. Footnotes |
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.
Very nice!
Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: Zack Krida <zackkrida@pm.me>
Fixes
Fixes #976 by @sarayourfriend
Description
This PR adds a UI cookie to save the IDs of banners that have been dismissed by the user.
Testing Instructions
Try opening
http://localhost:8443/ar/search?q=cat&referrer=creativecommons.org
. You should see 2 banners at the top of the window. If you dismiss one of them and reload, it should not re-appear. If you clear the cookies for localhost and reload, it should re-appear.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin