Skip to content

Migrate all cases of @reach/tabs usage to Wildcard/Tabs

Administrator requested to merge og/migrate-wildcard-tabs into main

Created by: oleggromov

Context

This PR addresses https://github.com/sourcegraph/sourcegraph/issues/27734.

Changes to the Tabs component

A few things had to be changed:

  1. Removed bottom border - because it doesn't exist in our designs
  2. Made text for the large variant use --text-muted color in accordance with the design - undone because was requested by Rob
  3. Removed inner nested div inside Tabs and replaced it with passing className and data-testid directly to ReachTabs. This is required because without that layout of the search sidebar, which is supposed to be 100% tall and have scrollbars, breaks.
  4. Made size prop optional, default is small - since it's used most of the times as small. This is consistent with how Tabs component was used before as well.
  5. Added as support to Tabs, as well as forwarding refs for all Tab-related components
  6. @reach styles import was moved to Tabs.module.scss

Changes to Tabs use cases

  1. In many places, we controlled the component from outside by providing index prop. The real intention of that was to persist the last selection, so I changed the code accordingly.
  2. In RepoRevisionSidebar.tsx index was also used to emulate lazy-loading tabs, which is replaced with proper lazy={true} prop.

See the comments in the "Files changed" tab.

What pages/components are changed

1. Site Admin / Feedback Survey

Requires you to be logged in to k8s instance.

Before After
Screenshot 2022-01-19 at 18 56 15 Screenshot 2022-01-19 at 18 56 45

2. Search reference in the sidebar

Before After
Screenshot 2022-01-19 at 18 59 21 Screenshot 2022-01-19 at 19 00 20

3. Revisions section of the search sidebar

Before After
Screenshot 2022-01-19 at 19 03 14 Screenshot 2022-01-19 at 19 03 28

4. RepoRevisionSidebar

Before After
Screenshot 2022-01-19 at 19 06 18 Screenshot 2022-01-19 at 19 06 33

5. RevisionsPopover

Before After
Screenshot 2022-01-19 at 19 09 06 Screenshot 2022-01-19 at 19 09 24

6. Devtools

Before After
Screenshot 2022-01-19 at 19 11 05 Screenshot 2022-01-19 at 19 11 14

7. Batch Changes tabs - you have to be logged in to see these

Before After
Screenshot 2022-01-27 at 16 30 09 Screenshot 2022-01-27 at 16 28 50

8. BlobPage bottom panel

Before After
Screenshot 2022-01-27 at 16 56 09 Screenshot 2022-01-27 at 16 56 29

Merge request reports

Loading