The topic timeline doesn't open in certain browser widths if you have less than 3 posts

How to reproduce:

  1. Go to this page.
  2. Reduce your browser width until the topic-progress gauge appears:
  3. Click on the topic-progress gauge => The topic timeline doesn’t open

I believe the issue is caused by this code.

7 Likes

Can you repro this here on meta or on try.discourse.org?

I can repro it on Feverbee, but not here. It could be due to customizations they’ve made if we can’t repro it here.

6 Likes

You can reproduce it here:


(reduce the width, but not too much)

5 Likes

This is indeed a bug… if there are only 2 posts in the topic and you narrow down the screen it happens.

I agree it is likely the linked code is the culprit.

Link should remain stable given this is part of the seeded data.

4 Likes

Could you take a look at this one @joffreyjaffeux?

1 Like

So yes this code is responsible of it and it happens at some specific window to topic ratio height.

But what I fail to understand is, what is the expected behavior? I can just remove this check and it will work, but I guess we added this for a reason?

@eviltrout you made this initial feature https://github.com/discourse/discourse/commit/79763a6b97ae3d6c564f243e59e87b721da1ead4

Is this not valid anymore? is the formula wrong? I think it’s triggering here when the topic is not actually so huge, so maybe we should fix this?

Also I discovered that all suggested topics was used in in this topic height computation ${"#topic").css("background", "red"):

Maybe this is what changed since you made it.

6 Likes

Also maybe we should fix it sooner ? Why show topic progress in this case?

If it’s <= 3 post we hide topic-progress if posts.height < window.height * 1.5 ?

4 Likes

Originally the logic was meant to not bother showing a progress widget if the topic is really short, which I think still makes sense.

However, I was under the impression here that the bug is the widget IS showing up, but clicking it does not work. A suitable fix would be to have clicking work whenever it shows up. I’m cool keeping it hidden at other times (short topics.)

5 Likes

I wonder if we should just change the hide threshold to 1 at least on mobile / collapsed (or even remove this logic from mobile / collapsed)

On mobile even if you only have 2 posts, it helps a lot telling if you are on the first vs second

5 Likes

There’s a value to always displaying the timeline even on the desktop, e.g. if the post you’re reading doesn’t fit on a screen.

1 Like

That should fix it:

https://github.com/discourse/discourse/pull/9304

Details in commit.

7 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.