Page MenuHomePhorge

Comment anchor doesn't work properly due to loading of old comments
Open, Needs TriagePublic

Description

When linking to a comment (T1234#5678) which is not shown (behind the "Changes from before your most recent comment are hidden. Show Older Changes" text), Phabricator automatically loads the hidden comments (same as if you clicked on "Show Older Changes"). Sometimes it also loads the hidden comments when the linked comment is not in fact hidden, and then the page jumps because of the content getting loaded, so you end up not seeing the comment that was linked to.

Here is a screencast (it's choppy so not very obvious, but you can see what's happening if you go through it in slow motion; in reality it's slower so more confusing than the video would suggest):

Here are some screenshots:

First I see the comment correctly positioned...but then the content above it expands so I end up seeing this.
Screenshot from 2024-11-12 20-46-09.png (2×3 px, 411 KB)
Screenshot from 2024-11-12 20-46-59.png (2×3 px, 734 KB)

(The link in question is https://phabricator.wikimedia.org/T326925#10312900 but the comment hiding is personalized so you probably won't see the same effect.)

There are two things going wrong here:

  • The hidden comments should not be expanded. (This seems to happen when the linked comment is close to the cut between the hidden and visible comments; in this case I see one more comment above it. So probably an off-by-some error.)
  • When the hidden comments do get expanded, the anchor should be repositioned.

Event Timeline

I think that, after the hidden comment is loaded in its bulk, "some more comments" are loaded as context for the hidden comment 🤔 So I guess that extra loading is probably a feature and not a bug.

So if somebody can dig on this, I can suggest as approach to try to "focus" on that comment again after all startup loading. But don't take me too seriously, I'm just speculating lol