Page MenuHomePhabricator

[web] Fix drawer higlight glitch

Authored by inka on Feb 9 2023, 2:19 AM.
Referenced Files
Unknown Object (File)
Tue, Feb 28, 2:54 AM
Unknown Object (File)
Fri, Feb 24, 6:33 PM
Unknown Object (File)
Fri, Feb 24, 5:37 PM
Unknown Object (File)
Tue, Feb 21, 2:46 PM
Unknown Object (File)
Tue, Feb 21, 11:07 AM
Unknown Object (File)
Mon, Feb 20, 8:06 AM
Unknown Object (File)
Mon, Feb 20, 1:30 AM
Unknown Object (File)
Feb 17 2023, 7:44 AM



In D6292 I made drawer items react based on the current tab, by having them fetch a Handler component type and get the right handler for the selected tab. In D6389 I added a isActive field to
handler object they obtain, that is used for determining which item is supposed to be higlighted. Then in D6363 I decided to have the drawer render two drawer item lists, and have one of them be
hidden, based on the current tab (two, becuse we have the same behaviour for all tabs but the Calendar tab). This means, that the items don't need to change the handler they use, because the list of
items is changed instead. Instead, they should get a Handler type from their parent, and always use the same one.

Not doing this was causing glitches when switching tabs

Test Plan

Rub web app, check that drawer items in different tabs are highlighted properly, and there is no glitching.

Diff Detail

rCOMM Comm
Lint Not Applicable
Tests Not Applicable

Event Timeline

inka edited the test plan for this revision. (Show Details)
inka requested review of this revision.Feb 9 2023, 2:33 AM

Fix error when expanding items

20 ↗(On Diff #22288)

Nit: typical pattern I've seen for this sort of thing is to keep Handler lowercase until the place in the code where you use it as a component. Then at that place, you can do something like:

const Handler = props.handler;
tomek added inline comments.
49–52 ↗(On Diff #22288)

This value never changes and is independent from the props, so we can consider it extracting from the component

This revision is now accepted and ready to land.Feb 10 2023, 2:11 AM