Timeline virtual scrolling #2310

Closed
shpuld wants to merge 49 commits from gitlab-mr-iid-1043 into develop
Member

This MR optimizes the amount of stuff in dom/v-dom a lot by simplifying the statuses that are not in view. This is most notable when observing RAM use while scrolling deep down and loading lots of statuses on the timeline that way. Not much of an impact you'll feel on high performance devices that run the application smooth enough already.

There aren't many notable downsides to the way it's done, as each Conversation/Status component is kept alive when they're hidden and they get to keep their state untouched. The biggest ones are:

  • Not being able to use ctrl-f on the full page because a lot of the text outside of view is hidden
  • When resizing, the calculated heights for hidden elements is going to be wrong and scrolling up the first time after that will be jerky.

There is an option to turn the feature off for those who encounter problems.

EDIT: after extended on my instance I've noticed some parts regarding the perf that I can improve

EDIT2: I haven't really been running into any issues with the latest version of this. Only positives making the FE more responsive especially on mobile.

This MR optimizes the amount of stuff in dom/v-dom a lot by simplifying the statuses that are not in view. This is most notable when observing RAM use while scrolling deep down and loading lots of statuses on the timeline that way. Not much of an impact you'll feel on high performance devices that run the application smooth enough already. There aren't many notable downsides to the way it's done, as each Conversation/Status component is kept alive when they're hidden and they get to keep their state untouched. The biggest ones are: - Not being able to use ctrl-f on the full page because a lot of the text outside of view is hidden - When resizing, the calculated heights for hidden elements is going to be wrong and scrolling up the first time after that will be jerky. There is an option to turn the feature off for those who encounter problems. EDIT: after extended on my instance I've noticed some parts regarding the perf that I can improve EDIT2: I haven't really been running into any issues with the latest version of this. Only positives making the FE more responsive especially on mobile.
Member

w

w
Author
Member

I don't know how I managed to do that w

I don't know how I managed to do that w

Is there anything to help with to get this into a mergeable state? Every time i tried it it was such a big improvement

Is there anything to help with to get this into a mergeable state? Every time i tried it it was such a big improvement
Author
Member

it's better now as I've tested a more fixed version, but I still need to investigate some browser specific issues, and maybe figure out how to make scrolling get fucky when you use the back button

it's better now as I've tested a more fixed version, but I still need to investigate some browser specific issues, and maybe figure out how to make scrolling get fucky when you use the back button

Going to a post directly does not display anything: https://shpposter.club/notice/9ygQmNndbd6Io8zrge

Going to a post directly does not display anything: https://shpposter.club/notice/9ygQmNndbd6Io8zrge
Author
Member

"this.status is undefined"

"this.status is undefined"
Member

i've seen something similar on regular (pre-2.1) builds too, not sure if it was same error tho

i've seen something similar on regular (pre-2.1) builds too, not sure if it was same error tho
Author
Member

it's not exact same, I see why it happens here and it's easy to fix, just need to do it

it's not exact same, I see why it happens here and it's easy to fix, just need to do it
Author
Member

fixed this last night (not yet deployed on shpc)

fixed this last night (not yet deployed on shpc)

can confirm it works again

can confirm it works again

I've been using this version on lain.com for the last few days and haven't encountered any issues anymore. Ready to go in, from my point of view.

I've been using this version on lain.com for the last few days and haven't encountered any issues anymore. Ready to go in, from my point of view.
Author
Member

just need actual code review then cc @hj

just need actual code review then cc @hj
Member

yeah, hopefully today/tomorrow

yeah, hopefully today/tomorrow
Member

Videos always loop initially even if they have sound and setting is set to NOT loop the videos with sound.

Videos always loop initially even if they have sound and setting is set to NOT loop the videos with sound.
Member

Scrolling sometimes feels a bit laggy at time, but switching timelines feels MUCH better, good job!

Scrolling sometimes feels a bit laggy at time, but switching timelines feels MUCH better, good job!
Member

i'd say there probably should be some throttle/debounce to when posts start load when scrolling into void area

