Disjointed popovers #2807

Closed
hj wants to merge 0 commits from gitlab-mr-iid-1540 into develop
Owner
  • Separates popovers from DOM hierarchy by teleporting them to a separate container
  • Uses position: fixed to position popovers. As a result, popovers are now forcibly hidden on scroll
  • Recaclculates popover position on scroll event. Works like a charm on desktop (sub 1ms per scroll update), a bit laggy but acceptable on firefox mobile, popover vibrates but follows the scroll on mobile chrome.
  • Fixes duplicate <button> elements on react/extra buttons
  • Uses vue transition to fix animations on popups/tooltips
  • Fixes shadows so that all popovers/tooltips have proper shadows, not just status popovers
  • Replaces ugly bootleg tooltips for mention links with floating usercards (on click)

Known issues

  • hide-on-scroll only works on main document scroll, not on column scroll. Now searches for nearby .column.-scrollable and falls back to using window otherwise
  • tests are likely fucked due to changes in mentionlinks stuff? yep. fucked. fixed now
  • performance needs testing/verification
    • when i get browserstack i can test ios, i expect it to be jank af but workable.
      • actually, performance is stellar, at least best i could tell, browserstack itself is pretty laggy tho, can't test thoroughly
    • maybe add advanced option to not do that in case it causes problems?
  • maybe it's too easy now to keep hover popover open?
  • popover position doesn't update when timeline moves, but wiring that into vuex/vue events might have performance consequences
- Separates popovers from DOM hierarchy by teleporting them to a separate container - Uses `position: fixed` to position popovers. ~~As a result, popovers are now forcibly hidden on scroll~~ - Recaclculates popover position on scroll event. Works like a charm on desktop (sub 1ms per scroll update), a bit laggy but acceptable on firefox mobile, popover vibrates but follows the scroll on mobile chrome. - Fixes duplicate `<button>` elements on react/extra buttons - Uses vue transition to fix animations on popups/tooltips - Fixes shadows so that all popovers/tooltips have proper shadows, not just status popovers - Replaces ugly bootleg tooltips for mention links with floating usercards (on click) ## Known issues - [x] ~~hide-on-scroll only works on main document scroll, not on column scroll.~~ Now searches for nearby `.column.-scrollable` and falls back to using `window` otherwise - [x] ~~tests are likely fucked due to changes in mentionlinks stuff? yep. fucked.~~ fixed now - [x] performance needs testing/verification - [x] when i get browserstack i can test ios, i expect it to be jank af but workable. - actually, performance is stellar, at least best i could tell, browserstack itself is pretty laggy tho, can't test thoroughly - [ ] maybe add advanced option to not do that in case it causes problems? - :grey_question: maybe it's too easy now to keep hover popover open? - :grey_question: popover position doesn't update when timeline moves, but wiring that into vuex/vue events might have performance consequences
Owner

Settings modal is under top bar
image

Settings modal is under top bar ![image](/attachments/3d4d7412-f719-423b-869f-59d6fbcd6993)
Owner

Timeline selector's style did not apply
image

Timeline selector's style did not apply ![image](/attachments/3ba352df-6011-45aa-87b5-c21ce6532d40)
Owner

Clicking on the avatar here should take me to the user page (same as before), not expanding the avatar
image

um. we lost the "click to expand, click to collapse" interaction as before. I think somehow the popover should show beside the original avatar.

Clicking on the avatar here should take me to the user page (same as before), not expanding the avatar ![image](/attachments/0fbdfe74-ef1c-4a25-b391-dcf0eefadfdc) um. we lost the "click to expand, click to collapse" interaction as before. I think somehow the popover should show beside the original avatar.
380 KiB
Owner

This option should no longer be hidden if we are showing full usernames, as it also applies there.

This option should no longer be hidden if we are showing full usernames, as it also applies there.
Owner

The user popover is not showing as intended on Staff page

image

The user popover is not showing as intended on Staff page ![image](/attachments/2194d98b-3090-45fb-b7e2-05e8f2ffde27)
Author
Owner

oh i didn't know this was a thing

oh i didn't know this was a thing
Author
Owner

could be made an option for showing beside, sure

also could make an option for selecting what clicking the avatar in popover does, i'll default it to old behavior

could be made an option for showing beside, sure also could make an option for selecting what clicking the avatar in popover does, i'll default it to old behavior
Owner

it's not used on Follow Requests either

it's not used on Follow Requests either
Owner
  1. Use mobile layout
  2. Open notification sidebar
  3. Click on "Add reactions"
  4. Scroll
  5. The reactions popover should scroll with it, but it actually does not.
0. Use mobile layout 0. Open notification sidebar 1. Click on "Add reactions" 2. Scroll 3. The reactions popover should scroll with it, but it actually does not.
Author
Owner

couldn't reproduce this one. screenshot/browser version?

couldn't reproduce this one. screenshot/browser version?
Author
Owner

made it an option to zoom avatar when clicking it in popover, by default clicking it closes the popover, should suffice for now I think

made it an option to zoom avatar when clicking it in popover, by default clicking it closes the popover, should suffice for now I think
Author
Owner

fixed

fixed
Author
Owner

fixed BasicUserCard

fixed BasicUserCard
Owner

sidebar navigator style should not change
image

sidebar navigator style should not change ![image](/attachments/a424f482-3232-48ee-aa45-a79d6e4b2439)
476 KiB
Owner

it didn't close for me: it goes to the user page instead

it didn't close for me: it goes to the user page instead
Owner

firefox 101.0.1 on GNU/Linux (Wayland)
image

