Page MenuHomePhabricator

File anchor links can load scrolled to the wrong file
Open, NormalPublic

Description

The PHUIFeedStoryExample.php link in the table of contents of D18050 links to D18050#5a5324e8. Pasting that link into a new browser page finds the browser pane scrolled to the middle of the PhabricatorFilesComposeAvatarExample.php file -- that is, scrolled too far down:

This seems to be due to lazy-loading of the file sections. Where the browser pane ends up centered seems to be a function of the height of the browser window; a smaller window finds me earlier, at PHUIHovercardUIExample.php, a taller one at PhabricatorNotificationUIExample.php.

This makes it hard to reference files in a diff out-of-band.

Event Timeline

Forgot to specify browser: this is Chrome 58.0.3029.110 (64-bit) on OS X and Linux. Also replicates on Safari 10.1.1 (12603.2.4).

T11997/T12032 look related, but not the same behavior.

Possibly fallout from T11784 / D17911, although those shouldn't really interact here unless there are other bugs.

epriestley triaged this task as Normal priority.

I think that got things closer but we aren't quite there yet. I'll poke at this a bit more tomorrow.

tomorrow

(This is still on my radar.)

This is still not working very well for me in Safari in production, although I don't seem to be able to break it in Chrome or Firefox anymore after a few tries.

Obviously, it works flawlessly every time in Safari locally.

Thanks for the fixes! Most folks are on Chrome at Dropbox, so Safari being subject to the Heisenprod Uncertainty Principle doesn't worry me much.