Add pop-open to the docked file index and improve scrolling behavior.
Review Request #12942 — Created April 6, 2023 and submitted
This change adds an expansion icon to the right of the file index when
it's docked into the review banner. Clicking this will temporarily
expand the entire index, allowing the user to quickly switch between
files without having to scroll back up to the top of the page. There's a
subtle animation when this is opened, though closing happens
immediately.This change also dramatically improves the behavior of scrolling when
anchors are clicked (filenames or chunk indicators in the file index) or
keyboard shortcuts are used to navigate. This is kind of tricky because
we have a lot of (literal) moving pieces--the page itself scrolls, and
the docked file index can change height. The height calculation inside
the file index has been exposed, and the page view runs the calculation
twice in order to dial in a good target scroll position.
- Exercised the expansion icon a fair bit. Verified that the animation
worked as expected and that the index was closed either when the icon
was clicked again or when the page was scrolled (including clicking on
an anchor to scroll to another part of the page). - Clicked on file index filenames and chunk indicators to scroll. Saw
that the page always scrolled such that the target index was displayed
a bit below the bottom of the banner, even when the banner was
significantly changing size depending on the new scroll viewport. - Went through all the diffviewer keyboard shortcuts and saw that files
and chunks were scrolled nicely. - Ran js-tests.
Summary | ID |
---|---|
a853f7d65c13fae2401aec0658bdd07ed177e963 |
Description | From | Last Updated |
---|---|---|
Instead of the hamburger menu icon, I prefer something that would change depending on whether the index is collapsed or … |
maubin | |
Should add documentation. |
maubin | |
Small nit but I think modifiers should be placed before any children in the component? Not sure if this is … |
maubin |
-
-
Instead of the hamburger menu icon, I prefer something that would change depending on whether the index is collapsed or expanded. Something like
v
and^
arrows, or maybe+
and-
icons like we have for other things that expand and collapse.I would be fine with keeping the hamburger though.
-
-
Small nit but I think modifiers should be placed before any children in the component? Not sure if this is an actual style rule that we follow but I feel like I've seen that around a lot.
- Commits:
-
Summary ID f49515ab652079e728a8561d711c37fd001d15f5 a853f7d65c13fae2401aec0658bdd07ed177e963 - Diff:
-
Revision 2 (+482 -174)