i'd say there probably should be some throttle/debounce to when posts start load when scrolling into void area
Member

there's no setting in UI but setting exists in the code

there's no setting in UI but setting exists in the code
Member

This is intended, classes that begin with - are modifiers, RSCSS convention.

    :class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }]"
This is intended, classes that begin with `-` are modifiers, RSCSS convention. ```suggestion:-0+0 :class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }]" ```
Member

ew, flush after yourself my dude
e37e7e8154cc01f6c8a9d355af5de58a7a21583abdbb9287baf8486bb5dbc47d

ew, flush after yourself my dude ![e37e7e8154cc01f6c8a9d355af5de58a7a21583abdbb9287baf8486bb5dbc47d](/attachments/cd583046-3bf5-4cf8-8ade-a0fde3cbd9f6) ```suggestion:-0+0 ```
Member

this is the reason why videos always loop, and below too.

this is the reason why videos always loop, and below too.
Member

probably this.hasAudio !== undefined?

probably `this.hasAudio !== undefined`?
Member

at least i think

at least i think
Author
Member

it already has it throttled with 200ms, much more results in more visual glitching

it already has it throttled with 200ms, much more results in more visual glitching
Author
Member

merge casualty, fixing

merge casualty, fixing
Author
Member

it was something missing, had to manually change it to get it working at all, I'll look into it more, moving the status-conversation class under Status or something

it was something missing, had to manually change it to get it working at all, I'll look into it more, moving the `status-conversation` class under `Status` or something
Author
Member

uhh, looks like the whole thing is a CSS refactor casualty, there's not race of "-conversation" classes, I wonder what has broken...

uhh, looks like the whole thing is a CSS refactor casualty, there's not race of "-conversation" classes, I wonder what has broken...
Author
Member

the casualty is non-inline conversations having the red line, might fix that here.

the casualty is non-inline conversations having the red line, might fix that here.
Author
Member

there's major changes here to make it make more sense, note the change in name as well

it worked correct with all settings when I made it many many months ago, I'll check again what's up

there's major changes here to make it make more sense, note the change in name as well it worked correct with all settings when I made it many many months ago, I'll check again what's up
Author
Member

it cant be anything but true or false as it's always explicitly set to one of the two

it cant be anything but `true` or `false` as it's always explicitly set to one of the two
Author
Member

oh yeah now I remember some details about it

firefox is BROKEN AS HELL, it's not calling play or playing events. works fine in chromium

oh yeah now I remember some details about it firefox is BROKEN AS HELL, it's not calling play or playing events. works fine in chromium
Author
Member

never mind, it's being called, I was doing something wrong and it wasn't using my logged code

never mind, it's being called, I was doing something wrong and it wasn't using my logged code
Member

yeah but it seems like intention is to not run any code if hasAudio is set, this code will not execute if hasAudio is set to false

yeah but it seems like intention is to not run any code if **hasAudio is set**, this code will not execute if hasAudio is set to `false`
Author
Member

Ok, I tested all settings combinations with both sound/no-sound videos, everything works exactly like it should?

how do you get it to break on yours?

Ok, I tested all settings combinations with both sound/no-sound videos, everything works exactly like it should? how do you get it to break on yours?
Author
Member

I see what you mean, I'll fix it

I see what you mean, I'll fix it
Member

When post initially loaded video will ALWAYS loop. Switching relevant settings on and off fixes existing videos. Any new videos that load will still loop.

At least how it was for me yesterday.

When post initially loaded video will ALWAYS loop. Switching relevant settings on and off fixes existing videos. Any new videos that load will still loop. At least how it was for me yesterday.
Author
Member

actually no, it is how it should be, hasAudio is initialized to false, on first play we check if there's audio, if there is set it to true. A video can never lose its audio, so there's no point ever changing it once its set to true once.

EDIT: last true was false, fixed

actually no, it is how it should be, `hasAudio` is initialized to `false`, on first play we check if there's audio, if there is set it to `true`. A video can never lose its audio, so there's no point ever changing it once its set to `true` once. EDIT: last true was false, fixed
Author
Member

