ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / test / simulation / workbench / components / app.tsx 189 строк · изменён 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
import { Checkbox , FluentProvider , MessageBar , MessageBarBody , MessageBarTitle , Text , ToggleButton , Tooltip , webDarkTheme, webLightTheme } from '@fluentui/react-components' ;
import { ListBar20Filled , ListBarTree20Filled } from '@fluentui/react-icons' ;
import * as mobx from 'mobx' ;
import * as mobxlite from 'mobx-react-lite' ;
initArgs
testsProvider
workbenchMode
runner
runnerOptions
nesExternalOptions
adhocRequestOptions
adhocRequestSender
simulationRunsProvider
amlProvider
displayOptions
mobxlite
initArgs testsProvider workbenchMode runner runnerOptions nesExternalOptions adhocRequestOptions adhocRequestSender simulationRunsProvider amlProvider displayOptions
theme setTheme
filterer setFilterer
toggleTheme theme theme
isAdhocRequest workbenchMode
isAdhocRequest
testsProvider
runner
runnerOptions
nesExternalOptions
amlProvider
displayOptions
filterer
mobxlite testsProvider runner runnerOptions nesExternalOptions amlProvider displayOptions filterer
displayedTests filterer
filterer testsProvider
testsProvider
testsProvider
testsProvider
testsProvider testsProvider
mobxlite runner runner
runner
runner
mobxlite displayOptions displayOptions
testsKind
expandPrompts
storage
storage
storage
tests
displayedTests
mobxlite tests displayedTests
tests displayedTests
import
* as React
from
'react'
;
import
{ InitArgs }
from
'../initArgs'
;
import
{ AdhocRequestOptions }
from
'../stores/adhocRequestOptions'
;
import
{ AdhocRequestSender }
from
'../stores/adhocRequestSender'
;
import
{ AMLProvider }
from
'../stores/amlSimulations'
;
import
{ NesExternalOptions }
from
'../stores/nesExternalOptions'
;
import
{ RunnerOptions }
from
'../stores/runnerOptions'
;
import
{ SimulationRunsProvider }
from
'../stores/simulationBaseline'
;
import
{ SimulationRunner }
from
'../stores/simulationRunner'
;
import
{ SimulationStorage , SimulationStorageValue }
from
'../stores/simulationStorage'
;
import
{ ISimulationTest , SimulationTestsProvider }
from
'../stores/simulationTestsProvider'
;
import
{ useLocalStorageState }
from
'../stores/storage'
;
import
{ TestSource }
from
'../stores/testSource'
;
import
{ WorkbenchModeValue }
from
'../stores/workbenchMode'
;
import
{ AdhocRequestView }
from
'./adhocRequestView'
;
import
{ ContextMenu , ContextMenuProvider }
from
'./contextMenu'
;
import
{ Scorecard }
from
'./scorecard'
;
import
{ ScorecardByLanguage }
from
'./scorecardByLanguage'
;
import
{ TestFilterer }
from
'./testFilterer'
;
import
{ TestList }
from
'./testList'
;
import
{ Toolbar }
from
'./toolbar'
;
type
Props
=
{
:
InitArgs
|
undefined
;
:
SimulationTestsProvider
;
:
WorkbenchModeValue
;
:
SimulationRunner
;
:
RunnerOptions
;
:
NesExternalOptions
;
:
AdhocRequestOptions
;
:
AdhocRequestSender
;
:
SimulationRunsProvider
;
:
AMLProvider
;
:
DisplayOptions
;
}
;
export
type
ThemeKind
=
'light'
|
'dark'
;
export
const
App
=
.
observer
(
(
{
,
,
,
,
,
,
,
,
,
,
}
:
Props
)
=>
{
const
[
,
]
=
useLocalStorageState < ThemeKind>
(
'appTheme'
,
undefined
,
'light'
)
;
const
[
,
]
=
React
.
useState
<
TestFilterer
|
undefined
>
(
undefined
)
;
const
=
React
.
useCallback
(
(
)
=>
setTheme
(
===
'dark'
?
'light'
:
'dark'
)
,
[
]
)
;
const
=
.
value
===
'adhocRequest'
;
return
(
< FluentProvider theme = { theme === 'light' ? webLightTheme : webDarkTheme} style = { { minHeight: 'inherit' } } >
< ContextMenuProvider >
< div>
< ContextMenu />
< Toolbar
initArgs = { initArgs}
runner = { runner}
runnerOptions = { runnerOptions}
nesExternalOptions = { nesExternalOptions}
simulationRunsProvider = { simulationRunsProvider}
simulationTestsProvider = { testsProvider}
amlProvider = { amlProvider}
workbenchMode = { workbenchMode}
testSource = { testsProvider. testSource }
onFiltererChange = { setFilterer}
allLanguageIds = { testsProvider. allLanguageIds }
theme = { theme}
toggleTheme = { toggleTheme}
/>
{
?
(
< AdhocRequestView adhocRequestOptions = { adhocRequestOptions} adhocRequestSender = { adhocRequestSender} />
)
:
(
< TestsView
testsProvider = { testsProvider}
runner = { runner}
runnerOptions = { runnerOptions}
nesExternalOptions = { nesExternalOptions}
amlProvider = { amlProvider}
displayOptions = { displayOptions}
filterer = { filterer}
/>
)
}
</ div>
</ ContextMenuProvider >
</ FluentProvider >
)
;
}
)
;
type
TestsViewProps
=
{
:
SimulationTestsProvider
;
:
SimulationRunner
;
:
RunnerOptions
;
:
NesExternalOptions
;
:
AMLProvider
;
:
DisplayOptions
;
:
TestFilterer
|
undefined
;
}
;
const
TestsView
=
.
observer
(
(
{
,
,
,
,
,
,
}
:
TestsViewProps
)
=>
{
const
=
?
.
filter
(
.
tests
)
:
.
tests
;
return
(
< >
{
.
testSource
.
value
===
TestSource
.
External
&&
(
< Scorecard amlProvider = { amlProvider} />
)
}
{
.
testSource
.
value
===
TestSource
.
External
&&
(
< ScorecardByLanguage amlProvider = { amlProvider} />
)
}
{
(
.
testSource
.
value
===
TestSource
.
Local
||
.
testSource
.
value
===
TestSource
.
NesExternal
)
&&
< TerminationMessageBar runner = { runner} />
}
< div style = { { margin: '5px' , display: 'flex' , justifyContent: 'space-between' } } >
< div style = { { textAlign: 'left' } } >
< TestsInfo tests = { testsProvider. tests } displayedTests = { displayedTests} />
</ div>
< div style = { { textAlign: 'right' } } >
< Checkbox
label = ' Expand prompts'
defaultChecked = { displayOptions. expandPrompts . value }
onChange = { mobx. action ( ( ) => displayOptions. expandPrompts . value = ! displayOptions. expandPrompts . value ) }
/>
< DisplayToggle displayOptions = { displayOptions} />
</ div>
</ div>
< TestList tests = { displayedTests} runner = { runner} runnerOptions = { runnerOptions} nesExternalOptions = { nesExternalOptions} testSource = { testsProvider. testSource } displayOptions = { displayOptions} />
</ >
)
;
}
)
;
const
TerminationMessageBar
=
.
observer
(
(
{
}
:
{
:
SimulationRunner
}
)
=>
.
terminationReason
===
undefined
?
null
:
(
< MessageBar intent = ' error' layout = ' singleline' >
< MessageBarBody >
< MessageBarTitle >
Simulation terminated early
</ MessageBarTitle >
< pre>
{
.
terminationReason
}
</ pre>
</ MessageBarBody >
</ MessageBar >
)
)
;
const
DisplayToggle
=
.
observer
(
(
{
}
:
{
:
DisplayOptions
}
)
=>
(
< Tooltip content = ' Show all tests or by suites' relationship = ' label' >
< ToggleButton
icon = { displayOptions. testsKind . value === 'suiteList' ? < ListBarTree20Filled /> : < ListBar20Filled /> }
onClick = { mobx. action ( ( ) => displayOptions. testsKind . value = displayOptions. testsKind . value === 'suiteList' ? 'testList' : 'suiteList' ) }
/>
</ Tooltip >
)
)
;
export
class
DisplayOptions
{
public
:
SimulationStorageValue
<
'suiteList'
|
'testList'
>
;
public
:
SimulationStorageValue
<
boolean
>
;
constructor
(
:
SimulationStorage
)
{
this
.
testsKind
=
new
SimulationStorageValue
(
,
'displayTestsKind'
,
'suiteList'
)
;
this
.
expandPrompts
=
new
SimulationStorageValue
(
,
'expandPrompts'
,
false
)
;
}
}
type
TestsInfoProps
=
{
:
readonly
ISimulationTest
[
]
;
:
readonly
ISimulationTest
[
]
;
}
;
const
TestsInfo
=
.
observer
(
(
{
,
}
:
TestsInfoProps
)
=>
{
return
(
< Text size = { 400 } >
# of tests:
{
.
length
}
(
< span>
displayed:
</ span>
{
.
length
}
)
</ Text >
)
;
}
)
;