@@ -2,11 +2,10 @@ import type { Dispatch, SetStateAction } from "react";
2
2
import { useState } from "react" ;
3
3
import { styled } from "styled-components" ;
4
4
import {
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" ;
10
9
import { formatDecimal } from "../../common/number" ;
11
10
import type {
12
11
VariantAnalysis ,
@@ -21,6 +20,7 @@ import type { RepositoriesFilterSortState } from "../../variant-analysis/shared/
21
20
import { RepositoriesSearchSortRow } from "./RepositoriesSearchSortRow" ;
22
21
import { FailureReasonAlert } from "./FailureReasonAlert" ;
23
22
import { ResultFormat } from "../../variant-analysis/shared/variant-analysis-result-format" ;
23
+ import { Badge } from "../common/Badge" ;
24
24
25
25
export type VariantAnalysisOutcomePanelProps = {
26
26
variantAnalysis : VariantAnalysis ;
@@ -34,8 +34,27 @@ export type VariantAnalysisOutcomePanelProps = {
34
34
setFilterSortState : Dispatch < SetStateAction < RepositoriesFilterSortState > > ;
35
35
} ;
36
36
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 ) `
38
46
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;
39
58
` ;
40
59
41
60
const WarningsContainer = styled . div `
@@ -154,33 +173,33 @@ export const VariantAnalysisOutcomePanels = ({
154
173
onResultFormatChange = { setResultFormat }
155
174
variantAnalysisQueryKind = { variantAnalysis . query . kind }
156
175
/>
157
- < VSCodePanels >
176
+ < Tabs >
158
177
{ scannedReposCount > 0 && (
159
- < Tab >
178
+ < TabHeader >
160
179
Analyzed
161
- < VscodeBadge appearance = "secondary" >
180
+ < Badge appearance = "secondary" variant = "counter ">
162
181
{ formatDecimal ( variantAnalysis . scannedRepos ?. length ?? 0 ) }
163
- </ VscodeBadge >
164
- </ Tab >
182
+ </ Badge >
183
+ </ TabHeader >
165
184
) }
166
185
{ notFoundRepos ?. repositoryCount && (
167
- < Tab >
186
+ < TabHeader >
168
187
No access
169
- < VscodeBadge appearance = "secondary" >
188
+ < Badge appearance = "secondary" variant = "counter ">
170
189
{ formatDecimal ( notFoundRepos . repositoryCount ) }
171
- </ VscodeBadge >
172
- </ Tab >
190
+ </ Badge >
191
+ </ TabHeader >
173
192
) }
174
193
{ noCodeqlDbRepos ?. repositoryCount && (
175
- < Tab >
194
+ < TabHeader >
176
195
No database
177
- < VscodeBadge appearance = "secondary" >
196
+ < Badge appearance = "secondary" variant = "counter ">
178
197
{ formatDecimal ( noCodeqlDbRepos . repositoryCount ) }
179
- </ VscodeBadge >
180
- </ Tab >
198
+ </ Badge >
199
+ </ TabHeader >
181
200
) }
182
201
{ scannedReposCount > 0 && (
183
- < VSCodePanelView >
202
+ < TabPanel >
184
203
< VariantAnalysisAnalyzedRepos
185
204
variantAnalysis = { variantAnalysis }
186
205
repositoryStates = { repositoryStates }
@@ -190,29 +209,29 @@ export const VariantAnalysisOutcomePanels = ({
190
209
selectedRepositoryIds = { selectedRepositoryIds }
191
210
setSelectedRepositoryIds = { setSelectedRepositoryIds }
192
211
/>
193
- </ VSCodePanelView >
212
+ </ TabPanel >
194
213
) }
195
214
{ notFoundRepos ?. repositoryCount && (
196
- < VSCodePanelView >
215
+ < TabPanel >
197
216
< VariantAnalysisSkippedRepositoriesTab
198
217
alertTitle = "No access"
199
218
alertMessage = "The following repositories can't be analyzed because they don’t exist or you don’t have access."
200
219
skippedRepositoryGroup = { notFoundRepos }
201
220
filterSortState = { filterSortState }
202
221
/>
203
- </ VSCodePanelView >
222
+ </ TabPanel >
204
223
) }
205
224
{ noCodeqlDbRepos ?. repositoryCount && (
206
- < VSCodePanelView >
225
+ < TabPanel >
207
226
< VariantAnalysisSkippedRepositoriesTab
208
227
alertTitle = "No CodeQL database"
209
228
alertMessage = "The following repositories can't be analyzed because they don't currently have a CodeQL database available for the selected language."
210
229
skippedRepositoryGroup = { noCodeqlDbRepos }
211
230
filterSortState = { filterSortState }
212
231
/>
213
- </ VSCodePanelView >
232
+ </ TabPanel >
214
233
) }
215
- </ VSCodePanels >
234
+ </ Tabs >
216
235
</ >
217
236
) ;
218
237
} ;
0 commit comments