Make the file index dock into the unified banner.
Review Request #12941 — Created April 5, 2023 and submitted
One common request we've had over the years is to be able to know what
file is currently being viewed when scrolling through the diffviewer.
It's easy to lose track of the current file in the middle of a long
diff.This change makes it so the file list docks into the unified banner once
the user scrolls past it. The view there is filtered to show only the
entries corresponding to any diff file blocks visible in the current
viewport. There's a 50px buffer area at the top and bottom in which we
calculate a partial vertical offset and height so it looks like the file
list is scrolling along with the page.This does not yet allow users to pop open the entire file list in order
to quickly scroll to a specific file, but that's coming in a future
change.
Spent a ton of time scrolling around a large diff and verifying that the
docked file list looked correct. Paid particular attention to the
boundary at which we convert the file list from undocked -> docked and
vice-versa, and the boundaries where files were scrolling on or off the
page at both the top and bottom.
Summary | ID |
---|---|
0cb201a77b7aa1f294e9a757b254e4ad38205f98 |
Description | From | Last Updated |
---|---|---|
Could add some documentation for this component while you're here. |
maubin | |
Should documentation this new component and its child. |
maubin | |
I think this is supposed to say "The top of the diff entry..." |
maubin | |
Missing docs for the interface and members. |
chipx86 | |
We should probably also remove/clear all the other jQuery and map state, so we don't retain any references. |
chipx86 | |
This can be return super.remove(); |
chipx86 | |
This stays away even after remove(). We should listen to it with an ID incorporating this.cid and then stop listening … |
chipx86 | |
Can we do one type per line? |
chipx86 | |
Can we pull ou this.#$items before the look, so we don't have to re-fetch every iteration? |
chipx86 | |
Same comment about these variables. |
chipx86 | |
Is the Number just for typing? Do we not get this from .entries()? |
chipx86 | |
And these. |
chipx86 | |
Would it be worth asserting the result before returning? |
chipx86 | |
Maybe this is a good time to switch to our modern spinner class? djblets-o-spinner. |
chipx86 |
- Change Summary:
-
- Fixed ugly display when file entries were short (such as only one chunk).
- Added some bullet-proofing to properly handle changing diff/commit revisions and trying to scroll to anchors before everything is loaded.
- Commits:
-
Summary ID de8b86e30711ee03e9590972d26e8eae35c59063 e944cb5b737bdb68d212a9ac14ef1dab90afd51b - Diff:
-
Revision 2 (+754 -184)
Checks run (2 succeeded)
- Commits:
-
Summary ID e944cb5b737bdb68d212a9ac14ef1dab90afd51b 194026da2b7d0435aee35a7c1839ff9fa1b27ac9 - Diff:
-
Revision 3 (+786 -184)
Checks run (2 succeeded)
- Commits:
-
Summary ID 194026da2b7d0435aee35a7c1839ff9fa1b27ac9 0f29d703849787b4d1007a7dce67367c405864aa - Diff:
-
Revision 4 (+842 -184)
Checks run (2 succeeded)
- Commits:
-
Summary ID 0f29d703849787b4d1007a7dce67367c405864aa 0cb201a77b7aa1f294e9a757b254e4ad38205f98 - Diff:
-
Revision 5 (+842 -184)