Migrate all cases of @reach/tabs usage to Wildcard/Tabs
Created by: oleggromov
Context
This PR addresses https://github.com/sourcegraph/sourcegraph/issues/27734.
Tabs
component
Changes to the A few things had to be changed:
- Removed bottom border - because it doesn't exist in our designs
-
Made text for the- undone because was requested by Roblarge
variant use--text-muted
color in accordance with the design - Removed inner nested
div
insideTabs
and replaced it with passingclassName
anddata-testid
directly toReachTabs
. This is required because without that layout of the search sidebar, which is supposed to be 100% tall and have scrollbars, breaks. - Made
size
prop optional, default issmall
- since it's used most of the times assmall
. This is consistent with how Tabs component was used before as well. - Added
as
support toTabs
, as well as forwardingref
s for all Tab-related components -
@reach
styles import was moved toTabs.module.scss
Changes to Tabs use cases
- 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. - In
RepoRevisionSidebar.tsx
index was also used to emulate lazy-loading tabs, which is replaced with properlazy={true}
prop.
See the comments in the "Files changed" tab.
What pages/components are changed
Site Admin / Feedback Survey
1.Requires you to be logged in to k8s instance.
Before | After |
---|---|
Search reference in the sidebar
2.Before | After |
---|---|
Revisions section of the search sidebar
3.Before | After |
---|---|
RepoRevisionSidebar
4.Before | After |
---|---|
RevisionsPopover
5.Before | After |
---|---|
6. Devtools
Before | After |
---|---|
Batch Changes tabs - you have to be logged in to see these
7.Before | After |
---|---|
BlobPage bottom panel
8.Before | After |
---|---|