works for me on both firefox and chromium, tried refreshing and playing videos immediately as they show up

works for me on both firefox and chromium, tried refreshing and playing videos immediately as they show up
Author
Member

Added a comment about it to help reduce further confusion.

Added a comment about it to help reduce further confusion.
Member

https://shigusegubu.club/notice/9ynXaOsI10qwHM78M4 this fails and always loops.
https://shigusegubu.club/notice/9ynY1pm46xZvWdHgJM this works correctly.

Dunno why, but both start with loop="loop" but one that works has that attribute removed while the one that broken becomes loop=""

smells like a vue bug

https://shigusegubu.club/notice/9ynXaOsI10qwHM78M4 this fails and always loops. https://shigusegubu.club/notice/9ynY1pm46xZvWdHgJM this works correctly. Dunno why, but both start with `loop="loop"` but one that works has that attribute removed while the one that broken becomes `loop=""` smells like a vue bug
Member

consolelog-driven development has shown that in both cases they both properly detect audio

consolelog-driven development has shown that in both cases they both properly detect audio
Member

only happens on firefox (on that video at least) and not in chrome

only happens on firefox (on that video at least) and not in chrome
Member

Workaround to this is to set hasAudio to true initially and then reset it to false if no audio track is detected.

Workaround to this is to set `hasAudio` to `true` initially and then reset it to `false` if no audio track is detected.
Author
Member

that's interesting, I'm not against changing the ordering to start with true, but I'll investigate a bit more

that's interesting, I'm not against changing the ordering to start with true, but I'll investigate a bit more
Author
Member

the always looping video doesn't loop for me when I find it on laindotcom, I'll try setting my dev server to sgsgb

the always looping video doesn't loop for me when I find it on laindotcom, I'll try setting my dev server to sgsgb
Member

might not help either. I literally have no idea why it happens. Might be related to number of elements on page, i.e notifications.

at least it seems like vue is having problems removing the loop properly, so workaround where we add it instead seems reasonable.

man reporting this bug to vue is going to be ASS

might not help either. I literally have no idea why it happens. Might be related to number of elements on page, i.e notifications. at least it seems like vue is having problems removing the `loop` properly, so workaround where we *add* it instead seems reasonable. man reporting this bug to vue is going to be ASS
Author
Member

good point, that might explain why it breaks. I'll change the code and test that it works

good point, that might explain why it breaks. I'll change the code and test that it works
Author
Member

changed, looks like I didn't actually post the previous comment, thanks gitlab's useless review system

changed, looks like I didn't actually post the previous comment, thanks gitlab's useless review system
Member

I'm gonna dogfood it a bit on sgsgb. Last time it worked so good we can probably just enable it permanently.

I'm gonna dogfood it a bit on sgsgb. Last time it worked so good we can probably just enable it permanently.
Member

there are some CSS bugs, some of which might be in develop as well. I'd say no need to fix them in this MR, I'll fix them all in one swoop after this is merged.

there are some CSS bugs, some of which might be in develop as well. I'd say no need to fix them in this MR, I'll fix them all in one swoop after this is merged.
Member
  • Red stripe is missing in conversations
  • Avatar shadow is screwed [DEVELOP]
  • Emoji react popup is wider than putin
  • GIF indicator doesn't disappear on hover [DEVELOP]
* Red stripe is missing in conversations * Avatar shadow is screwed [DEVELOP] * Emoji react popup is wider than putin * GIF indicator doesn't disappear on hover [DEVELOP]
Author
Member

red stripe could be a theme bug, doesn't happen on my instance

red stripe could be a theme bug, doesn't happen on my instance
Author
Member

and neither does wide react popup..

and neither does wide react popup..
Member

wide react popup is related to lain's issue #922

either way i'll fix it all myself some time later.

wide react popup is related to lain's issue #922 either way i'll fix it all myself some time later.

Hit that merge button

Hit that merge button

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!2310
No description provided.