Skip to content

Conversation

@aditya0155
Copy link
Contributor

Pull Request Type

  • Bugfix

Related issue

Description

Fixes an unwanted auto-scroll behavior when loading comments. Previously, when a user expanded the video description, scrolled to the bottom, and then clicked "Load Comments," the page would automatically scroll down too far, causing the user to miss the first few comments.

Screenshots

Before :

Before_Linus.mp4

After:

After_linus.mp4

Before 2nd example:

Before_2.mp4

After 2nd example:

After_2.mp4

Testing

  • Go to a video e.g. https://youtu.be/g3FkuZNSGkw

  • Expand description

  • Scroll description to the bottom

  • Load comments

  • Check if the comment section starts from the 1st comment or not

  • 2nd -> check if community post comments are loading properly or not.

Desktop

  • OS: Windows 11
  • OS Version: Windows 11 24H2 (OS Build 26100.7171)
  • FreeTube version: 0.23.12

Additional context

  • Nothing special just I have tested it on multiple videos including community posts comment section for edge cases and I think the issue is resolved.

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 19, 2025 20:18
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 19, 2025
@aditya0155 aditya0155 closed this Nov 19, 2025
auto-merge was automatically disabled November 19, 2025 20:27

Pull request was closed

@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 19, 2025
@aditya0155 aditya0155 reopened this Nov 19, 2025
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 19, 2025 20:58
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 19, 2025
@efb4f5ff-1298-471a-8973-3d47447115dc

Haven't actually tested it yet but what I'm seeing from the after videos is that the sort by drop down and hide comments is out of view

@aditya0155
Copy link
Contributor Author

Haven't actually tested it yet but what I'm seeing from the after videos is that the sort by drop down and hide comments is out of view

sure I'll work on it to show "hide comments" and "sort by drop down"

auto-merge was automatically disabled November 22, 2025 00:50

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 22, 2025 00:50
@aditya0155
Copy link
Contributor Author

aditya0155 commented Nov 22, 2025

give me few days I'll try to make it more fluent than this to avoid the auto scroll up

Untitled_v2.mp4

@aditya0155
Copy link
Contributor Author

Okay I worked on this issue I got 2 solutions.

  • 1st version -> Clean and minimal code:

In the current behavior, when scrolling down the page, the recommendation sidebar keeps loading videos above the fold.

Because of this, whenever the user clicks “Click to View Comments”, the page expands downward more than expected.

To avoid a sudden “teleport” effect, I implemented a simple smooth scroll so the viewport moves back to the top of the comments section.

After_V1.mp4
  • One possible improvement:
    When comments are expanded, we could load additional recommendation videos so the right panel doesn’t leave an empty gap.
After_V1_90__of_the_times.mp4
  • as you can see from the above video this can be avoided if we don't put all the videos above the fold before expanding the videos by this we get smooth scroll down like this:

  • 2nd idea -> I also experimented with giving the sidebar its own scroll container.
    This avoids the empty-space issue entirely and gives minimal smooth scrolling down with no teleport every time comments expand.

But there is one major drawback: it adds a second scrollbar. Most users don’t scroll the recommendation videos separately, and they generally prefer scrolling the recommendations and comments together so it will might make user experience worse.

After_V2.mp4

I have committed the 1st version only but still added the video of v2 as a idea but users wont like it.

@efb4f5ff-1298-471a-8973-3d47447115dc

This isnt really any fault of you but this feels more like a workaround then addressing the root cause. The question is how can we address the root cause of this.

@PikachuEXE thoughts

@PikachuEXE
Copy link
Collaborator

Current implementation is to make left side sticky, so that it remains in viewport even when right side is scrolled down
So it looks like this initially (right side probably shorter due to lazy load
image

After scrolling to the bottom
image

After expanding comments while scrolled to the bottom
image

So with the current UX design it is expected to have this behaviour
Either

  • Use 1st version (but probably need a bit of adjustment, details below
  • Use 2nd version (changes UX which might not be desirable
  • Remove position: sticky but also lose access to expand comment when scrolled below

Generally I think if you don't want UX to be changed 1st one is better
However

  • Current implementation only jumps on comment load, not when I hide and re-expand the section
  • Should not jump on comment load when "Auto Load Next Page" enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Comments are being skipped when description is expanded

3 participants