ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / test / browser / parts / activitybar / activitybarPart.test.ts 703 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
import assert from 'assert' ;
import { DisposableStore } from '../../../../../base/common/lifecycle.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js' ;
import { TestConfigurationService } from '../../../../../platform/configuration/test/common/testConfigurationService.js' ;
import { TestColorTheme, TestThemeService } from '../../../../../platform/theme/test/common/testThemeService.js' ;
import { TestStorageService } from '../../../common/workbenchTestServices.js' ;
import { TestHostService, TestLayoutService } from '../../workbenchTestServices.js' ;
import ActivitybarPart ActivityBarCompositeBar
IViewSize
LayoutSettings ModernUIDensity Parts Position
mainWindow
IConfigurationChangeEvent
IPaneCompositePart
IPaneCompositeBarOptions
Event Emitter
IPaneComposite
Extensions PaneCompositeDescriptor
IInstantiationService
ViewContainerLocation
ActionsOrientation
Dimension
menuBarContainer HTMLElement
globalCompositeBar element HTMLElement
options orientation ActionsOrientation
compositeBar dimension Dimension
activityBarCompositeBarLayout Reflect ActivityBarCompositeBar prototype ILayoutTestHarness width height
_serviceBrand
partId Parts
registryId Extensions Viewlets
element HTMLElement
minimumWidth
maximumWidth
minimumHeight
maximumHeight
onDidChange Event None
onDidPaneCompositeOpen event
onDidPaneCompositeClose event
IPaneComposite
PaneCompositeDescriptor
PaneCompositeDescriptor
IPaneComposite
floatingPanelsEnabled
modernUICompact
sideBarPosition Position
override floatingPanelsEnabled
override modernUICompact
override Position sideBarPosition
disposables
fixture HTMLElement
fixtureId
fixture document
fixture id fixtureId
mainWindow document body fixture
fixture
disposables
compact floatingPanelsEnabled sideBarPosition Position colors id modernUICompact instantiationService IInstantiationService part ActivitybarPart configService TestConfigurationService layoutService TestFloatingPanelsLayoutService hostService TestHostService
configService
LayoutSettings compact
LayoutSettings floatingPanelsEnabled
LayoutSettings modernUICompact ModernUIDensity Compact ModernUIDensity Default
storageService disposables
themeService colors
layoutService
hostService
layoutService floatingPanelsEnabled floatingPanelsEnabled
layoutService modernUICompact modernUICompact
layoutService sideBarPosition sideBarPosition
layoutService _part Parts
stubInstantiationService instantiationService IInstantiationService
part disposables
ViewContainerLocation Sidebar
stubInstantiationService
layoutService
themeService
storageService
configService
hostService
part configService layoutService hostService
configService TestConfigurationService key
configService onDidChangeConfigurationEmitter
k k key
satisfies Partial IConfigurationChangeEvent IConfigurationChangeEvent
assert
width ActivitybarPart
actionHeight ActivitybarPart
iconSize ActivitybarPart
width
actionHeight
iconSize
assert
width ActivitybarPart
actionHeight ActivitybarPart
iconSize ActivitybarPart
width
actionHeight
iconSize
assert
width ActivitybarPart
actionHeight ActivitybarPart
compactWidth ActivitybarPart
width
actionHeight
compactWidth
part
assert
min part minimumWidth max part maximumWidth
min ActivitybarPart max ActivitybarPart
part
assert
min part minimumWidth max part maximumWidth
min ActivitybarPart max ActivitybarPart
part
assert part minimumHeight
assert part maximumHeight Number
base ActivitybarPart ActivitybarPart ActivitybarPart
withLeadingGap base ActivitybarPart
sideBarPosition Position sideBarVisible modernUICompact
part layoutService sideBarPosition modernUICompact
layoutService partId Parts partId Parts sideBarVisible
part minimumWidth
assert
left Position
leftCollapsed Position
right Position
rightCollapsed Position
compactRightCollapsed Position
left base
leftCollapsed base
right base
rightCollapsed withLeadingGap
compactRightCollapsed ActivitybarPart ActivitybarPart
part Position
assert
min part minimumWidth max part maximumWidth
min ActivitybarPart ActivitybarPart
max ActivitybarPart ActivitybarPart
part configService
assert part minimumWidth ActivitybarPart
configService LayoutSettings
configService LayoutSettings
assert
min part minimumWidth max part maximumWidth
min ActivitybarPart max ActivitybarPart
configService LayoutSettings
configService LayoutSettings
assert
min part minimumWidth max part maximumWidth
min ActivitybarPart max ActivitybarPart
part configService
events IViewSize
disposables part e events e
configService LayoutSettings
configService LayoutSettings
assert events length
assert events
configService LayoutSettings
configService LayoutSettings
assert events length
assert events
part configService
events IViewSize
disposables part e events e
configService
assert events length
part configService layoutService
events IViewSize
disposables part e events e
layoutService floatingPanelsEnabled
configService LayoutSettings
configService LayoutSettings
assert events
assert part minimumWidth ActivitybarPart ActivitybarPart ActivitybarPart
part configService layoutService
events IViewSize
disposables part e events e
layoutService modernUICompact
configService LayoutSettings ModernUIDensity Compact
configService LayoutSettings
assert
events
minimumWidth part minimumWidth
events
minimumWidth ActivitybarPart
part
el document
fixture el
part el
assert el style
assert el style
assert el style
assert el style
assert el classList
part
el document
fixture el
part el
assert el style
assert el style
assert el style
assert el style
assert el classList
part
el document
fixture el
part el
assert el style
assert el style
assert el style
assert el style
assert el classList
part Position
element document
fixture element
part element
assert
width element style
actionHeight element style
iconSize element style
width
actionHeight
iconSize
part configService
el document
fixture el
part el
assert el style
assert el classList
configService LayoutSettings
configService LayoutSettings
assert el style
assert el style
assert el style
assert el classList
configService LayoutSettings
configService LayoutSettings
assert el style
assert el style
assert el style
assert el classList
floatingPanelsEnabled
part floatingPanelsEnabled Position
el document
fixture el
part el
inlineBorderColor el style borderColor bordered el classList
assert
modern
classic
modern inlineBorderColor bordered
classic inlineBorderColor bordered
part configService hostService Position
el document
fixture el
part el
activeModernBackground el style backgroundColor
hostService
inactiveModernBackground el style backgroundColor
configService LayoutSettings
configService LayoutSettings
assert
activeModernBackground
inactiveModernBackground
inactiveClassicBackground el style backgroundColor
activeModernBackground
inactiveModernBackground
inactiveClassicBackground
part
assert part type Parts
visibleParts Parts floatingPanelsEnabled modernUICompact
part layoutService floatingPanelsEnabled Position modernUICompact
el document
fixture el
part el
visible visibleParts
layoutService partId Parts visible partId
part
content el
content style height
margin ActivitybarPart
outerMargin ActivitybarPart
borders ActivitybarPart
actual
titleAndStatusBarVisible Parts Parts
titleBarHidden Parts
bannerInsteadOfTitleBar Parts Parts
statusBarHidden Parts
bothEdgesExposed
floatingPanelsDisabled
assert actual
titleAndStatusBarVisible margin borders
titleBarHidden outerMargin margin borders
bannerInsteadOfTitleBar margin borders
statusBarHidden outerMargin borders
bothEdgesExposed outerMargin borders
floatingPanelsDisabled
outerMargin
borders ActivitybarPart
assert
titleAndStatusBarVisible Parts Parts
titleBarHidden Parts
statusBarHidden Parts
bothEdgesExposed
titleAndStatusBarVisible outerMargin borders
titleBarHidden outerMargin borders
statusBarHidden outerMargin borders
bothEdgesExposed outerMargin borders
compact floatingPanelsEnabled modernUICompact IPaneCompositeBarOptions
captured IPaneCompositeBarOptions
stubCompositeBar
part compact floatingPanelsEnabled Position modernUICompact
_descriptor _location options IPaneCompositeBarOptions
captured options
stubCompositeBar
IInstantiationService
el document
fixture el
part el
part
captured
compact floatingPanelsEnabled modernUICompact
compositeSize overflowActionSize compact floatingPanelsEnabled modernUICompact
compositeSize overflowActionSize
assert
classicDefault
classicCompact
modernDefault
modernCompact
modernCompactDensity
classicDefault compositeSize overflowActionSize
classicCompact compositeSize overflowActionSize
modernDefault compositeSize overflowActionSize
modernCompact compositeSize overflowActionSize
modernCompactDensity compositeSize overflowActionSize
compact floatingPanelsEnabled
layoutHeight
stubCompositeBar
_width height layoutHeight height
part layoutService compact floatingPanelsEnabled Position
stubCompositeBar
IInstantiationService
el document
fixture el
part el
part
visible Parts Parts
layoutService partId Parts visible partId
part
layoutHeight
margin ActivitybarPart
borders ActivitybarPart
assert
classicDefault
classicCompact
modernDefault
modernCompact
classicDefault
classicCompact
modernDefault margin borders ActivitybarPart
modernCompact margin borders
globalActionCount itemHeight gap
globalBarElement document
i i globalActionCount i
item document
item style height
i
item style marginTop
globalBarElement item
fixture globalBarElement
laidOut Dimension
menuBarContainer
globalCompositeBar element globalBarElement
options orientation ActionsOrientation
compositeBar dimension laidOut dimension
ActivitybarPart
laidOut height
gap ActivitybarPart
itemHeight ActivitybarPart
assert
oneGlobalAction itemHeight gap
twoGlobalActions itemHeight gap
oneGlobalAction itemHeight
twoGlobalActions itemHeight gap
{
,
}
from
'../../../../browser/parts/activitybar/activitybarPart.js'
;
import
{
}
from
'../../../../../base/browser/ui/grid/grid.js'
;
import
{
COMPACT_FLOATING_PANEL_OUTER_MARGIN
,
,
,
,
}
from
'../../../../services/layout/browser/layoutService.js'
;
import
{
}
from
'../../../../../base/browser/window.js'
;
import
{
}
from
'../../../../../platform/configuration/common/configuration.js'
;
import
{
}
from
'../../../../browser/parts/paneCompositePart.js'
;
import
{
}
from
'../../../../browser/parts/paneCompositeBar.js'
;
import
{
,
}
from
'../../../../../base/common/event.js'
;
import
{
}
from
'../../../../common/panecomposite.js'
;
import
{
,
}
from
'../../../../browser/panecomposite.js'
;
import
{
}
from
'../../../../../platform/instantiation/common/instantiation.js'
;
import
{
}
from
'../../../../common/views.js'
;
import
{
ACTIVITY_BAR_BACKGROUND
,
ACTIVITY_BAR_BORDER
,
MODERN_ACTIVITY_BAR_BACKGROUND
,
MODERN_ACTIVITY_BAR_INACTIVE_BACKGROUND
}
from
'../../../../common/theme.js'
;
import
{
}
from
'../../../../../base/browser/ui/actionbar/actionbar.js'
;
import
{
}
from
'../../../../../base/browser/dom.js'
;
interface
ILayoutTestHarness
{
:
|
undefined
;
:
{
:
}
|
undefined
;
:
{
:
}
;
:
{
layout
:
(
:
)
=>
void
}
;
}
const
=
.
get
(
.
,
'layout'
)
as
(
this
:
,
:
number
,
:
number
)
=>
void
;
class
StubPaneCompositePart
implements
IPaneCompositePart
{
declare
readonly
:
undefined
;
readonly
=
.
SIDEBAR_PART
;
readonly
=
.
;
:
=
undefined
!
;
=
0
;
=
0
;
=
0
;
=
0
;
=
.
;
=
new
Emitter< IPaneComposite>
(
)
.
;
=
new
Emitter< IPaneComposite>
(
)
.
;
openPaneComposite
(
)
:
Promise
<
|
undefined
>
{
return
Promise
.
resolve
(
undefined
)
;
}
getPaneComposites
(
)
:
[
]
{
return
[
]
;
}
getPaneComposite
(
)
:
|
undefined
{
return
undefined
;
}
getActivePaneComposite
(
)
:
|
undefined
{
return
undefined
;
}
getProgressIndicator
(
)
{
return
undefined
;
}
hideActivePaneComposite
(
)
:
void
{
}
getLastActivePaneCompositeId
(
)
:
string
{
return
''
;
}
getPinnedPaneCompositeIds
(
)
:
string
[
]
{
return
[
]
;
}
getVisiblePaneCompositeIds
(
)
:
string
[
]
{
return
[
]
;
}
getPaneCompositeIds
(
)
:
string
[
]
{
return
[
]
;
}
layout
(
)
:
void
{
}
dispose
(
)
:
void
{
}
}
class
TestFloatingPanelsLayoutService
extends
TestLayoutService
{
=
false
;
=
false
;
=
.
LEFT
;
isFloatingPanelsEnabled
(
)
:
boolean
{
return
this
.
;
}
isModernUICompact
(
)
:
boolean
{
return
this
.
;
}
getSideBarPosition
(
)
:
{
return
this
.
;
}
}
suite
(
'ActivitybarPart'
,
(
)
=>
{
const
=
new
DisposableStore
(
)
;
let
:
;
const
=
'activitybar-part-fixture'
;
setup
(
(
)
=>
{
=
.
createElement
(
'div'
)
;
.
=
;
.
.
.
appendChild
(
)
;
}
)
;
teardown
(
(
)
=>
{
.
remove
(
)
;
.
clear
(
)
;
}
)
;
function
createActivitybarPart
(
:
boolean
,
=
false
,
=
.
LEFT
,
:
{
[
:
string
]
:
string
|
undefined
}
=
{
}
,
=
false
,
?
:
)
:
{
:
;
:
;
:
;
:
}
{
const
=
new
TestConfigurationService
(
{
[
.
ACTIVITY_BAR_COMPACT
]
:
,
[
.
MODERN_UI
]
:
,
[
.
MODERN_UI_DENSITY
]
:
?
.
:
.
,
}
)
;
const
=
.
add
(
new
TestStorageService
(
)
)
;
const
=
new
TestThemeService
(
new
TestColorTheme
(
)
)
;
const
=
new
TestFloatingPanelsLayoutService
(
)
;
const
=
new
TestHostService
(
)
;
.
=
;
.
=
;
.
=
;
.
isVisible
=
(
:
)
=>
false
;
const
=
??
{
createInstance
:
(
)
=>
{
throw
new
Error
(
'not expected'
)
;
}
}
as
unknown
as
;
const
=
.
add
(
new
ActivitybarPart
(
.
,
new
StubPaneCompositePart
(
)
,
,
,
,
,
,
,
)
)
;
return
{
,
,
,
}
;
}
function
fireConfigChange
(
:
,
:
string
)
:
void
{
.
.
fire
(
{
affectsConfiguration
:
(
:
string
)
=>
===
,
}
<
>
as
unknown
as
)
;
}
test
(
'default constants match expected dimensions'
,
(
)
=>
{
.
deepStrictEqual
(
{
:
.
ACTIVITYBAR_WIDTH
,
:
.
ACTION_HEIGHT
,
:
.
ICON_SIZE
,
}
,
{
:
48
,
:
48
,
:
24
,
}
)
;
}
)
;
test
(
'compact constants match reduced dimensions'
,
(
)
=>
{
.
deepStrictEqual
(
{
:
.
COMPACT_ACTIVITYBAR_WIDTH
,
:
.
COMPACT_ACTION_HEIGHT
,
:
.
COMPACT_ICON_SIZE
,
}
,
{
:
36
,
:
28
,
:
16
,
}
)
;
}
)
;
test
(
'floating constants are narrower than default'
,
(
)
=>
{
.
deepStrictEqual
(
{
:
.
FLOATING_ACTIVITYBAR_WIDTH
,
:
.
FLOATING_ACTION_HEIGHT
,
:
.
FLOATING_COMPACT_ACTIVITYBAR_WIDTH
,
}
,
{
:
36
,
:
36
,
:
28
,
}
)
;
}
)
;
test
(
'default mode returns default width constraints'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
}
,
{
:
.
ACTIVITYBAR_WIDTH
,
:
.
ACTIVITYBAR_WIDTH
}
)
;
}
)
;
test
(
'compact mode returns compact width constraints'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
true
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
}
,
{
:
.
COMPACT_ACTIVITYBAR_WIDTH
,
:
.
COMPACT_ACTIVITYBAR_WIDTH
}
)
;
}
)
;
test
(
'height constraints are unbounded'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
)
;
.
strictEqual
(
.
,
0
)
;
.
strictEqual
(
.
,
.
POSITIVE_INFINITY
)
;
}
)
;
test
(
'floating panels reserves the cluster perimeter, plus a leading gap only for a standalone right-hand rail'
,
(
)
=>
{
const
=
.
FLOATING_ACTIVITYBAR_WIDTH
+
.
FLOATING_MARGIN
+
.
FLOATING_LANE
;
const
=
+
.
FLOATING_MARGIN
;
const
widthOf
=
(
:
,
:
boolean
,
=
false
)
=>
{
const
{
,
}
=
createActivitybarPart
(
false
,
true
,
,
{
}
,
)
;
.
isVisible
=
(
:
)
=>
===
.
SIDEBAR_PART
&&
;
return
.
;
}
;
.
deepStrictEqual
(
{
:
widthOf
(
.
LEFT
,
true
)
,
:
widthOf
(
.
LEFT
,
false
)
,
:
widthOf
(
.
RIGHT
,
true
)
,
:
widthOf
(
.
RIGHT
,
false
)
,
:
widthOf
(
.
RIGHT
,
false
,
true
)
,
}
,
{
:
,
:
,
:
,
:
,
:
.
FLOATING_ACTIVITYBAR_WIDTH
+
COMPACT_FLOATING_PANEL_OUTER_MARGIN
+
.
FLOATING_COMPACT_LANE
,
}
)
;
}
)
;
test
(
'compact Modern UI density reserves the connected cluster perimeter and rail padding'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
,
true
,
.
LEFT
,
{
}
,
true
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
}
,
{
:
.
FLOATING_ACTIVITYBAR_WIDTH
+
COMPACT_FLOATING_PANEL_OUTER_MARGIN
+
.
FLOATING_COMPACT_LANE
,
:
.
FLOATING_ACTIVITYBAR_WIDTH
+
COMPACT_FLOATING_PANEL_OUTER_MARGIN
+
.
FLOATING_COMPACT_LANE
,
}
)
;
}
)
;
test
(
'toggling compact via config changes width constraints'
,
(
)
=>
{
const
{
,
}
=
createActivitybarPart
(
false
)
;
.
strictEqual
(
.
,
.
ACTIVITYBAR_WIDTH
)
;
.
setUserConfiguration
(
.
ACTIVITY_BAR_COMPACT
,
true
)
;
fireConfigChange
(
,
.
ACTIVITY_BAR_COMPACT
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
}
,
{
:
.
COMPACT_ACTIVITYBAR_WIDTH
,
:
.
COMPACT_ACTIVITYBAR_WIDTH
}
)
;
.
setUserConfiguration
(
.
ACTIVITY_BAR_COMPACT
,
false
)
;
fireConfigChange
(
,
.
ACTIVITY_BAR_COMPACT
)
;
.
deepStrictEqual
(
{
:
.
,
:
.
}
,
{
:
.
ACTIVITYBAR_WIDTH
,
:
.
ACTIVITYBAR_WIDTH
}
)
;
}
)
;
test
(
'fires onDidChange(undefined) when compact setting changes'
,
(
)
=>
{
const
{
,
}
=
createActivitybarPart
(
false
)
;
const
:
(
|
undefined
)
[
]
=
[
]
;
.
add
(
.
onDidChange
(
=>
.
push
(
)
)
)
;
.
setUserConfiguration
(
.
ACTIVITY_BAR_COMPACT
,
true
)
;
fireConfigChange
(
,
.
ACTIVITY_BAR_COMPACT
)
;
.
strictEqual
(
.
,
1
)
;
.
strictEqual
(
[
0
]
,
undefined
,
'should fire undefined to signal constraint change'
)
;
.
setUserConfiguration
(
.
ACTIVITY_BAR_COMPACT
,
false
)
;
fireConfigChange
(
,
.
ACTIVITY_BAR_COMPACT
)
;
.
strictEqual
(
.
,
2
)
;
.
strictEqual
(
[
1
]
,
undefined
)
;
}
)
;
test
(
'does not fire onDidChange for unrelated config changes'
,
(
)
=>
{
const
{
,
}
=
createActivitybarPart
(
false
)
;
const
:
(
|
undefined
)
[
]
=
[
]
;
.
add
(
.
onDidChange
(
=>
.
push
(
)
)
)
;
fireConfigChange
(
,
'editor.fontSize'
)
;
.
strictEqual
(
.
,
0
)
;
}
)
;
test
(
'fires onDidChange(undefined) when floating panels setting changes'
,
(
)
=>
{
const
{
,
,
}
=
createActivitybarPart
(
false
,
false
)
;
const
:
(
|
undefined
)
[
]
=
[
]
;
.
add
(
.
onDidChange
(
=>
.
push
(
)
)
)
;
.
=
true
;
.
setUserConfiguration
(
.
MODERN_UI
,
true
)
;
fireConfigChange
(
,
.
MODERN_UI
)
;
.
deepStrictEqual
(
,
[
undefined
]
)
;
.
strictEqual
(
.
,
.
FLOATING_ACTIVITYBAR_WIDTH
+
.
FLOATING_MARGIN
+
.
FLOATING_LANE
)
;
}
)
;
test
(
'fires onDidChange(undefined) when Modern UI density changes'
,
(
)
=>
{
const
{
,
,
}
=
createActivitybarPart
(
false
,
true
)
;
const
:
(
|
undefined
)
[
]
=
[
]
;
.
add
(
.
onDidChange
(
=>
.
push
(
)
)
)
;
.
=
true
;
.
setUserConfiguration
(
.
MODERN_UI_DENSITY
,
.
)
;
fireConfigChange
(
,
.
MODERN_UI_DENSITY
)
;
.
deepStrictEqual
(
{
,
:
.
,
}
,
{
:
[
undefined
]
,
:
.
FLOATING_ACTIVITYBAR_WIDTH
+
COMPACT_FLOATING_PANEL_OUTER_MARGIN
*
2
,
}
)
;
}
)
;
test
(
'updateCompactStyle sets correct CSS custom properties in default mode'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
` ${ ActivitybarPart. ACTIVITYBAR_WIDTH } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-height'
)
,
` ${ ActivitybarPart. ACTION_HEIGHT } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-gap'
)
,
'0px'
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-icon-size'
)
,
` ${ ActivitybarPart. ICON_SIZE } px `
)
;
.
strictEqual
(
.
.
contains
(
'compact'
)
,
false
)
;
}
)
;
test
(
'updateCompactStyle sets correct CSS custom properties in compact mode'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
true
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
` ${ ActivitybarPart. COMPACT_ACTIVITYBAR_WIDTH } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-height'
)
,
` ${ ActivitybarPart. COMPACT_ACTION_HEIGHT } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-gap'
)
,
'0px'
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-icon-size'
)
,
` ${ ActivitybarPart. COMPACT_ICON_SIZE } px `
)
;
.
strictEqual
(
.
.
contains
(
'compact'
)
,
true
)
;
}
)
;
test
(
'updateCompactStyle sets correct CSS custom properties in floating mode'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
,
true
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
` ${ ActivitybarPart. FLOATING_ACTIVITYBAR_WIDTH } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-height'
)
,
` ${ ActivitybarPart. FLOATING_ACTION_HEIGHT } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-gap'
)
,
` ${ ActivitybarPart. FLOATING_ACTION_GAP } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-icon-size'
)
,
` ${ ActivitybarPart. ICON_SIZE } px `
)
;
.
strictEqual
(
.
.
contains
(
'compact'
)
,
false
)
;
}
)
;
test
(
'updateCompactStyle sets compact Modern UI density properties'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
,
true
,
.
LEFT
,
{
}
,
true
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
deepStrictEqual
(
{
:
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
:
.
.
getPropertyValue
(
'--activity-bar-action-height'
)
,
:
.
.
getPropertyValue
(
'--activity-bar-icon-size'
)
,
}
,
{
:
` ${ ActivitybarPart. FLOATING_ACTIVITYBAR_WIDTH } px `
,
:
` ${ ActivitybarPart. FLOATING_ACTION_HEIGHT } px `
,
:
` ${ ActivitybarPart. ICON_SIZE } px `
,
}
)
;
}
)
;
test
(
'toggling compact updates CSS custom properties on element'
,
(
)
=>
{
const
{
,
}
=
createActivitybarPart
(
false
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
` ${ ActivitybarPart. ACTIVITYBAR_WIDTH } px `
)
;
.
strictEqual
(
.
.
contains
(
'compact'
)
,
false
)
;
.
setUserConfiguration
(
.
ACTIVITY_BAR_COMPACT
,
true
)
;
fireConfigChange
(
,
.
ACTIVITY_BAR_COMPACT
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
` ${ ActivitybarPart. COMPACT_ACTIVITYBAR_WIDTH } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-height'
)
,
` ${ ActivitybarPart. COMPACT_ACTION_HEIGHT } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-icon-size'
)
,
` ${ ActivitybarPart. COMPACT_ICON_SIZE } px `
)
;
.
strictEqual
(
.
.
contains
(
'compact'
)
,
true
)
;
.
setUserConfiguration
(
.
ACTIVITY_BAR_COMPACT
,
false
)
;
fireConfigChange
(
,
.
ACTIVITY_BAR_COMPACT
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-width'
)
,
` ${ ActivitybarPart. ACTIVITYBAR_WIDTH } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-action-height'
)
,
` ${ ActivitybarPart. ACTION_HEIGHT } px `
)
;
.
strictEqual
(
.
.
getPropertyValue
(
'--activity-bar-icon-size'
)
,
` ${ ActivitybarPart. ICON_SIZE } px `
)
;
.
strictEqual
(
.
.
contains
(
'compact'
)
,
false
)
;
}
)
;
test
(
'leaves the card border to the stylesheet in Modern UI, keeping the legacy inline border otherwise'
,
(
)
=>
{
const
render
=
(
:
boolean
)
=>
{
const
{
}
=
createActivitybarPart
(
false
,
,
.
LEFT
,
{
[
ACTIVITY_BAR_BORDER
]
:
'#123456'
}
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
return
{
:
.
.
,
:
.
.
contains
(
'bordered'
)
}
;
}
;
.
deepStrictEqual
(
{
:
render
(
true
)
,
:
render
(
false
)
,
}
,
{
:
{
:
''
,
:
false
}
,
:
{
:
'rgb(18, 52, 86)'
,
:
true
}
,
}
)
;
}
)
;
test
(
'uses the inactive background only for inactive Modern UI windows'
,
(
)
=>
{
const
{
,
,
}
=
createActivitybarPart
(
false
,
true
,
.
LEFT
,
{
[
ACTIVITY_BAR_BACKGROUND
]
:
'#123456'
,
[
MODERN_ACTIVITY_BAR_BACKGROUND
]
:
'#abcdef'
,
[
MODERN_ACTIVITY_BAR_INACTIVE_BACKGROUND
]
:
'#654321'
,
}
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
const
=
.
.
;
.
setFocus
(
false
)
;
const
=
.
.
;
.
setUserConfiguration
(
.
MODERN_UI
,
false
)
;
fireConfigChange
(
,
.
MODERN_UI
)
;
.
deepStrictEqual
(
{
,
,
:
.
.
,
}
,
{
:
'rgb(171, 205, 239)'
,
:
'rgb(101, 67, 33)'
,
:
'rgb(18, 52, 86)'
,
}
)
;
}
)
;
test
(
'toJSON returns correct part type'
,
(
)
=>
{
const
{
}
=
createActivitybarPart
(
false
)
;
.
deepStrictEqual
(
.
toJSON
(
)
,
{
:
.
ACTIVITYBAR_PART
}
)
;
}
)
;
function
layoutContentHeight
(
:
[
]
,
=
true
,
=
false
)
:
number
{
const
{
,
}
=
createActivitybarPart
(
false
,
,
.
LEFT
,
{
}
,
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
const
=
new
Set
(
)
;
.
isVisible
=
(
:
)
=>
.
has
(
)
;
.
layout
(
100
,
300
)
;
const
=
.
querySelector < HTMLElement>
(
'.content'
)
;
return
parseInt
(
!
.
.
,
10
)
;
}
test
(
'reserves the perimeter gutter on each window edge the activity bar faces'
,
(
)
=>
{
const
=
.
FLOATING_MARGIN
;
const
=
.
FLOATING_MARGIN
;
const
=
.
FLOATING_BORDER
*
2
;
const
=
{
:
layoutContentHeight
(
[
.
TITLEBAR_PART
,
.
STATUSBAR_PART
]
)
,
:
layoutContentHeight
(
[
.
STATUSBAR_PART
]
)
,
:
layoutContentHeight
(
[
.
BANNER_PART
,
.
STATUSBAR_PART
]
)
,
:
layoutContentHeight
(
[
.
TITLEBAR_PART
]
)
,
:
layoutContentHeight
(
[
]
)
,
:
layoutContentHeight
(
[
]
,
false
)
,
}
;
.
deepStrictEqual
(
,
{
:
300
-
-
,
:
300
-
-
-
,
:
300
-
-
,
:
300
-
-
,
:
300
-
*
2
-
,
:
300
,
}
)
;
}
)
;
test
(
'compact density aligns the activity bar bottom gutter with the panel cluster'
,
(
)
=>
{
const
=
COMPACT_FLOATING_PANEL_OUTER_MARGIN
;
const
=
.
FLOATING_BORDER
*
2
;
.
deepStrictEqual
(
{
:
layoutContentHeight
(
[
.
TITLEBAR_PART
,
.
STATUSBAR_PART
]
,
true
,
true
)
,
:
layoutContentHeight
(
[
.
STATUSBAR_PART
]
,
true
,
true
)
,
:
layoutContentHeight
(
[
.
TITLEBAR_PART
]
,
true
,
true
)
,
:
layoutContentHeight
(
[
]
,
true
,
true
)
,
}
,
{
:
300
-
-
,
:
300
-
*
2
-
,
:
300
-
-
,
:
300
-
*
2
-
,
}
)
;
}
)
;
function
capturedCompositeBarOptions
(
:
boolean
,
:
boolean
,
=
false
)
:
{
let
:
|
undefined
;
const
=
{
create
:
(
)
=>
{
}
,
layout
:
(
)
=>
{
}
,
dispose
:
(
)
=>
{
}
}
;
const
{
}
=
createActivitybarPart
(
,
,
.
LEFT
,
{
}
,
,
{
createInstance
:
(
:
unknown
,
:
unknown
,
:
)
=>
{
=
;
return
;
}
}
as
unknown
as
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
show
(
)
;
return
!
;
}
test
(
'composite bar item size tracks the rendered item stride in every mode'
,
(
)
=>
{
const
sizesFor
=
(
:
boolean
,
:
boolean
,
=
false
)
=>
{
const
{
,
}
=
capturedCompositeBarOptions
(
,
,
)
;
return
{
,
}
;
}
;
.
deepStrictEqual
(
{
:
sizesFor
(
false
,
false
)
,
:
sizesFor
(
true
,
false
)
,
:
sizesFor
(
false
,
true
)
,
:
sizesFor
(
true
,
true
)
,
:
sizesFor
(
false
,
true
,
true
)
,
}
,
{
:
{
:
48
,
:
48
}
,
:
{
:
28
,
:
28
}
,
:
{
:
44
,
:
44
}
,
:
{
:
28
,
:
28
}
,
:
{
:
40
,
:
40
}
,
}
)
;
}
)
;
function
compositeBarLayoutHeight
(
:
boolean
,
:
boolean
)
:
number
{
let
=
-
1
;
const
=
{
create
:
(
)
=>
{
}
,
layout
:
(
:
number
,
:
number
)
=>
{
=
;
}
,
dispose
:
(
)
=>
{
}
}
;
const
{
,
}
=
createActivitybarPart
(
,
,
.
LEFT
,
{
}
,
false
,
{
createInstance
:
(
)
=>
}
as
unknown
as
)
;
const
=
.
createElement
(
'div'
)
;
.
appendChild
(
)
;
.
create
(
)
;
.
show
(
)
;
const
=
new
Set
(
[
.
TITLEBAR_PART
,
.
STATUSBAR_PART
]
)
;
.
isVisible
=
(
:
)
=>
.
has
(
)
;
.
layout
(
100
,
300
)
;
return
;
}
test
(
'composite bar is given back the leading item gap it does not render'
,
(
)
=>
{
const
=
.
FLOATING_MARGIN
;
const
=
.
FLOATING_BORDER
*
2
;
.
deepStrictEqual
(
{
:
compositeBarLayoutHeight
(
false
,
false
)
,
:
compositeBarLayoutHeight
(
true
,
false
)
,
:
compositeBarLayoutHeight
(
false
,
true
)
,
:
compositeBarLayoutHeight
(
true
,
true
)
,
}
,
{
:
300
,
:
300
,
:
300
-
-
+
.
FLOATING_ACTION_GAP
,
:
300
-
-
,
}
)
;
}
)
;
function
heightLeftForCompositeBar
(
:
number
,
:
number
,
:
number
)
:
number
{
const
=
.
createElement
(
'div'
)
;
for
(
let
=
0
;
<
;
++
)
{
const
=
.
createElement
(
'div'
)
;
.
.
=
` ${ itemHeight} px `
;
if
(
>
0
)
{
.
.
=
` ${ gap} px `
;
}
.
appendChild
(
)
;
}
.
appendChild
(
)
;
let
:
|
undefined
;
activityBarCompositeBarLayout
.
call
(
{
:
undefined
,
:
{
:
}
,
:
{
:
.
VERTICAL
}
,
:
{
layout
:
=>
{
=
;
}
}
,
}
,
.
FLOATING_ACTIVITYBAR_WIDTH
,
300
)
;
return
!
.
;
}
test
(
'reserves the measured height of the global activity icons'
,
(
)
=>
{
const
=
.
FLOATING_ACTION_GAP
;
const
=
.
FLOATING_ACTION_HEIGHT
;
.
deepStrictEqual
(
{
:
heightLeftForCompositeBar
(
1
,
,
)
,
:
heightLeftForCompositeBar
(
2
,
,
)
,
}
,
{
:
300
-
,
:
300
-
(
*
2
+
)
,
}
)
;
}
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
}
)
;