@@ -2,11 +2,10 @@ import type { Dispatch, SetStateAction } from "react";
22import { useState } from "react" ;
33import { styled } from "styled-components" ;
44import {
5- VSCodePanels ,
6- VSCodePanelTab ,
7- VSCodePanelView ,
8- } from "@vscode/webview-ui-toolkit/react" ;
9- import { VscodeBadge } from "@vscode-elements/react-elements" ;
5+ VscodeTabHeader ,
6+ VscodeTabPanel ,
7+ VscodeTabs ,
8+ } from "@vscode-elements/react-elements" ;
109import { formatDecimal } from "../../common/number" ;
1110import type {
1211 VariantAnalysis ,
@@ -21,6 +20,7 @@ import type { RepositoriesFilterSortState } from "../../variant-analysis/shared/
2120import { RepositoriesSearchSortRow } from "./RepositoriesSearchSortRow" ;
2221import { FailureReasonAlert } from "./FailureReasonAlert" ;
2322import { ResultFormat } from "../../variant-analysis/shared/variant-analysis-result-format" ;
23+ import { Badge } from "../common/Badge" ;
2424
2525export type VariantAnalysisOutcomePanelProps = {
2626 variantAnalysis : VariantAnalysis ;
@@ -34,8 +34,27 @@ export type VariantAnalysisOutcomePanelProps = {
3434 setFilterSortState : Dispatch < SetStateAction < RepositoriesFilterSortState > > ;
3535} ;
3636
37- const Tab = styled ( VSCodePanelTab ) `
37+ const Tabs = styled ( VscodeTabs ) `
38+ column-gap: 32px;
39+
40+ > vscode-tab-header {
41+ margin-right: 32px;
42+ }
43+ ` ;
44+
45+ const TabHeader = styled ( VscodeTabHeader ) `
3846 text-transform: uppercase;
47+
48+ > * {
49+ // This copies the styles from VSCodePanelTab
50+ &:last-child {
51+ margin-left: 8px;
52+ }
53+ }
54+ ` ;
55+
56+ const TabPanel = styled ( VscodeTabPanel ) `
57+ padding: 10px 6px;
3958` ;
4059
4160const WarningsContainer = styled . div `
@@ -154,33 +173,33 @@ export const VariantAnalysisOutcomePanels = ({
154173 onResultFormatChange = { setResultFormat }
155174 variantAnalysisQueryKind = { variantAnalysis . query . kind }
156175 />
157- < VSCodePanels >
176+ < Tabs >
158177 { scannedReposCount > 0 && (
159- < Tab >
178+ < TabHeader >
160179 Analyzed
161- < VscodeBadge appearance = "secondary" >
180+ < Badge appearance = "secondary" variant = "counter ">
162181 { formatDecimal ( variantAnalysis . scannedRepos ?. length ?? 0 ) }
163- </ VscodeBadge >
164- </ Tab >
182+ </ Badge >
183+ </ TabHeader >
165184 ) }
166185 { notFoundRepos ?. repositoryCount && (
167- < Tab >
186+ < TabHeader >
168187 No access
169- < VscodeBadge appearance = "secondary" >
188+ < Badge appearance = "secondary" variant = "counter ">
170189 { formatDecimal ( notFoundRepos . repositoryCount ) }
171- </ VscodeBadge >
172- </ Tab >
190+ </ Badge >
191+ </ TabHeader >
173192 ) }
174193 { noCodeqlDbRepos ?. repositoryCount && (
175- < Tab >
194+ < TabHeader >
176195 No database
177- < VscodeBadge appearance = "secondary" >
196+ < Badge appearance = "secondary" variant = "counter ">
178197 { formatDecimal ( noCodeqlDbRepos . repositoryCount ) }
179- </ VscodeBadge >
180- </ Tab >
198+ </ Badge >
199+ </ TabHeader >
181200 ) }
182201 { scannedReposCount > 0 && (
183- < VSCodePanelView >
202+ < TabPanel >
184203 < VariantAnalysisAnalyzedRepos
185204 variantAnalysis = { variantAnalysis }
186205 repositoryStates = { repositoryStates }
@@ -190,29 +209,29 @@ export const VariantAnalysisOutcomePanels = ({
190209 selectedRepositoryIds = { selectedRepositoryIds }
191210 setSelectedRepositoryIds = { setSelectedRepositoryIds }
192211 />
193- </ VSCodePanelView >
212+ </ TabPanel >
194213 ) }
195214 { notFoundRepos ?. repositoryCount && (
196- < VSCodePanelView >
215+ < TabPanel >
197216 < VariantAnalysisSkippedRepositoriesTab
198217 alertTitle = "No access"
199218 alertMessage = "The following repositories can't be analyzed because they don’t exist or you don’t have access."
200219 skippedRepositoryGroup = { notFoundRepos }
201220 filterSortState = { filterSortState }
202221 />
203- </ VSCodePanelView >
222+ </ TabPanel >
204223 ) }
205224 { noCodeqlDbRepos ?. repositoryCount && (
206- < VSCodePanelView >
225+ < TabPanel >
207226 < VariantAnalysisSkippedRepositoriesTab
208227 alertTitle = "No CodeQL database"
209228 alertMessage = "The following repositories can't be analyzed because they don't currently have a CodeQL database available for the selected language."
210229 skippedRepositoryGroup = { noCodeqlDbRepos }
211230 filterSortState = { filterSortState }
212231 />
213- </ VSCodePanelView >
232+ </ TabPanel >
214233 ) }
215- </ VSCodePanels >
234+ </ Tabs >
216235 </ >
217236 ) ;
218237} ;
0 commit comments