Skip to content

Commit 0ccb61b

Browse files
pxoralehander92
authored andcommitted
feat: Add animation to debug menu and fix monaco editor colors with new color palette
1 parent 43d60be commit 0ccb61b

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

src/frontend/styles/components/state.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
color: orange
3030

3131
.value-error
32-
color: red
32+
color: CALLTRACE_END_OF_PROGRAM_ERROR
3333

3434
.value-non-expanded, .value-error
3535
position: absolute

src/frontend/styles/components/text_editor.styl

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,38 @@
77
.margin-view-overlays
88
height: 100%
99

10-
// div
11-
// background-color: SECONDARY_BASE
10+
div
11+
background-color: SECONDARY_BASE
1212

1313
.monaco-editor .margin .margin-view-overlays .folding
14-
margin-left: 15px !important
14+
padding-left: 14px !important
1515
// background-color: transparent
16-
width: 5px !important
16+
width: 4px !important
1717

1818
.sticky-widget
1919
width: 100% !important
2020

2121
.diff-view-zone
2222
width: -webkit-fill-available !important
23-
background-color: DIFF_BACKGROUND
23+
24+
.monaco-editor-background
25+
background-color: DIFF_BACKGROUND !important
26+
27+
.margin
28+
background-color: DIFF_BACKGROUND !important
2429

2530
.margin-view-overlays
2631
div
2732
background-color: DIFF_BACKGROUND !important
2833

29-
.mtk1
34+
[class^="mtk"]
3035
color: BREAKPOINT_COLOR !important
3136

3237
.line-numbers
3338
border-right: 1px solid BREAKPOINT_COLOR !important
3439

3540
.diff-deleted-gutter
36-
color: BREAKPOINT_COLOR
41+
color: BREAKPOINT_COLOR !important
3742

3843
.current-line
3944
background-color: transparent !important
@@ -76,7 +81,7 @@
7681
// width: 8px !important
7782

7883
.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input, .monaco-editor .margin, .monaco-editor .sticky-line-content, .monaco-editor .sticky-line-number
79-
// background-color: transparent !important
84+
background-color: transparent !important
8085
z-index: 2
8186

8287
.monaco-scrollable-element

src/frontend/types.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ type
609609
activeHistory*: cstring
610610
finished*: bool
611611
jumpHistory*: seq[JumpHistory]
612+
isLoading*: bool
612613

613614

614615

src/frontend/ui/debug.nim

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,14 @@ proc action(self: DebugComponent, id: string) =
9090
of "run-tests":
9191
# copied from alt+l shorcut handling in shortcuts.nim
9292
let options = RunTestOptions(newWindow: true, path: data.services.debugger.location.path, testName: "")
93+
self.isLoading = true
9394
data.runTests(options)
95+
# TODO: For now hardcode the animation reset
96+
discard setTimeout(proc() =
97+
self.isLoading = false
98+
redrawAll(),
99+
10000
100+
)
94101

95102
of "history-back":
96103
self.handleHistoryJump(isForward = true)
@@ -142,7 +149,8 @@ var buttons = JsAssoc[cstring, VNode]{
142149
"jump-before": buildHtml(img(src="public/resources/debug/jump-before_16_dark.svg", height="16px", width="16px", class="debug-button-svg")),
143150
"jump-after": buildHtml(img(src="public/resources/debug/jump-after_16_dark.svg", height="16px", width="16px", class="debug-button-svg")),
144151
"run-to-entry": buildHtml(img(src="public/resources/debug/run_to_entry_dark.svg", height="20px", width="18px", class="debug-button-svg")),
145-
"run-tests": buildHtml(img(src="public/resources/shared/run_test_img.svg", height="12px", width="18px", class="debug-button-svg"))
152+
"run-tests": buildHtml(img(src="public/resources/shared/run_test_img.svg", height="12px", width="18px", class="debug-button-svg")),
153+
"run-tests-loading": buildHtml(img(src="public/resources/shared/rerecord_animation.svg", height="18px", width="18px", class="debug-button-svg"))
146154
}
147155

148156
let shortcuts = JsAssoc[cstring, cstring]{
@@ -353,7 +361,10 @@ method render*(self: DebugComponent): VNode =
353361
separateBar()
354362
debugButton("reset-operation", false) # not self.stableBusy)
355363
separateBar()
356-
debugButton("run-tests")
364+
if not self.isLoading:
365+
debugButton("run-tests")
366+
else:
367+
debugButton("run-tests-loading")
357368
separateBar()
358369
else:
359370
debugStepButton("continue", Continue, false)

0 commit comments

Comments
 (0)