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 / componentFixtures / multiDiffEditorScroll.fixture.ts 1510 строк · изменён 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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
import * as dom from '../../../../base/browser/dom.js' ;
import { Button, IButtonStyles } from '../../../../base/browser/ui/button/button.js' ;
import { getErrorMessage } from '../../../../base/common/errors.js' ;
import { ValueWithChangeEvent } from '../../../../base/common/event.js' ;
import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js' ;
import { IObservable, ITransaction, autorun, autorunWithStore, constObservable, derived, observableValue, transaction }
CompressedVirtualizedScrollView ICompressedVirtualizedScrollViewContext
computeCompressedVirtualizedScrollLayout ICompressedVirtualizedScrollLayout
IMultiDiffEditorModel
IVirtualizedItemBindingContext ManagedVirtualizedItem VirtualizedItemBinding VirtualizedItemManager VirtualizedItemTemplate
OffsetRange
TestDiffProviderFactoryService
ComponentFixtureContext defineComponentFixture defineThemedFixtureGroup
createMultiDiffEditorFixtureDocuments createMultiDiffEditorFixtureServices createMultiDiffEditorFixtureWidget
fixtureHeaderHeight
fixtureLineHeight
action
scrollDelta
renderedDelta
hiddenDelta
residual
label
lineCount
actualScrollOffset
bindingPhase BindingPhase
topLineCount
bottomLineCount
mountLineCounts ISerializedMountLineCounts
unmountLineCountReset ISerializedUnmountLineCountReset
geometryOscillation ISerializedGeometryOscillation
initial
immediate
after200ms
enabled
lineCount
enabled
topLineCountA
topLineCountB
bottomLineCountA
bottomLineCountB
ordering GeometryChangeOrdering
viewportHeight
scrollTop
itemGap
items ISerializedFixtureItem
ISerializedGeometryOscillation
enabled
topLineCountA
topLineCountB
bottomLineCountA
bottomLineCountB
ordering
lineCount ISerializedMountLineCounts
initial lineCount
immediate lineCount
after200ms lineCount
lineCount ISerializedUnmountLineCountReset
enabled
lineCount
lineCount
topLineCount
bottomLineCount
totalLineCount
fullHeight
actualScrollOffset
bindingPhase
templateId
geometryOscillationEnabled
geometryOscillationTopLineCountA
geometryOscillationTopLineCountB
geometryOscillationBottomLineCountA
geometryOscillationBottomLineCountB
geometryChangeOrdering
mountInitialLineCount
mountImmediateLineCount
mountDelayedLineCount
resetLineCountOnUnmount
unmountedLineCount
_pendingGeometryUpdate
label
lineCount
ICompressedVirtualizedScrollViewContext
action
item FixtureItem
actualScrollOffset
bindingPhase BindingPhase
geometryOscillation
topLineCount
bottomLineCount
mountLineCounts lineCount
unmountLineCountReset lineCount
lineCount lineCount
topLineCount topLineCount
bottomLineCount bottomLineCount
totalLineCount reader topLineCount reader lineCount reader bottomLineCount reader
fullHeight reader totalLineCount reader
actualScrollOffset actualScrollOffset
bindingPhase bindingPhase
geometryOscillationEnabled geometryOscillation enabled
geometryOscillationTopLineCountA geometryOscillation topLineCountA
geometryOscillationTopLineCountB geometryOscillation topLineCountB
geometryOscillationBottomLineCountA geometryOscillation bottomLineCountA
geometryOscillationBottomLineCountB geometryOscillation bottomLineCountB
geometryChangeOrdering geometryOscillation ordering
mountInitialLineCount mountLineCounts initial
mountImmediateLineCount mountLineCounts immediate
mountDelayedLineCount mountLineCounts after200ms
resetLineCountOnUnmount unmountLineCountReset enabled
unmountedLineCount unmountLineCountReset lineCount
value tx ITransaction
actualScrollOffset value tx
value tx ITransaction
lineCount value tx
_pendingGeometryUpdate value dom update
Window
dom contentDomNode
lineCount action tx ITransaction
action
tx
lineCount tx
tx lineCount tx
tx ITransaction
resetLineCountOnUnmount
unmountedLineCount tx
size item fullHeight
maxScroll maxScroll
shouldKeepAlive
templateId
item FixtureItem
_template FixtureTemplate
item
templateId _template id
targetWindow item
handle targetWindow
item item mountDelayedLineCount
targetWindow handle
renderedRange OffsetRange scrollOffset width renderedViewport OffsetRange
item bindingPhase
tx item scrollOffset tx
_template item renderedRange scrollOffset width renderedViewport
_template
override
_store isDisposed
_template item
_root
_header
_title
_selectionProof
_state
_editorContent
_lineCount
_topLineCount
_bottomLineCount
_previousItem FixtureItem
id
context ICompressedVirtualizedScrollViewContext
templateId previousItem FixtureItem item FixtureItem
_root dom context contentDomNode dom
_header dom _root dom
_title dom _header dom
_selectionProof dom _header dom
_selectionProof textContent
_state dom _header dom
editorViewport dom _root dom
_editorContent dom editorViewport dom
item FixtureItem _context IVirtualizedItemBindingContext FixtureBinding
_lineCount
_topLineCount
_bottomLineCount
id _previousItem item
item item mountInitialLineCount
binding item
item item mountImmediateLineCount
binding
binding
item FixtureItem renderedRange OffsetRange scrollOffset width renderedViewport OffsetRange
fullHeight item fullHeight
actualOffset item actualScrollOffset
lineCount item lineCount
topLineCount item topLineCount
bottomLineCount item bottomLineCount
lineCount _lineCount topLineCount _topLineCount bottomLineCount _bottomLineCount
_lineCount lineCount
_topLineCount topLineCount
_bottomLineCount bottomLineCount
_editorContent item label lineCount topLineCount bottomLineCount
_root style visibility
_root style top
_root style height
_root style width
_root classList actualOffset scrollOffset
_title textContent
_state textContent
maxHeaderOffset renderedRange length fixtureHeaderHeight
headerOffset Math Math renderedViewport start renderedRange start maxHeaderOffset
_header style transform
_header classList headerOffset scrollOffset
_header classList headerOffset maxHeaderOffset
_editorContent style height
_editorContent style transform
_root style top
_root style visibility
item FixtureItem
_previousItem item
override
_root
viewportHeight
scrollTop
itemGap
scenario
items
transitions
templateBindings
layout IObservable ICompressedVirtualizedScrollLayout
serializedState IObservable
_scrollView
_itemStore
_itemManager
_scrollContext ICompressedVirtualizedScrollViewContext
_nextTemplateId
_lastLayout ICompressedVirtualizedScrollLayout
_transitionAction
tx
tx
layout reader _scrollView reader layout reader
scrollTop scrollTop reader
viewportHeight viewportHeight reader
itemGap itemGap reader
itemHeights items reader item item fullHeight reader
serializedState reader
viewportHeight viewportHeight reader
scrollTop scrollTop reader
itemGap itemGap reader
items items reader item
label item label
lineCount item lineCount reader
actualScrollOffset item actualScrollOffset reader
bindingPhase item bindingPhase reader
topLineCount item topLineCount reader
bottomLineCount item bottomLineCount reader
mountLineCounts
initial item mountInitialLineCount reader
immediate item mountImmediateLineCount reader
after200ms item mountDelayedLineCount reader
unmountLineCountReset
enabled item resetLineCountOnUnmount reader
lineCount item unmountedLineCount reader
geometryOscillation
enabled item geometryOscillationEnabled reader
topLineCountA item geometryOscillationTopLineCountA reader
topLineCountB item geometryOscillationTopLineCountB reader
bottomLineCountA item geometryOscillationBottomLineCountA reader
bottomLineCountB item geometryOscillationBottomLineCountB reader
ordering item geometryChangeOrdering reader
satisfies ISerializedFixtureState
reader store
items items reader
index index items length index
items index geometryOscillationEnabled reader
targetWindow items index
handle targetWindow index
store targetWindow handle
context ICompressedVirtualizedScrollViewContext IObservable FixtureVirtualizedItem
_scrollContext context
manager items context
item item
item item fullHeight
_nextTemplateId context id previousItem item
previousItem
binding tx binding item templateId binding templateId tx
binding tx
binding item templateId tx
binding item tx
_itemManager value manager
manager virtualizedItems
scrollView CompressedVirtualizedScrollView FixtureVirtualizedItem
scrollView scrollTop scrollTop
_scrollView scrollView
reader
layout scrollView layout reader
scrollTop layout scrollTop
_lastLayout
transition IFixtureTransition
action _transitionAction
scrollDelta layout scrollTop _lastLayout scrollTop
renderedDelta layout renderedViewport start _lastLayout renderedViewport start
hiddenDelta layout hiddenContentHeightAboveViewport _lastLayout hiddenContentHeightAboveViewport
residual layout scrollTop _lastLayout scrollTop
layout renderedViewport start _lastLayout renderedViewport start
layout hiddenContentHeightAboveViewport _lastLayout hiddenContentHeightAboveViewport
transitions transitions transition
_transitionAction
_lastLayout layout
value action smooth
_transitionAction action
_scrollView scrollTop value smooth
value
tx viewportHeight Math value tx
value
tx itemGap Math value tx
index value
item items index
tx item value tx
index phase ISerializedMountLineCounts value
item items index
lineCount value
tx
phase
item mountInitialLineCount lineCount tx
item mountImmediateLineCount lineCount tx
item mountDelayedLineCount lineCount tx
index enabled
item items index
tx item resetLineCountOnUnmount enabled tx
index value
item items index
tx item unmountedLineCount value tx
index
items index
item FixtureItem
_itemManager value virtualizedItems candidate candidate item item
index phase BindingPhase
item items index
tx
item bindingPhase phase tx
phase
item item actualScrollOffset tx
index value
item items index
itemLayout layout items index
actualScrollOffset Math Math value itemLayout maxScrollOffset
_transitionAction
tx item actualScrollOffset tx
index enabled
item items index
tx item geometryOscillationEnabled enabled tx
index edge target value
item items index
lineCount value
tx
observable edge
target item geometryOscillationTopLineCountA item geometryOscillationTopLineCountB
target item geometryOscillationBottomLineCountA item geometryOscillationBottomLineCountB
observable lineCount tx
index ordering GeometryChangeOrdering
item items index
tx item geometryChangeOrdering ordering tx
index
item items index
item
currentTopLineCount item topLineCount
currentBottomLineCount item bottomLineCount
topLineCountA item geometryOscillationTopLineCountA
topLineCountB item geometryOscillationTopLineCountB
bottomLineCountA item geometryOscillationBottomLineCountA
bottomLineCountB item geometryOscillationBottomLineCountB
distanceToA Math currentTopLineCount topLineCountA Math currentBottomLineCount bottomLineCountA
distanceToB Math currentTopLineCount topLineCountB Math currentBottomLineCount bottomLineCountB
targetTopLineCount distanceToA distanceToB topLineCountB topLineCountA
targetBottomLineCount distanceToA distanceToB bottomLineCountB bottomLineCountA
topLineCountDelta targetTopLineCount currentTopLineCount
targetHeight item lineCount targetTopLineCount targetBottomLineCount
currentOffset item actualScrollOffset
targetMaxOffset Math targetHeight Math targetHeight viewportHeight
targetOffset Math Math
currentOffset currentOffset topLineCountDelta fixtureLineHeight currentOffset
targetMaxOffset
tx
item topLineCount targetTopLineCount tx
item bottomLineCount targetBottomLineCount tx
tx item targetOffset tx
item geometryChangeOrdering
tx
item topLineCount targetTopLineCount tx
item bottomLineCount targetBottomLineCount tx
item targetOffset tx
item setOffset
item setLines
scenario
scenarios
mixed viewportHeight scrollTop items
tall viewportHeight scrollTop items
pooling
viewportHeight
scrollTop
items length _ index
String index
index
measurement
viewportHeight
scrollTop
items
initial immediate after200ms
initial immediate after200ms
selected scenarios scenario
tx
scenario scenario tx
viewportHeight selected viewportHeight tx
scrollTop selected scrollTop tx
templateBindings tx
selected items tx
_scrollView scrollTop selected scrollTop
scrollTop viewportHeight
tx
items items
items
items items lineCount tx
items
items items lineCount tx
viewportHeight viewportHeight tx
value
state value
tx
viewportHeight state viewportHeight tx
itemGap state itemGap tx
state items tx
_scrollView scrollTop state scrollTop
action tx ITransaction
_transitionAction action
update
message
templateBindings templateBindings message
items ISerializedFixtureItem tx ITransaction
_itemStore
items items item _itemStore
item label
item lineCount
_scrollContext
_scrollContext
action _transitionAction action
item item
item actualScrollOffset
item bindingPhase
item geometryOscillation
item topLineCount
item bottomLineCount
item mountLineCounts item lineCount
item unmountLineCountReset item lineCount
tx
override
_scrollView
_scrollView
ManagedVirtualizedItem FixtureItem FixtureBinding FixtureTemplate
label
lineCount
bindingPhase BindingPhase
mountLineCounts lineCount
ISerializedFixtureItem
label
lineCount
actualScrollOffset
bindingPhase
mountLineCounts
JsonValue key JsonValue
text ISerializedFixtureState
value JsonValue text
value
items value
items
items length
viewportHeight value
scrollTop value
itemGap value
items items item index item index
value JsonValue index ISerializedFixtureItem
value
bindingPhase value
bindingPhase
path
lineCount value
value path
value path
geometryOscillationValue value
geometryOscillation geometryOscillationValue
geometryOscillationValue index lineCount
topLineCountValue value
bottomLineCountValue value
legacyContentTopInset value
mountLineCountsValue value
legacyMountHeightsValue value
unmountLineCountResetValue value
label value path
lineCount
actualScrollOffset value path
bindingPhase
topLineCount topLineCountValue
legacyContentTopInset Math value path fixtureLineHeight
value path
bottomLineCount bottomLineCountValue value path
mountLineCounts mountLineCountsValue
mountLineCountsValue index
legacyMountHeightsValue
legacyMountHeightsValue index
lineCount
unmountLineCountReset unmountLineCountResetValue
lineCount
unmountLineCountResetValue index
geometryOscillation
value JsonValue index legacyHeights ISerializedMountLineCounts
path
value
initial legacyHeights value path value path
immediate legacyHeights value path value path
after200ms legacyHeights value path value path
value JsonValue index ISerializedUnmountLineCountReset
path
value
enabled value path
lineCount value path
value JsonValue index lineCount ISerializedGeometryOscillation
path
value
ordering value
ordering
normalizedOrdering ordering ordering
value
enabled value path
topLineCountA value path
topLineCountB value path
bottomLineCountA value path
bottomLineCountB value path
ordering normalizedOrdering
location value
location location
totalLineCountA value path
totalLineCountB value path
addedLineCountA Math totalLineCountA lineCount
addedLineCountB Math totalLineCountB lineCount
enabled value path
topLineCountA location addedLineCountA
topLineCountB location addedLineCountB
bottomLineCountA location addedLineCountA
bottomLineCountB location addedLineCountB
ordering normalizedOrdering
value JsonValue value key JsonValue
value value value
value JsonValue value BindingPhase
value value value value
value JsonValue value GeometryChangeOrdering
value value value value
value key JsonValue key allowZero path
result value key
minimum allowZero Number
result Number result result minimum
result
value key JsonValue key path
result value key
result Number result result
result
value
Math Math value
lineCount
fixtureHeaderHeight lineCount fixtureLineHeight
height
Math height fixtureHeaderHeight fixtureLineHeight
value key JsonValue key path
result value key
result result length
result
value key JsonValue key path
result value key
result
result
buttonStyles IButtonStyles
buttonBackground
buttonHoverBackground
buttonSeparator
buttonForeground
buttonSecondaryBackground
buttonSecondaryHoverBackground
buttonSecondaryForeground
buttonBorder
buttonSecondaryBorder
path
ScrollModel
labels kind
expectedVisualDescriptions
render renderMultiDiffScrollFixture
TemplatePool
labels kind
expectedVisualDescriptions
context context
RealWidget
labels kind
expectedVisualDescriptions
render renderRealMultiDiffScrollFixture
container disposableStore ComponentFixtureContext
initialScenario
finalScrollTop
container classList
model disposableStore
initialScenario
model initialScenario
heading dom container dom
heading textContent
description dom container dom
description textContent
columns dom container dom
controls dom columns dom
visualization dom columns dom
inspector dom columns dom
controls model disposableStore
visualization model disposableStore
inspector model disposableStore
finalScrollTop
model finalScrollTop
container disposableStore disposableStackStore theme ComponentFixtureContext
viewportHeight
viewportWidth
container classList
heading dom container dom
heading textContent
description dom container dom
description textContent
columns dom container dom
visualization dom columns dom
editorPane dom visualization dom
editorPane
viewport dom editorPane dom
viewport style width
viewport style height
viewport
instantiationService disposableStore theme
textModels disposableStackStore
doc1 doc2 doc3 instantiationService textModels
widget disposableStackStore instantiationService viewport
model IMultiDiffEditorModel
documents ValueWithChangeEvent doc1 doc2 doc3
viewModel disposableStackStore widget model
widget viewModel
widget viewportWidth viewportHeight
disposableStackStore widget
coordinateState widget reader
debugState widget reader
layout
scrollHeight debugState layout scrollHeight
renderedHeight debugState layout renderedHeight
contentViewport debugState layout contentViewport
renderedViewport debugState layout renderedViewport
items debugState items item
contentRange item layout contentRange
renderedRange item layout renderedRange
scrollOffset item layout scrollOffset
items debugState items item
label item label
templateId item hasTemplate
visualization viewportHeight coordinateState disposableStore
diagnostics dom visualization dom
diagnostics tabIndex
diagnostics
disposableStore reader
state widget reader
diagnostics textContent
revision state layout revision
logicalScrollHeight state layout logicalScrollHeight
scrollHeight state layout scrollHeight
leadingScrollSlack state layout leadingScrollSlack
trailingScrollSlack state layout trailingScrollSlack
geometryEdit state geometryEdit
range start endExclusive start endExclusive length
range length range endExclusive range start
container HTMLElement model MultiDiffScrollFixtureModel store DisposableStore
container
selectedTab container
tabList dom container dom
tabList
tabList
formTab tabList selectedTab store
jsonTab tabList selectedTab store
formTab element
jsonTab element
store dom tabList dom EventType event
event key event key
event
tab selectedTab
selectedTab tab
tab formTab jsonTab element
formPanel dom container dom
formPanel
formPanel
jsonPanel dom container dom
jsonPanel
jsonPanel
store reader
tab selectedTab reader
formPanel hidden tab
jsonPanel hidden tab
formTab element tab
jsonTab element tab
formTab element tabIndex tab
jsonTab element tabIndex tab
scenarioLabel dom formPanel dom
dom scenarioLabel dom textContent
scenario dom scenarioLabel dom HTMLSelectElement
value label
option dom scenario dom HTMLOptionElement
option value value
option textContent label
store dom scenario dom EventType model scenario value
store reader
scenario value model scenario reader
formPanel model viewportHeight value model value store
formPanel model scrollTop value model value store
formPanel model itemGap value model value store
deltaButtons dom formPanel dom
delta
deltaButtons model model scrollTop delta store
transactionButtons dom formPanel dom
transactionButtons model store
transactionButtons model store
formPanel
itemDescription dom formPanel dom
itemDescription textContent
itemControls dom formPanel dom
store reader
items model items reader
itemControls
index index items length index
itemControls model items index index reader store
jsonDescription dom jsonPanel dom
jsonDescription textContent
jsonEditor dom jsonPanel dom HTMLTextAreaElement
jsonEditor
jsonEditor spellcheck
jsonError dom jsonPanel dom
jsonError
jsonButtons dom jsonPanel dom
jsonButtons
model jsonEditor value
jsonEditor value model serializedState
jsonError textContent
error
jsonError textContent error
store
jsonButtons
jsonEditor value model serializedState
jsonError textContent
store
jsonButtons
jsonEditor
jsonEditor
store
store reader
serializedState model serializedState reader
dom jsonEditor
jsonEditor value serializedState
container HTMLElement model MultiDiffScrollFixtureModel item FixtureItem index store DisposableStore
card dom container dom
legend dom card dom
store reader
templateId item templateId reader
legend textContent
card item lineCount value model index value store
card item mountInitialLineCount value model index value store
card item mountImmediateLineCount value model index value store
card item mountDelayedLineCount value model index value store
card item actualScrollOffset value model index value store
resetLabel dom card dom
resetCheckbox dom resetLabel dom HTMLInputElement
resetCheckbox type
dom resetLabel dom textContent
store dom resetCheckbox dom EventType model index resetCheckbox checked
store reader
resetCheckbox checked item resetLineCountOnUnmount reader
card item unmountedLineCount value model index value store
phaseLabel dom card dom
dom phaseLabel dom textContent
phaseSelect dom phaseLabel dom HTMLSelectElement
phase
option dom phaseSelect dom HTMLOptionElement
option value phase
option textContent phase
store dom phaseSelect dom EventType model index phaseSelect value BindingPhase
store reader
phaseSelect value item bindingPhase reader
oscillationLabel dom card dom
oscillationCheckbox dom oscillationLabel dom HTMLInputElement
oscillationCheckbox type
dom oscillationLabel dom textContent
store dom oscillationCheckbox dom EventType model index oscillationCheckbox checked
store reader
oscillationCheckbox checked item geometryOscillationEnabled reader
card item geometryOscillationTopLineCountA value model index value store
card item geometryOscillationTopLineCountB value model index value store
card item geometryOscillationBottomLineCountA value model index value store
card item geometryOscillationBottomLineCountB value model index value store
orderingLabel dom card dom
dom orderingLabel dom textContent
orderingSelect dom orderingLabel dom HTMLSelectElement
value label
option dom orderingSelect dom HTMLOptionElement
option value value
option textContent label
store dom orderingSelect dom EventType model index orderingSelect value GeometryChangeOrdering
store reader
orderingSelect value item geometryChangeOrdering reader
editorButtons dom card dom
replayMountButton editorButtons model index store
store reader
replayMountButton enabled item templateId reader
editorButtons model index item actualScrollOffset store
editorButtons model index item actualScrollOffset store
editorButtons model index store
container HTMLElement model MultiDiffScrollFixtureModel store DisposableStore
editorPane dom container dom
editorPane
viewport dom editorPane dom
viewport tabIndex
viewport
dimension model reader model viewportHeight reader
scrollView store
viewport
dimension
model itemGap
context model context
scrollView domNode classList
viewport scrollView domNode
model scrollView
store reader
viewport style height
store dom viewport dom EventType event
delta event key
event key
event key model viewportHeight
event key model viewportHeight
delta
event
model model scrollTop delta
coordinateState model reader
layout model layout reader
items model items reader item
label item label
templateId item templateId reader
container model viewportHeight coordinateState store
layout
scrollHeight
renderedHeight
contentViewport start endExclusive length
renderedViewport start endExclusive length
items
contentRange start endExclusive length
renderedRange start endExclusive length
scrollOffset
items
label
templateId
container HTMLElement
viewportHeight IObservable
state IObservable ICoordinateVisualizationState
store DisposableStore
coordinatePane dom container dom
coordinatePane
coordinateGrid dom coordinatePane dom
contentScale coordinateGrid
renderedScale coordinateGrid
store reader
height viewportHeight reader
value state reader
coordinateHeight Math height Math value items length
contentScale track style height
renderedScale track style height
contentScale value layout value items
renderedScale value layout value items
root HTMLElement
itemRange HTMLElement
itemViewport HTMLElement
label HTMLElement
track HTMLElement
viewport HTMLElement
segments ICoordinateSegment
container HTMLElement title ICoordinateScale
root dom container dom
dom root dom textContent title
track dom root dom
viewport dom track dom
viewport
track viewport segments
scale ICoordinateScale
layout ICoordinateVisualizationState
items ICoordinateVisualizationState
kind
scale segments length items length
scale segments root
scale segments length items length
root dom
itemRange dom root dom
itemViewport dom itemRange dom
label dom root dom
scale track root scale viewport
scale segments root itemRange itemViewport label
height kind layout scrollHeight layout renderedHeight
safeHeight Math height
index index layout items length index
itemLayout layout items index
range kind itemLayout contentRange itemLayout renderedRange
segment scale segments index
templateId items index templateId
segment label textContent kind
items index label
segment root style top
segment root style height
segment itemRange hidden kind
kind
itemHeight Math itemLayout contentRange length
segment itemViewport style top
segment itemViewport style height
viewport kind layout contentViewport layout renderedViewport
scale viewport style top
scale viewport style height
container HTMLElement itemLabel lineCount topLineCount bottomLineCount
lineNumbers
length topLineCount _ lineIndex lineIndex topLineCount
length lineCount _ lineIndex lineIndex
length bottomLineCount _ lineIndex lineCount lineIndex
container lineNumbers lineNumber
line dom
line style height
line style lineHeight
gutter dom line dom
gutter textContent lineNumber
content dom line dom
content textContent
line
container HTMLElement model MultiDiffScrollFixtureModel store DisposableStore
container
equation dom container dom
equationValues dom equation dom
equationStatus dom equation dom
equationStatus
container
table dom container dom
caption dom table dom
caption textContent
header dom table dom
headerRow dom header dom
label
dom headerRow dom textContent label
body dom table dom
container
templateLog dom container dom
container
transitionLog dom container dom
store reader
layout model layout reader
conservationResidual layout scrollTop layout renderedViewport start layout hiddenContentHeightAboveViewport
equationValues textContent
equationStatus textContent Math conservationResidual
equation classList Math conservationResidual
templateLog
binding model templateBindings reader
dom templateLog dom textContent binding
transitionLog
transitions model transitions reader
transition transitions
entry dom transitionLog dom
entry classList Math transition residual
action dom entry dom
action textContent transition action
values dom entry dom
values textContent
store reader
items model items reader
body
tableRows items
row dom body dom
row
cells length dom row dom
reader store tableReader
layout model layout tableReader
layout items length items length
index index items length index
item items index
itemLayout layout items index
cells tableRows index cells
values
item label
itemLayout contentRange start itemLayout contentRange endExclusive
itemLayout renderedRange start itemLayout renderedRange endExclusive
itemLayout maxScrollOffset
itemLayout scrollOffset
item actualScrollOffset tableReader
item templateId tableReader
item bindingPhase tableReader
cellIndex cellIndex cells length cellIndex
cells cellIndex textContent values cellIndex
tableRows index row classList
itemLayout visibility item actualScrollOffset tableReader itemLayout scrollOffset
container HTMLElement label
dom container dom textContent label
container HTMLElement
label
value IObservable
value
store DisposableStore
field dom container dom
dom field dom textContent label
input dom field dom HTMLInputElement
input type
input step
store dom input dom EventType
newValue input value
Number newValue
newValue
store reader
formattedValue value reader
dom input
input value formattedValue
store dom input dom EventType
input value value
container HTMLElement
label
store DisposableStore
secondary
Button
button store container buttonStyles secondary title label
button label label
store button onClick
button
value
Number value value value
value
start endExclusive
from
'../../../../base/common/observable.js'
;
import
{
,
}
from
'../../../../editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js'
;
import
{
,
}
from
'../../../../editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js'
;
import
{
}
from
'../../../../editor/browser/widget/multiDiffEditor/model.js'
;
import
{
,
,
,
,
}
from
'../../../../editor/browser/widget/multiDiffEditor/virtualizedItemManager.js'
;
import
{
}
from
'../../../../editor/common/core/ranges/offsetRange.js'
;
import
{
}
from
'../../../../editor/test/browser/diff/testDiffProviderFactoryService.js'
;
import
{
,
,
}
from
'./fixtureUtils.js'
;
import
{
,
,
}
from
'./editor/multiDiffEditorFixtureUtils.js'
;
import
'./multiDiffEditorScroll.fixture.css'
;
type
BindingPhase
=
'unbound'
|
'binding'
|
'projecting'
|
'active'
;
type
GeometryChangeOrdering
=
'atomic'
|
'lines-first'
|
'offset-first'
;
const
=
32
;
const
=
20
;
interface
IFixtureTransition
{
readonly
:
string
;
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
}
interface
ISerializedFixtureItem
{
readonly
:
string
;
readonly
:
number
;
readonly
:
number
;
readonly
:
;
readonly
?
:
number
;
readonly
?
:
number
;
readonly
?
:
;
readonly
?
:
;
readonly
?
:
;
}
interface
ISerializedMountLineCounts
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
}
interface
ISerializedUnmountLineCountReset
{
readonly
:
boolean
;
readonly
:
number
;
}
interface
ISerializedGeometryOscillation
{
readonly
:
boolean
;
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
readonly
:
;
}
interface
ISerializedFixtureState
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
readonly
:
readonly
[
]
;
}
function
createDefaultGeometryOscillation
(
)
:
{
return
{
:
false
,
:
0
,
:
5
,
:
0
,
:
5
,
:
'atomic'
,
}
;
}
function
createDefaultMountLineCounts
(
:
number
)
:
{
return
{
:
,
:
,
:
,
}
;
}
function
createDefaultUnmountLineCountReset
(
:
number
)
:
{
return
{
:
false
,
,
}
;
}
class
FixtureItem
extends
Disposable
{
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
=
observableValue < number | undefined >
(
this
,
undefined
)
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
readonly
;
private
readonly
=
this
.
_register
(
new
MutableDisposable
(
)
)
;
constructor
(
public
readonly
:
string
,
:
number
,
private
readonly
_getScrollContext
:
(
)
=>
,
private
readonly
_onWillChangeLineCount
:
(
:
string
)
=>
void
,
private
readonly
_onReplayMount
:
(
:
)
=>
void
,
=
0
,
:
=
'active'
,
=
createDefaultGeometryOscillation
(
)
,
=
0
,
=
0
,
=
createDefaultMountLineCounts
(
)
,
=
createDefaultUnmountLineCountReset
(
)
,
)
{
super
(
)
;
this
.
=
observableValue
(
this
,
)
;
this
.
=
observableValue
(
this
,
)
;
this
.
=
observableValue
(
this
,
)
;
this
.
=
derived
(
this
,
=>
this
.
.
read
(
)
+
this
.
.
read
(
)
+
this
.
.
read
(
)
)
;
this
.
=
derived
(
this
,
=>
lineCountToHeight
(
this
.
.
read
(
)
)
)
;
this
.
=
observableValue
(
this
,
)
;
this
.
=
observableValue < BindingPhase>
(
this
,
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue < GeometryChangeOrdering>
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
this
.
=
observableValue
(
this
,
.
)
;
}
setActualScrollOffset
(
:
number
,
:
)
:
void
{
this
.
.
set
(
,
)
;
}
setLineCount
(
:
number
,
:
)
:
void
{
this
.
.
set
(
normalizeLineCount
(
)
,
)
;
}
replayMount
(
)
:
void
{
this
.
_onReplayMount
(
this
)
;
}
scheduleGeometryUpdate
(
update
:
(
)
=>
void
)
:
void
{
this
.
.
=
.
scheduleAtNextAnimationFrame
(
this
.
getWindow
(
)
,
)
;
}
getWindow
(
)
:
{
return
.
getWindow
(
this
.
_getScrollContext
(
)
.
)
;
}
setMountLineCount
(
:
number
,
:
string
,
?
:
)
:
void
{
this
.
_onWillChangeLineCount
(
)
;
if
(
)
{
this
.
setLineCount
(
,
)
;
}
else
{
transaction
(
=>
this
.
setLineCount
(
,
)
)
;
}
}
resetLineCountAfterUnmount
(
:
)
:
void
{
if
(
this
.
.
get
(
)
)
{
this
.
setMountLineCount
(
this
.
.
get
(
)
,
` Item ${ this . label} resets line count after unmount `
,
)
;
}
}
}
class
FixtureBinding
extends
VirtualizedItemBinding< FixtureItem>
{
readonly
=
this
.
.
;
readonly
=
constObservable
(
{
:
0
}
)
;
readonly
=
constObservable
(
false
)
;
readonly
;
constructor
(
:
,
private
readonly
:
,
)
{
super
(
)
;
this
.
=
.
;
}
scheduleDelayedMeasurement
(
)
:
void
{
const
=
this
.
.
getWindow
(
)
;
const
=
.
setTimeout
(
(
)
=>
{
this
.
.
setMountLineCount
(
this
.
.
.
get
(
)
,
` Item ${ this . item. label} reports 200ms mount line count `
)
;
}
,
200
)
;
this
.
_register
(
toDisposable
(
(
)
=>
.
clearTimeout
(
)
)
)
;
}
render
(
:
,
:
number
,
:
number
,
:
)
:
void
{
if
(
this
.
.
.
get
(
)
===
'active'
)
{
transaction
(
=>
this
.
.
setActualScrollOffset
(
,
)
)
;
}
this
.
.
renderItem
(
this
.
,
,
,
,
)
;
}
hide
(
)
:
void
{
this
.
.
hide
(
)
;
}
dispose
(
)
:
void
{
if
(
this
.
.
)
{
return
;
}
this
.
.
unbind
(
this
.
)
;
super
.
dispose
(
)
;
}
}
class
FixtureTemplate
extends
VirtualizedItemTemplate< FixtureItem, FixtureBinding>
{
private
readonly
;
private
readonly
;
private
readonly
;
private
readonly
;
private
readonly
;
private
readonly
;
private
=
-
1
;
private
=
-
1
;
private
=
-
1
;
private
:
|
undefined
;
constructor
(
readonly
:
number
,
:
,
private
readonly
_onDidRebind
:
(
:
number
,
:
|
undefined
,
:
)
=>
void
,
)
{
super
(
)
;
this
.
=
.
append
(
.
,
.
$
(
'.multi-diff-scroll-fixture-row'
)
)
;
this
.
=
.
append
(
this
.
,
.
$
(
'.multi-diff-scroll-fixture-row-header'
)
)
;
this
.
=
.
append
(
this
.
,
.
$
(
'span.title'
)
)
;
this
.
=
.
append
(
this
.
,
.
$
(
'span.selection-proof'
)
)
;
this
.
.
=
` Persistent template # ${ id} text `
;
this
.
=
.
append
(
this
.
,
.
$
(
'span.state'
)
)
;
const
=
.
append
(
this
.
,
.
$
(
'.multi-diff-scroll-fixture-editor-viewport'
)
)
;
this
.
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-editor-content'
)
)
;
}
protected
createBinding
(
:
,
:
)
:
{
this
.
=
-
1
;
this
.
=
-
1
;
this
.
=
-
1
;
this
.
_onDidRebind
(
this
.
,
this
.
,
)
;
.
setMountLineCount
(
.
.
get
(
)
,
` Item ${ item. label} mounts with initial line count `
)
;
const
=
new
FixtureBinding
(
,
this
)
;
.
setMountLineCount
(
.
.
get
(
)
,
` Item ${ item. label} reports synchronous mount line count `
)
;
.
scheduleDelayedMeasurement
(
)
;
return
;
}
renderItem
(
:
,
:
,
:
number
,
:
number
,
:
)
:
void
{
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
if
(
!==
this
.
||
!==
this
.
||
!==
this
.
)
{
this
.
=
;
this
.
=
;
this
.
=
;
renderFakeEditorLines
(
this
.
,
.
,
,
,
)
;
}
this
.
.
.
=
'visible'
;
this
.
.
.
=
` ${ renderedRange. start} px `
;
this
.
.
.
=
` ${ renderedRange. length} px `
;
this
.
.
.
=
` ${ width - 16 } px `
;
this
.
.
.
toggle
(
'desynchronized'
,
!==
)
;
this
.
.
=
` Item ${ item. label} · template # ${ this . id} `
;
this
.
.
=
` ${ item. bindingPhase. get ( ) } · ${ formatNumber ( actualOffset) } / ${ formatNumber ( Math. max ( 0 , fullHeight - renderedRange. length) ) } `
;
const
=
.
-
;
const
=
.
max
(
0
,
.
min
(
.
-
.
,
)
)
;
this
.
.
.
=
` translateY( ${ headerOffset} px) `
;
this
.
.
.
toggle
(
'shadow'
,
>
0
||
>
0
)
;
this
.
.
.
toggle
(
'collapsed'
,
===
)
;
this
.
.
.
=
` ${ Math. max ( 0 , fullHeight - fixtureHeaderHeight) } px `
;
this
.
.
.
=
` translateY( ${ - actualOffset} px) `
;
}
hide
(
)
:
void
{
this
.
.
.
=
'-100000px'
;
this
.
.
.
=
'hidden'
;
}
unbind
(
:
)
:
void
{
this
.
hide
(
)
;
this
.
=
;
}
dispose
(
)
:
void
{
this
.
.
remove
(
)
;
super
.
dispose
(
)
;
}
}
class
MultiDiffScrollFixtureModel
extends
Disposable
{
readonly
=
observableValue
(
this
,
480
)
;
readonly
=
observableValue
(
this
,
430
)
;
readonly
=
observableValue
(
this
,
12
)
;
readonly
=
observableValue < 'mixed' | 'tall' | 'pooling' | 'measurement' >
(
this
,
'mixed'
)
;
readonly
=
observableValue < readonly FixtureItem[ ] >
(
this
,
[
]
)
;
readonly
=
observableValue < readonly IFixtureTransition[ ] >
(
this
,
[
]
)
;
readonly
=
observableValue < readonly string [ ] >
(
this
,
[
]
)
;
readonly
:
<
>
;
readonly
:
<
string
>
;
private
readonly
=
observableValue < CompressedVirtualizedScrollView< FixtureVirtualizedItem> | undefined >
(
this
,
undefined
)
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
private
readonly
=
this
.
_register
(
new
MutableDisposable< VirtualizedItemManager< FixtureItem, FixtureBinding, FixtureTemplate>>
(
)
)
;
private
:
|
undefined
;
private
=
1
;
private
:
|
undefined
;
private
=
'Initialize fixture'
;
constructor
(
)
{
super
(
)
;
transaction
(
=>
this
.
_replaceItems
(
[
createSerializedFixtureItem
(
'A'
,
12
)
,
createSerializedFixtureItem
(
'B'
,
54
)
,
createSerializedFixtureItem
(
'C'
,
18
)
,
createSerializedFixtureItem
(
'D'
,
44
)
,
]
,
)
)
;
this
.
=
derived
(
this
,
=>
this
.
.
read
(
)
?.
.
read
(
)
??
computeCompressedVirtualizedScrollLayout
(
{
:
this
.
.
read
(
)
,
:
this
.
.
read
(
)
,
:
this
.
.
read
(
)
,
:
this
.
.
read
(
)
.
map
(
=>
.
.
read
(
)
)
,
}
)
)
;
this
.
=
derived
(
this
,
=>
JSON
.
stringify
(
{
:
this
.
.
read
(
)
,
:
this
.
.
read
(
)
,
:
this
.
.
read
(
)
,
:
this
.
.
read
(
)
.
map
(
=>
(
{
:
.
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
{
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
}
,
:
{
:
.
.
read
(
)
,
:
.
.
read
(
)
,
}
,
:
{
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
:
.
.
read
(
)
,
}
,
}
)
)
,
}
,
undefined
,
'\t'
)
)
;
this
.
_register
(
autorunWithStore
(
(
,
)
=>
{
const
=
this
.
.
read
(
)
;
for
(
let
=
0
;
<
.
;
++
)
{
if
(
!
[
]
.
.
read
(
)
)
{
continue
;
}
const
=
[
]
.
getWindow
(
)
;
const
=
.
setInterval
(
(
)
=>
this
.
toggleItemGeometry
(
)
,
1000
)
;
.
add
(
toDisposable
(
(
)
=>
.
clearInterval
(
)
)
)
;
}
}
)
)
;
}
createVirtualizedItems
(
:
)
:
<
readonly
[
]
>
{
this
.
=
;
const
=
new
VirtualizedItemManager< FixtureItem, FixtureBinding, FixtureTemplate>
(
this
.
,
,
{
getId
:
=>
,
getTemplateId
:
(
)
=>
'fakeEditor'
,
getUnboundSize
:
=>
.
,
createTemplate
:
(
)
=>
new
FixtureTemplate
(
this
.
++
,
,
(
,
,
)
=>
{
this
.
_recordTemplateBinding
(
?
` Template # ${ id} rebound from Item ${ previousItem. label} to Item ${ item. label} `
:
` Template # ${ id} created for Item ${ item. label} `
)
;
}
)
,
onDidBind
:
(
,
)
=>
.
.
.
set
(
.
,
)
,
onWillUnbind
:
(
,
)
=>
{
.
.
.
set
(
undefined
,
)
;
.
.
resetLineCountAfterUnmount
(
)
;
}
,
}
)
;
this
.
.
=
;
return
.
;
}
attachScrollView
(
:
<
>
)
:
void
{
.
setScrollPosition
(
{
:
this
.
.
get
(
)
}
)
;
this
.
.
set
(
,
undefined
)
;
this
.
_register
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
this
.
.
set
(
.
,
undefined
)
;
if
(
this
.
)
{
const
:
=
{
:
this
.
,
:
.
-
this
.
.
,
:
.
.
-
this
.
.
.
,
:
.
-
this
.
.
,
:
.
-
this
.
.
-
(
.
.
-
this
.
.
.
)
-
(
.
-
this
.
.
)
,
}
;
this
.
.
set
(
[
...
this
.
.
read
(
undefined
)
.
slice
(
-
7
)
,
]
,
undefined
)
;
this
.
=
'Smooth scroll frame'
;
}
this
.
=
;
}
)
)
;
}
setScrollTop
(
:
number
,
=
'Set multi-diff scroll position'
,
=
true
)
:
void
{
this
.
=
;
this
.
.
get
(
)
?.
setScrollPosition
(
{
:
}
,
)
;
}
setViewportHeight
(
:
number
)
:
void
{
this
.
_commit
(
'Resize viewport'
,
=>
this
.
.
set
(
.
max
(
1
,
)
,
)
)
;
}
setItemGap
(
:
number
)
:
void
{
this
.
_commit
(
'Change item gap'
,
=>
this
.
.
set
(
.
max
(
0
,
)
,
)
)
;
}
setItemLineCount
(
:
number
,
:
number
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
this
.
_commit
(
` Change item ${ item. label} line count `
,
=>
.
setLineCount
(
,
)
)
;
}
setMountLineCount
(
:
number
,
:
keyof
,
:
number
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
const
=
normalizeLineCount
(
)
;
this
.
_commit
(
` Set item ${ item. label} ${ phase} mount line count `
,
=>
{
switch
(
)
{
case
'initial'
:
.
.
set
(
,
)
;
break
;
case
'immediate'
:
.
.
set
(
,
)
;
break
;
case
'after200ms'
:
.
.
set
(
,
)
;
break
;
}
}
)
;
}
setUnmountLineCountResetEnabled
(
:
number
,
:
boolean
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
this
.
_commit
(
` ${ enabled ? 'Enable' : 'Disable' } item ${ item. label} unmount reset `
,
=>
.
.
set
(
,
)
)
;
}
setUnmountedLineCount
(
:
number
,
:
number
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
this
.
_commit
(
` Set item ${ item. label} unmounted line count `
,
=>
.
.
set
(
normalizeLineCount
(
)
,
)
)
;
}
replayItemMount
(
:
number
)
:
void
{
this
.
.
get
(
)
[
]
?.
replayMount
(
)
;
}
private
_rebind
(
:
)
:
void
{
this
.
.
?.
.
get
(
)
.
find
(
=>
.
===
)
?.
rebind
(
)
;
}
setBindingPhase
(
:
number
,
:
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
this
.
_commit
(
` Set item ${ item. label} phase to ${ phase} `
,
=>
{
.
.
set
(
,
)
;
if
(
===
'active'
)
{
.
setActualScrollOffset
(
.
.
get
(
)
,
)
;
}
}
)
;
}
setEditorScrollOffset
(
:
number
,
:
number
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
const
=
this
.
.
get
(
)
.
[
]
;
const
=
.
max
(
0
,
.
min
(
,
.
)
)
;
this
.
=
` Editor ${ item. label} reports scroll position `
;
transaction
(
=>
.
setActualScrollOffset
(
,
)
)
;
}
setGeometryOscillationEnabled
(
:
number
,
:
boolean
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
this
.
_commit
(
` ${ enabled ? 'Start' : 'Stop' } item ${ item. label} geometry oscillation `
,
=>
.
.
set
(
,
)
)
;
}
setGeometryOscillationLineCount
(
:
number
,
:
'top'
|
'bottom'
,
:
'A'
|
'B'
,
:
number
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
const
=
normalizeLineCount
(
)
;
this
.
_commit
(
` Set item ${ item. label} oscillation ${ edge} line count ${ target} `
,
=>
{
const
=
===
'top'
?
===
'A'
?
.
:
.
:
===
'A'
?
.
:
.
;
.
set
(
,
)
;
}
)
;
}
setGeometryChangeOrdering
(
:
number
,
:
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
this
.
_commit
(
` Set item ${ item. label} geometry change ordering `
,
=>
.
.
set
(
,
)
)
;
}
toggleItemGeometry
(
:
number
)
:
void
{
const
=
this
.
.
get
(
)
[
]
;
if
(
!
)
{
return
;
}
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
.
get
(
)
;
const
=
.
abs
(
-
)
+
.
abs
(
-
)
;
const
=
.
abs
(
-
)
+
.
abs
(
-
)
;
const
=
<=
?
:
;
const
=
<=
?
:
;
const
=
-
;
const
=
lineCountToHeight
(
.
.
get
(
)
+
+
)
;
const
=
.
.
get
(
)
;
const
=
.
max
(
0
,
-
.
min
(
,
this
.
.
get
(
)
)
)
;
const
=
.
max
(
0
,
.
min
(
>
0
?
+
*
:
,
,
)
)
;
const
setLines
=
(
)
=>
this
.
_commit
(
` Item ${ item. label} changes top and bottom lines `
,
=>
{
.
.
set
(
,
)
;
.
.
set
(
,
)
;
}
)
;
const
setOffset
=
(
)
=>
this
.
_commit
(
` Item ${ item. label} viewport moves to ${ targetOffset} `
,
=>
.
setActualScrollOffset
(
,
)
)
;
switch
(
.
.
get
(
)
)
{
case
'atomic'
:
this
.
_commit
(
` Item ${ item. label} geometry changes atomically `
,
=>
{
.
.
set
(
,
)
;
.
.
set
(
,
)
;
.
setActualScrollOffset
(
,
)
;
}
)
;
break
;
case
'lines-first'
:
setLines
(
)
;
.
scheduleGeometryUpdate
(
)
;
break
;
case
'offset-first'
:
setOffset
(
)
;
.
scheduleGeometryUpdate
(
)
;
break
;
}
}
applyScenario
(
:
'mixed'
|
'tall'
|
'pooling'
|
'measurement'
)
:
void
{
const
=
{
:
{
:
480
,
:
430
,
:
[
createSerializedFixtureItem
(
'A'
,
12
)
,
createSerializedFixtureItem
(
'B'
,
54
)
,
createSerializedFixtureItem
(
'C'
,
18
)
,
createSerializedFixtureItem
(
'D'
,
44
)
]
}
,
:
{
:
480
,
:
720
,
:
[
createSerializedFixtureItem
(
'A'
,
5
)
,
createSerializedFixtureItem
(
'B'
,
89
)
,
createSerializedFixtureItem
(
'C'
,
8
)
,
createSerializedFixtureItem
(
'D'
,
12
)
]
}
,
:
{
:
420
,
:
0
,
:
Array
.
from
(
{
:
20
}
,
(
,
)
=>
createSerializedFixtureItem
(
.
fromCharCode
(
'A'
.
charCodeAt
(
0
)
+
)
,
[
8
,
37
,
11
,
48
,
15
]
[
%
5
]
,
)
)
,
}
,
:
{
:
500
,
:
200
,
:
[
createSerializedFixtureItem
(
'Estimate A'
,
12
,
'active'
,
{
:
12
,
:
25
,
:
44
}
)
,
createSerializedFixtureItem
(
'Estimate B'
,
20
,
'active'
,
{
:
20
,
:
37
,
:
54
}
)
,
createSerializedFixtureItem
(
'Measured C'
,
59
)
,
createSerializedFixtureItem
(
'Measured D'
,
16
)
,
]
,
}
,
}
;
const
=
[
]
;
this
.
_commit
(
` Apply ${ scenario} scenario `
,
=>
{
this
.
.
set
(
,
)
;
this
.
.
set
(
.
,
)
;
this
.
.
set
(
.
,
)
;
this
.
.
set
(
[
]
,
)
;
this
.
_replaceItems
(
.
,
)
;
}
)
;
this
.
.
get
(
)
?.
setScrollPosition
(
{
:
.
}
)
;
}
scrollOneViewport
(
)
:
void
{
this
.
setScrollTop
(
this
.
.
get
(
)
+
this
.
.
get
(
)
,
'Scroll one viewport'
)
;
}
applyBatchedGeometryChange
(
)
:
void
{
this
.
_commit
(
'Apply batched geometry change'
,
=>
{
const
=
this
.
.
get
(
)
;
if
(
[
0
]
)
{
[
0
]
.
setLineCount
(
[
0
]
.
.
get
(
)
+
12
,
)
;
}
if
(
[
2
]
)
{
[
2
]
.
setLineCount
(
[
2
]
.
.
get
(
)
-
5
,
)
;
}
this
.
.
set
(
this
.
.
get
(
)
+
40
,
)
;
}
)
;
}
applySerializedState
(
:
string
)
:
void
{
const
=
parseSerializedFixtureState
(
)
;
this
.
_commit
(
'Import JSON state'
,
=>
{
this
.
.
set
(
.
,
)
;
this
.
.
set
(
.
,
)
;
this
.
_replaceItems
(
.
,
)
;
}
)
;
this
.
.
get
(
)
?.
setScrollPosition
(
{
:
.
}
)
;
}
private
_commit
(
:
string
,
update
:
(
:
)
=>
void
)
:
void
{
this
.
=
;
transaction
(
)
;
}
private
_recordTemplateBinding
(
:
string
)
:
void
{
this
.
.
set
(
[
...
this
.
.
get
(
)
.
slice
(
-
7
)
,
]
,
undefined
)
;
}
private
_replaceItems
(
:
readonly
[
]
,
:
)
:
void
{
this
.
.
clear
(
)
;
this
.
.
set
(
.
map
(
=>
this
.
.
add
(
new
FixtureItem
(
.
,
.
,
(
)
=>
{
if
(
!
this
.
)
{
throw
new
Error
(
'Scroll context is not attached.'
)
;
}
return
this
.
;
}
,
=>
this
.
=
,
=>
this
.
_rebind
(
)
,
.
,
.
,
.
??
createDefaultGeometryOscillation
(
)
,
.
,
.
,
.
??
createDefaultMountLineCounts
(
.
)
,
.
??
createDefaultUnmountLineCountReset
(
.
)
,
)
)
)
,
)
;
}
dispose
(
)
:
void
{
this
.
.
get
(
)
?.
dispose
(
)
;
this
.
.
set
(
undefined
,
undefined
)
;
super
.
dispose
(
)
;
}
}
type
FixtureVirtualizedItem
=
<
,
,
>
;
function
createSerializedFixtureItem
(
:
string
,
:
number
,
:
=
'active'
,
=
createDefaultMountLineCounts
(
)
,
)
:
{
return
{
,
,
:
0
,
,
,
}
;
}
type
JsonValue
=
null
|
boolean
|
number
|
string
|
readonly
[
]
|
{
readonly
[
:
string
]
:
}
;
function
parseSerializedFixtureState
(
:
string
)
:
{
const
:
=
JSON
.
parse
(
)
;
if
(
!
isJsonObject
(
)
)
{
throw
new
Error
(
'Fixture state must be a JSON object.'
)
;
}
const
=
[
'items'
]
;
if
(
!
Array
.
isArray
(
)
)
{
throw
new
Error
(
'Fixture state must contain an items array.'
)
;
}
if
(
.
===
0
)
{
throw
new
Error
(
'Fixture state must contain at least one item.'
)
;
}
return
{
:
readNonNegativeNumber
(
,
'viewportHeight'
,
false
)
,
:
readNonNegativeNumber
(
,
'scrollTop'
,
true
)
,
:
readNonNegativeNumber
(
,
'itemGap'
,
true
)
,
:
.
map
(
(
,
)
=>
parseSerializedFixtureItem
(
,
)
)
,
}
;
}
function
parseSerializedFixtureItem
(
:
,
:
number
)
:
{
if
(
!
isJsonObject
(
)
)
{
throw
new
Error
(
` items[ ${ index} ] must be a JSON object. `
)
;
}
const
=
[
'bindingPhase'
]
;
if
(
!
isBindingPhase
(
)
)
{
throw
new
Error
(
` items[ ${ index} ].bindingPhase must be unbound, binding, projecting, or active. `
)
;
}
const
=
` items[ ${ index} ] `
;
const
=
[
'lineCount'
]
===
undefined
?
heightToLineCount
(
readNonNegativeNumber
(
,
'fullHeight'
,
true
,
)
)
:
readNonNegativeInteger
(
,
'lineCount'
,
)
;
const
=
[
'geometryOscillation'
]
;
const
=
===
undefined
?
createDefaultGeometryOscillation
(
)
:
parseSerializedGeometryOscillation
(
,
,
)
;
const
=
[
'topLineCount'
]
;
const
=
[
'bottomLineCount'
]
;
const
=
[
'contentTopInset'
]
;
const
=
[
'mountLineCounts'
]
;
const
=
[
'mountHeights'
]
;
const
=
[
'unmountLineCountReset'
]
;
return
{
:
readString
(
,
'label'
,
)
,
,
:
readNonNegativeNumber
(
,
'actualScrollOffset'
,
true
,
)
,
,
:
===
undefined
?
===
undefined
?
0
:
.
round
(
readNonNegativeNumber
(
,
'contentTopInset'
,
true
,
)
/
)
:
readNonNegativeInteger
(
,
'topLineCount'
,
)
,
:
===
undefined
?
0
:
readNonNegativeInteger
(
,
'bottomLineCount'
,
)
,
:
!==
undefined
?
parseSerializedMountLineCounts
(
,
,
false
)
:
!==
undefined
?
parseSerializedMountLineCounts
(
,
,
true
)
:
createDefaultMountLineCounts
(
)
,
:
===
undefined
?
createDefaultUnmountLineCountReset
(
)
:
parseSerializedUnmountLineCountReset
(
,
)
,
,
}
;
}
function
parseSerializedMountLineCounts
(
:
,
:
number
,
:
boolean
)
:
{
const
=
` items[ ${ index} ]. ${ legacyHeights ? 'mountHeights' : 'mountLineCounts' } `
;
if
(
!
isJsonObject
(
)
)
{
throw
new
Error
(
` ${ path} must be a JSON object. `
)
;
}
return
{
:
?
heightToLineCount
(
readNonNegativeNumber
(
,
'initial'
,
true
,
)
)
:
readNonNegativeInteger
(
,
'initial'
,
)
,
:
?
heightToLineCount
(
readNonNegativeNumber
(
,
'immediate'
,
true
,
)
)
:
readNonNegativeInteger
(
,
'immediate'
,
)
,
:
?
heightToLineCount
(
readNonNegativeNumber
(
,
'after200ms'
,
true
,
)
)
:
readNonNegativeInteger
(
,
'after200ms'
,
)
,
}
;
}
function
parseSerializedUnmountLineCountReset
(
:
,
:
number
)
:
{
const
=
` items[ ${ index} ].unmountLineCountReset `
;
if
(
!
isJsonObject
(
)
)
{
throw
new
Error
(
` ${ path} must be a JSON object. `
)
;
}
return
{
:
readBoolean
(
,
'enabled'
,
)
,
:
readNonNegativeInteger
(
,
'lineCount'
,
)
,
}
;
}
function
parseSerializedGeometryOscillation
(
:
,
:
number
,
:
number
)
:
{
const
=
` items[ ${ index} ].geometryOscillation `
;
if
(
!
isJsonObject
(
)
)
{
throw
new
Error
(
` ${ path} must be a JSON object. `
)
;
}
const
=
[
'ordering'
]
;
if
(
!
isGeometryChangeOrdering
(
)
)
{
throw
new
Error
(
` ${ path} .ordering must be atomic, lines-first, or offset-first. `
)
;
}
const
=
===
'height-first'
?
'lines-first'
:
;
if
(
[
'topLineCountA'
]
!==
undefined
)
{
return
{
:
readBoolean
(
,
'enabled'
,
)
,
:
readNonNegativeInteger
(
,
'topLineCountA'
,
)
,
:
readNonNegativeInteger
(
,
'topLineCountB'
,
)
,
:
readNonNegativeInteger
(
,
'bottomLineCountA'
,
)
,
:
readNonNegativeInteger
(
,
'bottomLineCountB'
,
)
,
:
,
}
;
}
const
=
[
'location'
]
;
if
(
!==
'above'
&&
!==
'below'
)
{
throw
new
Error
(
` ${ path} .location must be above or below when importing legacy height geometry. `
)
;
}
const
=
heightToLineCount
(
readNonNegativeNumber
(
,
'heightA'
,
false
,
)
)
;
const
=
heightToLineCount
(
readNonNegativeNumber
(
,
'heightB'
,
false
,
)
)
;
const
=
.
max
(
0
,
-
)
;
const
=
.
max
(
0
,
-
)
;
return
{
:
readBoolean
(
,
'enabled'
,
)
,
:
===
'above'
?
:
0
,
:
===
'above'
?
:
0
,
:
===
'below'
?
:
0
,
:
===
'below'
?
:
0
,
:
,
}
;
}
function
isJsonObject
(
:
)
:
is
{
readonly
[
:
string
]
:
}
{
return
typeof
===
'object'
&&
!==
null
&&
!
Array
.
isArray
(
)
;
}
function
isBindingPhase
(
:
|
undefined
)
:
is
{
return
===
'unbound'
||
===
'binding'
||
===
'projecting'
||
===
'active'
;
}
function
isGeometryChangeOrdering
(
:
|
undefined
)
:
is
|
'height-first'
{
return
===
'atomic'
||
===
'lines-first'
||
===
'height-first'
||
===
'offset-first'
;
}
function
readNonNegativeNumber
(
:
{
readonly
[
:
string
]
:
}
,
:
string
,
:
boolean
,
=
'fixture'
)
:
number
{
const
=
[
]
;
const
=
?
0
:
.
MIN_VALUE
;
if
(
typeof
!==
'number'
||
!
.
isFinite
(
)
||
<
)
{
throw
new
Error
(
` ${ path} . ${ key} must be a finite number ${ allowZero ? 'greater than or equal to zero' : 'greater than zero' } . `
)
;
}
return
;
}
function
readNonNegativeInteger
(
:
{
readonly
[
:
string
]
:
}
,
:
string
,
:
string
)
:
number
{
const
=
[
]
;
if
(
typeof
!==
'number'
||
!
.
isInteger
(
)
||
<
0
)
{
throw
new
Error
(
` ${ path} . ${ key} must be a non-negative integer. `
)
;
}
return
;
}
function
normalizeLineCount
(
:
number
)
:
number
{
return
.
max
(
0
,
.
round
(
)
)
;
}
function
lineCountToHeight
(
:
number
)
:
number
{
return
+
normalizeLineCount
(
)
*
;
}
function
heightToLineCount
(
:
number
)
:
number
{
return
normalizeLineCount
(
.
max
(
0
,
-
)
/
)
;
}
function
readString
(
:
{
readonly
[
:
string
]
:
}
,
:
string
,
:
string
)
:
string
{
const
=
[
]
;
if
(
typeof
!==
'string'
||
.
===
0
)
{
throw
new
Error
(
` ${ path} . ${ key} must be a non-empty string. `
)
;
}
return
;
}
function
readBoolean
(
:
{
readonly
[
:
string
]
:
}
,
:
string
,
:
string
)
:
boolean
{
const
=
[
]
;
if
(
typeof
!==
'boolean'
)
{
throw
new
Error
(
` ${ path} . ${ key} must be a boolean. `
)
;
}
return
;
}
const
:
=
{
:
'var(--vscode-button-background)'
,
:
'var(--vscode-button-hoverBackground)'
,
:
'var(--vscode-button-separator)'
,
:
'var(--vscode-button-foreground)'
,
:
'var(--vscode-button-secondaryBackground)'
,
:
'var(--vscode-button-secondaryHoverBackground)'
,
:
'var(--vscode-button-secondaryForeground)'
,
:
'var(--vscode-button-border)'
,
:
'var(--vscode-button-secondaryBorder)'
,
}
;
export
default
defineThemedFixtureGroup
(
{
:
'editor/multiDiff/'
}
,
{
:
defineComponentFixture
(
{
:
{
:
'screenshot'
}
,
:
[
'A controllable multi-diff scroll model with form controls, a virtualized fake-editor viewport, coordinate diagrams, and an invariant inspector.'
,
'The conservation equation is shown as multi-diff scroll position equals rendered scroll position plus hidden content height.'
,
]
,
:
,
}
)
,
:
defineComponentFixture
(
{
:
{
:
'screenshot'
}
,
:
[
'A 20-item mixed-line-count scenario rendered through the production VirtualizedItemManager with only the visible fake editor bound.'
,
'The template pool log shows a template moving from an earlier item to the currently visible item without stale line content.'
,
]
,
render
:
=>
renderMultiDiffScrollFixture
(
,
'pooling'
,
1600
)
,
}
)
,
:
defineComponentFixture
(
{
:
{
:
'screenshot'
}
,
:
[
'The real MultiDiffEditorWidget next to the same complete-content and compressed-rendering coordinate visualization used by the fake stress fixture.'
,
'The diagnostics show the current layout revision and global leading and trailing scroll slack.'
,
]
,
:
,
}
)
,
}
)
;
function
renderMultiDiffScrollFixture
(
{
,
}
:
,
?
:
'mixed'
|
'tall'
|
'pooling'
|
'measurement'
,
?
:
number
,
)
:
void
{
.
.
add
(
'multi-diff-scroll-fixture'
)
;
const
=
.
add
(
new
MultiDiffScrollFixtureModel
(
)
)
;
if
(
)
{
.
applyScenario
(
)
;
}
const
=
.
append
(
,
.
$
(
'h1.multi-diff-scroll-fixture-title'
)
)
;
.
=
'Multi-diff scroll model'
;
const
=
.
append
(
,
.
$
(
'p.multi-diff-scroll-fixture-description'
)
)
;
.
=
'The production compacted virtualized scroll view and item manager render controllable fake templates, including mount-time line-count changes, the real scrollbar, smooth scrolling, layout projection, strict template rebinding, and delayed measurements.'
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-columns'
)
)
;
const
=
.
append
(
,
.
$
(
'section.multi-diff-scroll-fixture-panel.controls'
)
)
;
const
=
.
append
(
,
.
$
(
'main.multi-diff-scroll-fixture-visualization'
)
)
;
const
=
.
append
(
,
.
$
(
'section.multi-diff-scroll-fixture-panel.inspector'
)
)
;
renderControls
(
,
,
)
;
renderVisualization
(
,
,
)
;
renderInspector
(
,
,
)
;
if
(
!==
undefined
)
{
.
setScrollTop
(
,
'Initialize scrolled template-pool fixture'
,
false
)
;
}
}
function
renderRealMultiDiffScrollFixture
(
{
,
,
,
}
:
)
:
void
{
const
=
480
;
const
=
540
;
.
.
add
(
'multi-diff-scroll-fixture'
,
'real-widget'
)
;
const
=
.
append
(
,
.
$
(
'h1.multi-diff-scroll-fixture-title'
)
)
;
.
=
'Real multi-diff virtualized layout'
;
const
=
.
append
(
,
.
$
(
'p.multi-diff-scroll-fixture-description'
)
)
;
.
=
'The production MultiDiffEditorWidget renders through the same compacted layout and strict item-binding infrastructure shown by the coordinate visualization.'
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-columns'
)
)
;
const
=
.
append
(
,
.
$
(
'main.multi-diff-scroll-fixture-visualization'
)
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-editor-pane'
)
)
;
appendSectionHeading
(
,
'Real MultiDiffEditorWidget'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-viewport'
)
)
;
.
.
=
` ${ viewportWidth} px `
;
.
.
=
` ${ viewportHeight} px `
;
.
setAttribute
(
'aria-label'
,
'Real multi-diff editor'
)
;
const
=
createMultiDiffEditorFixtureServices
(
,
,
new
TestDiffProviderFactoryService
(
)
)
;
const
=
.
add
(
new
DisposableStore
(
)
)
;
const
{
,
,
}
=
createMultiDiffEditorFixtureDocuments
(
,
)
;
const
=
.
add
(
createMultiDiffEditorFixtureWidget
(
,
)
)
;
const
:
=
{
:
.
const
(
[
,
,
]
)
,
}
;
const
=
.
add
(
.
createViewModel
(
)
)
;
.
setViewModel
(
)
;
.
layout
(
new
dom
.
Dimension
(
,
)
)
;
.
add
(
toDisposable
(
(
)
=>
.
setViewModel
(
undefined
)
)
)
;
const
=
derived
(
,
=>
{
const
=
.
getLayoutDebugState
(
)
.
read
(
)
;
return
{
:
{
:
.
.
,
:
.
.
,
:
toCoordinateRange
(
.
.
)
,
:
toCoordinateRange
(
.
.
)
,
:
.
.
map
(
=>
(
{
:
toCoordinateRange
(
.
.
)
,
:
toCoordinateRange
(
.
.
)
,
:
.
.
,
}
)
)
,
}
,
:
.
.
map
(
=>
(
{
:
.
,
:
.
?
'bound'
:
undefined
,
}
)
)
,
}
;
}
)
;
renderCoordinateVisualization
(
,
constObservable
(
)
,
,
)
;
const
=
.
append
(
,
.
$
(
'pre.multi-diff-scroll-fixture-real-diagnostics'
)
)
;
.
=
0
;
.
setAttribute
(
'aria-label'
,
'Current multi-diff layout revision and scroll slack'
)
;
.
add
(
autorun
(
=>
{
const
=
.
getLayoutDebugState
(
)
.
read
(
)
;
.
=
JSON
.
stringify
(
{
:
.
.
,
:
.
.
,
:
.
.
,
:
.
.
,
:
.
.
,
:
.
,
}
,
undefined
,
'\t'
)
;
}
)
)
;
}
function
toCoordinateRange
(
:
{
readonly
:
number
;
readonly
:
number
}
)
:
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
}
{
return
{
...
,
:
.
-
.
}
;
}
function
renderControls
(
:
,
:
,
:
)
:
void
{
appendSectionHeading
(
,
'Controls'
)
;
const
=
observableValue < 'form' | 'json' >
(
,
'form'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-tabs'
)
)
;
.
setAttribute
(
'role'
,
'tablist'
)
;
.
setAttribute
(
'aria-label'
,
'Fixture state editor'
)
;
const
=
appendButton
(
,
'Form'
,
(
)
=>
.
set
(
'form'
,
undefined
)
,
,
true
)
;
const
=
appendButton
(
,
'JSON'
,
(
)
=>
.
set
(
'json'
,
undefined
)
,
,
true
)
;
.
.
setAttribute
(
'role'
,
'tab'
)
;
.
.
setAttribute
(
'role'
,
'tab'
)
;
.
add
(
.
addDisposableListener
(
,
.
.
KEY_DOWN
,
=>
{
if
(
.
!==
'ArrowLeft'
&&
.
!==
'ArrowRight'
)
{
return
;
}
.
preventDefault
(
)
;
const
=
.
get
(
)
===
'form'
?
'json'
:
'form'
;
.
set
(
,
undefined
)
;
(
===
'form'
?
:
)
.
.
focus
(
)
;
}
)
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-tab-panel'
)
)
;
.
setAttribute
(
'role'
,
'tabpanel'
)
;
.
setAttribute
(
'aria-label'
,
'Form'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-tab-panel'
)
)
;
.
setAttribute
(
'role'
,
'tabpanel'
)
;
.
setAttribute
(
'aria-label'
,
'JSON'
)
;
.
add
(
autorun
(
=>
{
const
=
.
read
(
)
;
.
=
!==
'form'
;
.
=
!==
'json'
;
.
.
setAttribute
(
'aria-selected'
,
String
(
===
'form'
)
)
;
.
.
setAttribute
(
'aria-selected'
,
String
(
===
'json'
)
)
;
.
.
=
===
'form'
?
0
:
-
1
;
.
.
=
===
'json'
?
0
:
-
1
;
}
)
)
;
const
=
.
append
(
,
.
$
(
'label.multi-diff-scroll-fixture-field'
)
)
;
.
append
(
,
.
$
(
'span'
)
)
.
=
'Scenario'
;
const
=
.
append
(
,
.
$
(
'select'
)
)
as
;
for
(
const
[
,
]
of
[
[
'mixed'
,
'Mixed line counts'
]
,
[
'tall'
,
'Tall item'
]
,
[
'pooling'
,
'20-item template pool'
]
,
[
'measurement'
,
'Estimated line counts'
]
]
as
const
)
{
const
=
.
append
(
,
.
$
(
'option'
)
)
as
;
.
=
;
.
=
;
}
.
add
(
.
addDisposableListener
(
,
.
.
CHANGE
,
(
)
=>
.
applyScenario
(
.
as
'mixed'
|
'tall'
|
'pooling'
|
'measurement'
)
)
)
;
.
add
(
autorun
(
=>
{
.
=
.
.
read
(
)
;
}
)
)
;
appendNumberField
(
,
'Viewport height'
,
.
,
=>
.
setViewportHeight
(
)
,
)
;
appendNumberField
(
,
'Multi-diff scroll top'
,
.
,
=>
.
setScrollTop
(
)
,
)
;
appendNumberField
(
,
'Item gap'
,
.
,
=>
.
setItemGap
(
)
,
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-button-row'
)
)
;
for
(
const
of
[
-
100
,
-
10
,
-
1
,
1
,
10
,
100
]
)
{
appendButton
(
,
` ${ delta > 0 ? '+' : '' } ${ delta} `
,
(
)
=>
.
setScrollTop
(
.
.
get
(
)
+
,
` Scroll multi-diff by ${ delta} `
)
,
,
true
)
;
}
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-button-column'
)
)
;
appendButton
(
,
'Apply Batched Geometry Change'
,
(
)
=>
.
applyBatchedGeometryChange
(
)
,
)
;
appendButton
(
,
'Scroll One Viewport'
,
(
)
=>
.
scrollOneViewport
(
)
,
,
true
)
;
appendSectionHeading
(
,
'Fake editor items'
)
;
const
=
.
append
(
,
.
$
(
'p.multi-diff-scroll-fixture-json-description'
)
)
;
.
=
'Each pooled template mount uses its initial line count, synchronously reports its immediate line count, then reports its delayed line count after 200ms.'
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-item-controls-list'
)
)
;
.
add
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
.
replaceChildren
(
)
;
for
(
let
=
0
;
<
.
;
++
)
{
renderItemControls
(
,
,
[
]
,
,
.
)
;
}
}
)
)
;
const
=
.
append
(
,
.
$
(
'p.multi-diff-scroll-fixture-json-description'
)
)
;
.
=
'Edit the complete fixture state. Copy this JSON to export a scenario, or paste JSON and apply it to import one.'
;
const
=
.
append
(
,
.
$
(
'textarea.multi-diff-scroll-fixture-json-editor'
)
)
as
;
.
setAttribute
(
'aria-label'
,
'Fixture state JSON'
)
;
.
=
false
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-json-error'
)
)
;
.
setAttribute
(
'role'
,
'alert'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-button-column'
)
)
;
appendButton
(
,
'Apply JSON'
,
(
)
=>
{
try
{
.
applySerializedState
(
.
)
;
.
=
.
.
get
(
)
;
.
=
''
;
}
catch
(
)
{
.
=
getErrorMessage
(
)
;
}
}
,
)
;
appendButton
(
,
'Refresh From State'
,
(
)
=>
{
.
=
.
.
get
(
)
;
.
=
''
;
}
,
,
true
)
;
appendButton
(
,
'Select All JSON'
,
(
)
=>
{
.
focus
(
)
;
.
select
(
)
;
}
,
,
true
)
;
.
add
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
if
(
.
getActiveElement
(
)
!==
)
{
.
=
;
}
}
)
)
;
}
function
renderItemControls
(
:
,
:
,
:
,
:
number
,
:
)
:
void
{
const
=
.
append
(
,
.
$
(
'fieldset.multi-diff-scroll-fixture-item-controls'
)
)
;
const
=
.
append
(
,
.
$
(
'legend'
)
)
;
.
add
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
.
=
` Item ${ item. label} · ${ templateId === undefined ? 'pool unbound' : ` template # ${ templateId} ` } `
;
}
)
)
;
appendNumberField
(
,
'Line count'
,
.
,
=>
.
setItemLineCount
(
,
)
,
)
;
appendNumberField
(
,
'Initial mount line count'
,
.
,
=>
.
setMountLineCount
(
,
'initial'
,
)
,
)
;
appendNumberField
(
,
'Synchronous mount line count'
,
.
,
=>
.
setMountLineCount
(
,
'immediate'
,
)
,
)
;
appendNumberField
(
,
'Mount line count after 200ms'
,
.
,
=>
.
setMountLineCount
(
,
'after200ms'
,
)
,
)
;
appendNumberField
(
,
'Actual editor offset'
,
.
,
=>
.
setEditorScrollOffset
(
,
)
,
)
;
const
=
.
append
(
,
.
$
(
'label.multi-diff-scroll-fixture-checkbox-field'
)
)
;
const
=
.
append
(
,
.
$
(
'input'
)
)
as
;
.
=
'checkbox'
;
.
append
(
,
.
$
(
'span'
)
)
.
=
'Reset line count after unmount'
;
.
add
(
.
addDisposableListener
(
,
.
.
CHANGE
,
(
)
=>
.
setUnmountLineCountResetEnabled
(
,
.
)
)
)
;
.
add
(
autorun
(
=>
{
.
=
.
.
read
(
)
;
}
)
)
;
appendNumberField
(
,
'Unmounted line count'
,
.
,
=>
.
setUnmountedLineCount
(
,
)
,
)
;
const
=
.
append
(
,
.
$
(
'label.multi-diff-scroll-fixture-field'
)
)
;
.
append
(
,
.
$
(
'span'
)
)
.
=
'Binding phase'
;
const
=
.
append
(
,
.
$
(
'select'
)
)
as
;
for
(
const
of
[
'unbound'
,
'binding'
,
'projecting'
,
'active'
]
as
const
)
{
const
=
.
append
(
,
.
$
(
'option'
)
)
as
;
.
=
;
.
=
;
}
.
add
(
.
addDisposableListener
(
,
.
.
CHANGE
,
(
)
=>
.
setBindingPhase
(
,
.
as
)
)
)
;
.
add
(
autorun
(
=>
{
.
=
.
.
read
(
)
;
}
)
)
;
const
=
.
append
(
,
.
$
(
'label.multi-diff-scroll-fixture-checkbox-field'
)
)
;
const
=
.
append
(
,
.
$
(
'input'
)
)
as
;
.
=
'checkbox'
;
.
append
(
,
.
$
(
'span'
)
)
.
=
'Oscillate geometry every second'
;
.
add
(
.
addDisposableListener
(
,
.
.
CHANGE
,
(
)
=>
.
setGeometryOscillationEnabled
(
,
.
)
)
)
;
.
add
(
autorun
(
=>
{
.
=
.
.
read
(
)
;
}
)
)
;
appendNumberField
(
,
'Top lines A'
,
.
,
=>
.
setGeometryOscillationLineCount
(
,
'top'
,
'A'
,
)
,
)
;
appendNumberField
(
,
'Top lines B'
,
.
,
=>
.
setGeometryOscillationLineCount
(
,
'top'
,
'B'
,
)
,
)
;
appendNumberField
(
,
'Bottom lines A'
,
.
,
=>
.
setGeometryOscillationLineCount
(
,
'bottom'
,
'A'
,
)
,
)
;
appendNumberField
(
,
'Bottom lines B'
,
.
,
=>
.
setGeometryOscillationLineCount
(
,
'bottom'
,
'B'
,
)
,
)
;
const
=
.
append
(
,
.
$
(
'label.multi-diff-scroll-fixture-field'
)
)
;
.
append
(
,
.
$
(
'span'
)
)
.
=
'Delivery ordering'
;
const
=
.
append
(
,
.
$
(
'select'
)
)
as
;
for
(
const
[
,
]
of
[
[
'atomic'
,
'Atomic'
]
,
[
'lines-first'
,
'Lines, then offset'
]
,
[
'offset-first'
,
'Offset, then lines'
]
]
as
const
)
{
const
=
.
append
(
,
.
$
(
'option'
)
)
as
;
.
=
;
.
=
;
}
.
add
(
.
addDisposableListener
(
,
.
.
CHANGE
,
(
)
=>
.
setGeometryChangeOrdering
(
,
.
as
)
)
)
;
.
add
(
autorun
(
=>
{
.
=
.
.
read
(
)
;
}
)
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-button-row'
)
)
;
const
=
appendButton
(
,
'Replay Mount'
,
(
)
=>
.
replayItemMount
(
)
,
,
true
)
;
.
add
(
autorun
(
=>
{
.
=
.
.
read
(
)
!==
undefined
;
}
)
)
;
appendButton
(
,
'Editor −100'
,
(
)
=>
.
setEditorScrollOffset
(
,
.
.
get
(
)
-
100
)
,
,
true
)
;
appendButton
(
,
'Editor +100'
,
(
)
=>
.
setEditorScrollOffset
(
,
.
.
get
(
)
+
100
)
,
,
true
)
;
appendButton
(
,
'Jump Once'
,
(
)
=>
.
toggleItemGeometry
(
)
,
,
true
)
;
}
function
renderVisualization
(
:
,
:
,
:
)
:
void
{
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-editor-pane'
)
)
;
appendSectionHeading
(
,
'Virtualized fake editors'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-viewport'
)
)
;
.
=
0
;
.
setAttribute
(
'aria-label'
,
'Virtualized multi-diff viewport. Use the arrow keys or mouse wheel to scroll.'
)
;
const
=
derived
(
,
=>
new
dom
.
Dimension
(
500
,
.
.
read
(
)
)
)
;
const
=
.
add
(
new
CompressedVirtualizedScrollView
(
,
,
.
,
=>
.
createVirtualizedItems
(
)
,
)
)
;
.
.
.
add
(
'multi-diff-scroll-fixture-scroll-view'
)
;
.
appendChild
(
.
)
;
.
attachScrollView
(
)
;
.
add
(
autorun
(
=>
{
.
.
=
` ${ model. viewportHeight. read ( reader) } px `
;
}
)
)
;
.
add
(
.
addDisposableListener
(
,
.
.
KEY_DOWN
,
=>
{
const
=
.
===
'ArrowDown'
?
40
:
.
===
'ArrowUp'
?
-
40
:
.
===
'PageDown'
?
.
.
get
(
)
:
.
===
'PageUp'
?
-
.
.
get
(
)
:
undefined
;
if
(
!==
undefined
)
{
.
preventDefault
(
)
;
.
setScrollTop
(
.
.
get
(
)
+
,
` Scroll fixture with ${ event. key} `
)
;
}
}
)
)
;
const
=
derived
(
,
=>
(
{
:
.
.
read
(
)
,
:
.
.
read
(
)
.
map
(
=>
(
{
:
.
,
:
.
.
read
(
)
,
}
)
)
,
}
)
)
;
renderCoordinateVisualization
(
,
.
,
,
)
;
}
interface
ICoordinateVisualizationState
{
readonly
:
{
readonly
:
number
;
readonly
:
number
;
readonly
:
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
}
;
readonly
:
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
}
;
readonly
:
readonly
{
readonly
:
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
}
;
readonly
:
{
readonly
:
number
;
readonly
:
number
;
readonly
:
number
}
;
readonly
:
number
;
}
[
]
;
}
;
readonly
:
readonly
{
readonly
:
string
;
readonly
:
number
|
string
|
undefined
;
}
[
]
;
}
function
renderCoordinateVisualization
(
:
,
:
<
number
>
,
:
<
>
,
:
,
)
:
void
{
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-coordinate-pane'
)
)
;
appendSectionHeading
(
,
'Coordinate systems'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-coordinate-grid'
)
)
;
const
=
createCoordinateScale
(
,
'Complete content'
)
;
const
=
createCoordinateScale
(
,
'Compressed rendering with item-local viewports'
)
;
.
add
(
autorun
(
=>
{
const
=
.
read
(
)
;
const
=
.
read
(
)
;
const
=
.
max
(
,
.
min
(
1200
,
.
.
*
60
)
)
;
.
.
.
=
` ${ coordinateHeight} px `
;
.
.
.
=
` ${ coordinateHeight} px `
;
updateCoordinateScale
(
,
.
,
.
,
'content'
)
;
updateCoordinateScale
(
,
.
,
.
,
'rendered'
)
;
}
)
)
;
}
interface
ICoordinateSegment
{
readonly
:
;
readonly
:
;
readonly
:
;
readonly
:
;
}
interface
ICoordinateScale
{
readonly
:
;
readonly
:
;
readonly
:
[
]
;
}
function
createCoordinateScale
(
:
,
:
string
)
:
{
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-coordinate-scale'
)
)
;
.
append
(
,
.
$
(
'h3'
)
)
.
=
;
const
=
.
append
(
,
.
$
(
'.track'
)
)
;
const
=
.
append
(
,
.
$
(
'.viewport-marker'
)
)
;
.
setAttribute
(
'aria-hidden'
,
'true'
)
;
return
{
,
,
:
[
]
}
;
}
function
updateCoordinateScale
(
:
,
:
[
'layout'
]
,
:
[
'items'
]
,
:
'content'
|
'rendered'
,
)
:
void
{
while
(
.
.
>
.
)
{
.
.
pop
(
)
!
.
.
remove
(
)
;
}
while
(
.
.
<
.
)
{
const
=
.
$
(
'.segment'
)
;
const
=
.
append
(
,
.
$
(
'.item-local-range'
)
)
;
const
=
.
append
(
,
.
$
(
'.item-local-viewport'
)
)
;
const
=
.
append
(
,
.
$
(
'.segment-label'
)
)
;
.
.
insertBefore
(
,
.
)
;
.
.
push
(
{
,
,
,
}
)
;
}
const
=
===
'content'
?
.
:
.
;
const
=
.
max
(
1
,
)
;
for
(
let
=
0
;
<
.
.
;
++
)
{
const
=
.
[
]
;
const
=
===
'content'
?
.
:
.
;
const
=
.
[
]
;
const
=
[
]
.
;
.
.
=
===
'content'
?
[
]
.
:
` ${ items[ index] . label} · ${ templateId === undefined ? 'unbound' : ` T ${ templateId} ` } · viewport ${ formatRange ( itemLayout. scrollOffset, itemLayout. scrollOffset + itemLayout. renderedRange. length) } `
;
.
.
.
=
` ${ range. start / safeHeight * 100 } % `
;
.
.
.
=
` ${ range. length / safeHeight * 100 } % `
;
.
.
=
!==
'rendered'
;
if
(
===
'rendered'
)
{
const
=
.
max
(
1
,
.
.
)
;
.
.
.
=
` ${ itemLayout. scrollOffset / itemHeight * 100 } % `
;
.
.
.
=
` ${ Math. min ( itemLayout. renderedRange. length, itemHeight) / itemHeight * 100 } % `
;
}
}
const
=
===
'content'
?
.
:
.
;
.
.
.
=
` ${ viewport. start / safeHeight * 100 } % `
;
.
.
.
=
` ${ viewport. length / safeHeight * 100 } % `
;
}
function
renderFakeEditorLines
(
:
,
:
string
,
:
number
,
:
number
,
:
number
)
:
void
{
const
=
[
...
Array
.
from
(
{
:
}
,
(
,
)
=>
-
)
,
...
Array
.
from
(
{
:
}
,
(
,
)
=>
+
1
)
,
...
Array
.
from
(
{
:
}
,
(
,
)
=>
+
+
1
)
,
]
;
.
replaceChildren
(
...
.
map
(
=>
{
const
=
.
$
(
'.multi-diff-scroll-fixture-editor-line'
)
;
.
.
=
` ${ fixtureLineHeight} px `
;
.
.
=
` ${ fixtureLineHeight} px `
;
const
=
.
append
(
,
.
$
(
'span.line-number'
)
)
;
.
=
String
(
)
;
const
=
.
append
(
,
.
$
(
'span.line-content'
)
)
;
.
=
` Item ${ itemLabel} Line ${ lineNumber} `
;
return
;
}
)
)
;
}
function
renderInspector
(
:
,
:
,
:
)
:
void
{
appendSectionHeading
(
,
'Displacement conservation'
)
;
const
=
.
append
(
,
.
$
(
'.multi-diff-scroll-fixture-equation'
)
)
;
const
=
.
append
(
,
.
$
(
'code'
)
)
;
const
=
.
append
(
,
.
$
(
'.status'
)
)
;
.
setAttribute
(
'role'
,
'status'
)
;
appendSectionHeading
(
,
'Item state'
)
;
const
=
.
append
(
,
.
$
(
'table.multi-diff-scroll-fixture-table'
)
)
;
const
=
.
append
(
,
.
$
(
'caption'
)
)
;
.
=
'Multi-diff item layout state'
;
const
=
.
append
(
,
.
$
(
'thead'
)
)
;
const
=
.
append
(
,
.
$
(
'tr'
)
)
;
for
(
const
of
[
'Item'
,
'Content'
,
'Rendered'
,
'Max'
,
'Projected'
,
'Actual'
,
'Template'
,
'Phase'
]
)
{
.
append
(
,
.
$
(
'th'
)
)
.
=
;
}
const
=
.
append
(
,
.
$
(
'tbody'
)
)
;
appendSectionHeading
(
,
'Template pool'
)
;
const
=
.
append
(
,
.
$
(
'ol.multi-diff-scroll-fixture-log.template-log'
)
)
;
appendSectionHeading
(
,
'Transition log'
)
;
const
=
.
append
(
,
.
$
(
'ol.multi-diff-scroll-fixture-log'
)
)
;
.
add
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
const
=
.
-
.
.
-
.
;
.
=
` ${ formatNumber ( layout. scrollTop) } = ${ formatNumber ( layout. renderedViewport. start) } + ${ formatNumber ( layout. hiddenContentHeightAboveViewport) } `
;
.
=
.
abs
(
)
<
0.0001
?
'Invariant holds'
:
` Residual ${ formatNumber ( conservationResidual) } `
;
.
.
toggle
(
'invalid'
,
.
abs
(
)
>=
0.0001
)
;
.
replaceChildren
(
)
;
for
(
const
of
.
.
read
(
)
)
{
.
append
(
,
.
$
(
'li'
)
)
.
=
;
}
.
replaceChildren
(
)
;
const
=
.
.
read
(
)
;
for
(
const
of
.
toReversed
(
)
)
{
const
=
.
append
(
,
.
$
(
'li'
)
)
;
.
.
toggle
(
'invalid'
,
.
abs
(
.
)
>=
0.0001
)
;
const
=
.
append
(
,
.
$
(
'span.action'
)
)
;
.
=
.
;
const
=
.
append
(
,
.
$
(
'code'
)
)
;
.
=
` Δscroll ${ formatSigned ( transition. scrollDelta) } = Δrendered ${ formatSigned ( transition. renderedDelta) } + Δhidden ${ formatSigned ( transition. hiddenDelta) } · residual ${ formatSigned ( transition. residual) } `
;
}
}
)
)
;
.
add
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
.
replaceChildren
(
)
;
const
=
.
map
(
(
)
=>
{
const
=
.
append
(
,
.
$
(
'tr'
)
)
;
return
{
,
:
Array
.
from
(
{
:
8
}
,
(
)
=>
.
append
(
,
.
$
(
'td'
)
)
)
,
}
;
}
)
;
.
.
add
(
autorun
(
=>
{
const
=
.
.
read
(
)
;
if
(
.
.
!==
.
)
{
return
;
}
for
(
let
=
0
;
<
.
;
++
)
{
const
=
[
]
;
const
=
.
[
]
;
const
=
[
]
.
;
const
=
[
.
,
formatRange
(
.
.
,
.
.
)
,
formatRange
(
.
.
,
.
.
)
,
formatNumber
(
.
)
,
formatNumber
(
.
)
,
formatNumber
(
.
.
read
(
)
)
,
.
.
read
(
)
===
undefined
?
'—'
:
` # ${ item. templateId. read ( tableReader) } `
,
.
.
read
(
)
,
]
;
for
(
let
=
0
;
<
.
;
++
)
{
[
]
.
=
[
]
;
}
[
]
.
.
.
toggle
(
'desynchronized'
,
.
===
'visible'
&&
.
.
read
(
)
!==
.
)
;
}
}
)
)
;
}
)
)
;
}
function
appendSectionHeading
(
:
,
:
string
)
:
void
{
.
append
(
,
.
$
(
'h2'
)
)
.
=
;
}
function
appendNumberField
(
:
,
:
string
,
:
<
number
>
,
onChange
:
(
:
number
)
=>
void
,
:
,
)
:
void
{
const
=
.
append
(
,
.
$
(
'label.multi-diff-scroll-fixture-field'
)
)
;
.
append
(
,
.
$
(
'span'
)
)
.
=
;
const
=
.
append
(
,
.
$
(
'input'
)
)
as
;
.
=
'number'
;
.
=
'1'
;
.
add
(
.
addDisposableListener
(
,
.
.
CHANGE
,
(
)
=>
{
const
=
Number
(
.
)
;
if
(
.
isFinite
(
)
)
{
onChange
(
)
;
}
}
)
)
;
.
add
(
autorun
(
=>
{
const
=
formatNumber
(
.
read
(
)
)
;
if
(
.
getActiveElement
(
)
!==
)
{
.
=
;
}
}
)
)
;
.
add
(
.
addDisposableListener
(
,
.
.
BLUR
,
(
)
=>
{
.
=
formatNumber
(
.
get
(
)
)
;
}
)
)
;
}
function
appendButton
(
:
,
:
string
,
onClick
:
(
)
=>
void
,
:
,
=
false
,
)
:
{
const
=
.
add
(
new
Button
(
,
{
...
,
,
:
}
)
)
;
.
=
;
.
add
(
.
onDidClick
(
)
)
;
return
;
}
function
formatNumber
(
:
number
)
:
string
{
return
.
isInteger
(
)
?
String
(
)
:
.
toFixed
(
2
)
;
}
function
formatSigned
(
:
number
)
:
string
{
return
` ${ value >= 0 ? '+' : '' } ${ formatNumber ( value) } `
;
}
function
formatRange
(
:
number
,
:
number
)
:
string
{
return
` ${ formatNumber ( start) } – ${ formatNumber ( endExclusive) } `
;
}