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
feat: add Popover component #373
Conversation
35f87d6
to
7334b46
Compare
It is small enough to be easily reviewed and have my blessings. If UX looks good, this can go in? (I know this is not mergable atm) |
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.
its a good baseline to continue the rest of the subtasks.
Its looks good. maybe a very very nitpicky suggestion: should we rename this.isShownData
to this.isDataShown
? unless there's a reason I'm missing.
ofc, the failing tests need to be fixed. then can be approved and merged.
Yeah, or |
I like that one |
5e33729
to
d7ef54c
Compare
Lots of progress here! 💯 Let me suggest the following Storybook changes hoping you can tell me if you agree this would be an improvement or not. Maybe, instead of the iconOnly buttons, we could use normal buttons with text that provides some extra indications, such as:
I could try to do this myself in a different PR, since it doesn't impact the component. What do you think? |
Easily done. Will do it tomorrow.
Can do, but note that we would keep showing all the Popovers by default, to allow for visual regression tests to verify their position and appearance.
I agree, but that becomes tricky together with the above requirement of showing all the Popovers right from the start. Though we could probably reduce the distance between two components a bit, that should already help. And maybe change the order of the Popover-positions a bit, that should also help.
Yeah, we will have to look into fixing that. My suspicion is that our postcss is not translating things like |
In the mid-term, we may want to look into separating the storybook for visual regression tests from the storybook for public documentation. And ideally have those visual regression tests done with all supported browsers, not just with Chrome. |
Yes, showing the popovers by default is perfect, thanks for covering for that! At the moment, all the popovers disappear when any of the buttons in the All page is clicked, so I thought that using the button labels to indicate direction could be nice for orientation.
The All page looks so much better now! Thanks 🙏 |
@SaiSan-WMDE I adjusted storybook a bit. What do you think? Safari is broken because of a problem with our PostCSS setup. I'll made a dedicated ticket for that: T276028. |
Gotcha, will fix! |
3b8efb3
to
761e22b
Compare
You're probably right 😕 I'll do an overall review in Safari to collect all the issues. I could document them in a Phab ticket in case that's useful. |
Yes, if you find issues other than this and in the Checkbox, then another Phabricator ticket would be a good idea |
ed56a2f
to
29600bc
Compare
Mh, changing those button labels revealed some more positioning problems. Will look into them today. |
The scss use directive has to be added to vue.config.js because it has to be in front of all other rules. Co-authored-by: bereket-WMDE <71328938+bereket-WMDE@users.noreply.github.com>
29600bc
to
cd15568
Compare
Easiest would be to manually define two explicit rtl and ltr blocks to workaround transforms not being handled by postcss-logical, but that doesn't work because we're prefixing _everything_ with .wikit :/ So we need to figure out how to not rely on translateX and horizontally moved origins of transformation.
This should now fix most of the rtl positioning issue, except one, the horizontally centered position. That one needs more thinking. |
translateX isn't adjusted by postcss-logical, therefore we have to make use of flexbox also somewhat affecting its absolute positioned children.
@SaiSan-WMDE This should now be finally ready to properly review :) |
The All page looks quite confusing now:
|
Yikes, the color was only for testing purposes to see where the middle of the button is exactly! Will fix that!
Not sure what you mean, but can do.
so top-start, top, top-end, end-top, end-center, end-bottom, bottom-end, bottom-center, bottom-start, start-bottom, start, start-top? 🤔 |
remove debugging color and make headline be on its own line.
This accounts for the Popover actually switching sides between ltr and rtl.
So, now it should be better. Let me know what you think, @SaiSan-WMDE 😊 |
Thanks for all the changes! 🙏
Position will never stop being somewhat confusing, but maybe now the indicator is more aligned with the implementation, and it communicates the actual RTL position properly, unlike before: |
Safari issues will still need to be tackled (in a separate PR, as discussed), and the responsive behavior of popovers should be discussed, but I'd say at this point this is ready to be merged? |
Wait, the Safari-Issues should be fixed. Do they still exist? |
* First draft of the popover tokens * Update Popover.json * Update Popover.json * Update Popover.json * Update tokens/properties/components/Popover.json * Update tokens/properties/components/Popover.json * Update tokens/properties/components/Popover.json * Update tokens/properties/components/Popover.json * Update tokens/properties/components/Popover.json * Update tokens/properties/components/Popover.json * feat: add Popover component (#373) * feat: add Popover component The scss use directive has to be added to vue.config.js because it has to be in front of all other rules. Co-authored-by: bereket-WMDE <71328938+bereket-WMDE@users.noreply.github.com> * Fix most rtl positioning issues Easiest would be to manually define two explicit rtl and ltr blocks to workaround transforms not being handled by postcss-logical, but that doesn't work because we're prefixing _everything_ with .wikit :/ So we need to figure out how to not rely on translateX and horizontally moved origins of transformation. * Fix alignment of horizontal center tooltips translateX isn't adjusted by postcss-logical, therefore we have to make use of flexbox also somewhat affecting its absolute positioned children. * Fix story layout remove debugging color and make headline be on its own line. * Change left to start and right to end for Popover This accounts for the Popover actually switching sides between ltr and rtl. * Set direction in story explicitly to fix Safari Co-authored-by: bereket-WMDE <71328938+bereket-WMDE@users.noreply.github.com> Co-authored-by: Michael Große <michael.grosse@wikimedia.de> Co-authored-by: bereket-WMDE <71328938+bereket-WMDE@users.noreply.github.com>
This will be implemented across multiple subtasks of T273041.
Bug: T273041