Page MenuHomePhabricator

[web] update sidebars modal to use new tabs component
ClosedPublic

Authored by ginsu on Jan 4 2024, 1:02 AM.
Tags
None
Referenced Files
F3246172: D10519.id35303.diff
Thu, Nov 14, 9:48 PM
F3246157: D10519.id35316.diff
Thu, Nov 14, 9:38 PM
F3245602: D10519.diff
Thu, Nov 14, 7:37 PM
Unknown Object (File)
Thu, Oct 31, 4:21 AM
Unknown Object (File)
Oct 11 2024, 12:02 AM
Unknown Object (File)
Oct 3 2024, 1:00 PM
Unknown Object (File)
Oct 3 2024, 1:00 PM
Unknown Object (File)
Oct 3 2024, 1:00 PM
Subscribers

Details

Summary

This diff updates the sidebars modal to use the new tab components. Since we decoupled the tabs from the tab content with this new tab component, the sidebars modal now needs to be responsible for rendering the correct tab content.

Depends on D10518

Test Plan

Please see the demo video below to confirm that there are no regressions

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: atul, inka.
ginsu requested review of this revision.Jan 4 2024, 1:20 AM

Some thoughts inline, but good to land as is.

web/modals/threads/sidebars/sidebars-modal.react.js
17–18

Since id isn't really a unique identifier for each tab item, could we just use re-use header?

47

Don't love the magic string, would've preferred some sort of enum thing... but probably fine for now.

59–62

Let's definitely memoize any container components to try to short-circuit re-renders.

This revision is now accepted and ready to land.Jan 4 2024, 12:49 PM
web/modals/threads/sidebars/sidebars-modal.react.js
17–18

I made the header field a type of React.Node. I did this so that if we ever wanted to add other elements to the header component we could just pass in a react component as the value of this field. I could imagine us wanting to put icons in the future or doing other things and I thought this would be the best way to make the tabs component as flexible/future proof as possible

47

FWIW flow will throw an error if this string does not match a value listed in SidebarTab type

Screenshot 2024-01-05 at 3.03.55 PM.png (484×1 px, 121 KB)

address comments + rebase before landing