firefox 101.0.1 on GNU/Linux (Wayland) ![image](/attachments/54bfde3d-9963-4bc9-b508-e066cd2c29fd)
770 KiB
Author
Owner

still can't reproduce, not even with browserstack

i noticed that it doesn't close when you close sidebar however.

still can't reproduce, not even with browserstack i noticed that it doesn't close when you close sidebar however.
Author
Owner

😔

:pensive:
Author
Owner

oh so it wasn't a fluke, i wonder what's up with that.

maybe i should refactor UserCard in general

oh so it wasn't a fluke, i wonder what's up with that. maybe i should refactor UserCard in general
Author
Owner

fixed

fixed
Author
Owner

Should be fixed now

Should be fixed now
Author
Owner

still not reproducible, could be on older version of it

still not reproducible, could be on older version of it
Owner

i think the timeline selector dropdown should be the same size as the one in the sidebar

currently it's too small and inaccessible

i think the timeline selector dropdown should be the same size as the one in the sidebar currently it's too small and inaccessible
Owner

image

![image](/attachments/414913fc-3c52-4a70-8c3c-b3950b24a74b)
1.3 MiB
Author
Owner

imo the main navigation is a bit overblown but I can increase the size in dropdown.

imo the main navigation is a bit overblown but I can increase the size in dropdown.
Owner

I don't think we should use icon colour for text

I don't think we should use icon colour for text
Owner

it makes it look really weird
image

it makes it look really weird ![image](/attachments/a420e60a-5c2c-4b08-a46f-05bacdbf11fc)
246 KiB
Author
Owner

i don't really know what color to use instead to show that it's interactible, i feel like link color would be even weirder

i don't really know what color to use instead to show that it's interactible, i feel like link color would be even weirder
Owner

In follow requests, when you have enough ones, clicking on the last one will make the popover go out of bounds, and it's impossible to scroll down
image

In follow requests, when you have enough ones, clicking on the last one will make the popover go out of bounds, and it's impossible to scroll down ![image](/attachments/def70b51-f895-4108-a809-a56757b7541f)
229 KiB
Owner

i feel we should use link colour for both inactive and active

i feel we should use link colour for both inactive and active
Author
Owner

oh, overlay mode doesn't respect window's bounds, gotta fix that

oh, overlay mode doesn't respect window's bounds, gotta fix that
Author
Owner

let's keep it like this and figure it out when we refactor and redesign user profile cards, they are weird right now all over the place tbh

let's keep it like this and figure it out when we refactor and redesign user profile cards, they are weird right now all over the place tbh
Owner

trying to invoke user popover in a status popover will cause both to disappear

trying to invoke user popover in a status popover will cause both to disappear
Owner

in current develop it shows the user card inside the status popover

in current develop it shows the user card inside the status popover
Author
Owner

fixed, now popovers are nudged vertically the same way it's done horizontally, it mostly affects overlay-centers popovers tho, doesn't seem to do anything for other popovers (good)

fixed, now popovers are nudged vertically the same way it's done horizontally, it mostly affects overlay-centers popovers tho, doesn't seem to do anything for other popovers (good)
Author
Owner

Should be fixed now. I implemented a popover stacking mechanism. Unfortunately vue's custom events don't bubble and native events probably won't do much good since popovers lack parent-child relationship in the DOM. Basically, when popover is mounted it will try to find a parent popover using this.$parent repeatedly until it finds one, then when it shows or hides itself it will inform the parent that its state changed, while parents will refuse to close if any children are open. It will also call onClickOutside in parent popovers so that when you click outside all of them the entire stack (or chunk of it) closes, otherwise it would need click for each popover in stack.

It's a bit hacky, i know, realistically we'd need bubbling custom events which is whole another topic that's way outside of scope of this MR since Vue doesn't support it.

And yes, this prevents on-hover popovers from closing if they have nested (on-click or on-hover) popovers open. This is sorta necessary as if some popover in a stack closes it unmounts the nested Popover component, closing the entire tree downstream, essentially.

Should be fixed now. I implemented a popover stacking mechanism. Unfortunately vue's custom events don't bubble and native events probably won't do much good since popovers lack parent-child relationship in the DOM. Basically, when popover is mounted it will try to find a parent popover using `this.$parent` repeatedly until it finds one, then when it shows or hides itself it will inform the parent that its state changed, while _parents will refuse to close if any children are open_. It will also call `onClickOutside` in parent popovers so that when you click outside all of them the entire stack (or chunk of it) closes, otherwise it would need click for each popover in stack. It's a bit hacky, i know, realistically we'd need bubbling custom events which is whole another topic that's way outside of scope of this MR since Vue doesn't support it. And yes, this prevents on-hover popovers from closing if they have nested (on-click or on-hover) popovers open. This is sorta necessary as if some popover in a stack closes it unmounts the nested Popover component, closing the entire tree downstream, essentially.
Owner

confirmed to be fixed

confirmed to be fixed
Owner

the status popover sometimes doesn't disappear properly

image

  1. Hover on Reply to
  2. Without mouse entering the popover, hover out of Reply to
  3. on develop, the popover disappears; now it doesn't
the status popover sometimes doesn't disappear properly ![image](/attachments/9228f2c7-d3a8-4726-b206-6a2cb8728848) 0. Hover on Reply to 1. Without mouse entering the popover, hover out of Reply to 2. on develop, the popover disappears; now it doesn't
482 KiB
Author
Owner

that was a typo, fixed now.

that was a typo, fixed now.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe!2807
No description provided.