Skip to content

Commit c008f48

Browse files
Feat: code editor + resizable UI
1 parent ba769ed commit c008f48

File tree

6 files changed

+363
-7
lines changed

6 files changed

+363
-7
lines changed

apps/ui/project.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
"main": "apps/ui/src/main.ts",
1515
"polyfills": ["zone.js"],
1616
"tsConfig": "apps/ui/tsconfig.app.json",
17-
"assets": ["apps/ui/src/favicon.ico", "apps/ui/src/assets"],
17+
"assets": [
18+
"apps/ui/src/favicon.ico",
19+
"apps/ui/src/assets",
20+
{
21+
"glob": "**/*",
22+
"input": "node_modules/monaco-editor/min/vs",
23+
"output": "/assets/monaco/vs"
24+
}
25+
],
1826
"styles": ["node_modules/bootstrap/dist/css/bootstrap.min.css", "apps/ui/src/styles.scss"],
1927
"scripts": []
2028
},

apps/ui/src/app/playground/playground.component.css

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,102 @@
115115
background: #777;
116116
}
117117

118+
.monaco-editor-wrapper {
119+
border-radius: 8px;
120+
border: 1px solid #404040;
121+
overflow: hidden;
122+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
123+
}
124+
125+
.monaco-editor-wrapper.monaco-editor-invalid {
126+
border-color: #dc3545;
127+
border-width: 3px;
128+
box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
129+
}
130+
131+
.monaco-editor-container {
132+
overflow: hidden;
133+
}
134+
135+
.editor-resize-handle {
136+
height: 14px;
137+
cursor: row-resize;
138+
display: flex;
139+
align-items: center;
140+
justify-content: center;
141+
background: transparent;
142+
transition: background 0.15s;
143+
margin-top: 4px;
144+
}
145+
146+
.editor-resize-handle:hover,
147+
.editor-resize-handle:active {
148+
background: rgba(100, 149, 237, 0.15);
149+
}
150+
151+
.editor-resize-grip {
152+
width: 40px;
153+
height: 4px;
154+
border-radius: 2px;
155+
background: #6c757d;
156+
transition: background 0.15s, width 0.15s;
157+
}
158+
159+
.editor-resize-handle:hover .editor-resize-grip,
160+
.editor-resize-handle:active .editor-resize-grip {
161+
background: #0d6efd;
162+
width: 60px;
163+
}
164+
165+
/* ── Resizable split pane ─────────────────────────────────── */
166+
167+
.split-pane {
168+
display: flex;
169+
flex-direction: row;
170+
width: 100%;
171+
min-height: 0;
172+
}
173+
174+
.split-pane-left,
175+
.split-pane-right {
176+
overflow: auto;
177+
flex-shrink: 0;
178+
flex-grow: 0;
179+
min-width: 0;
180+
padding: 0 12px;
181+
}
182+
183+
.split-divider {
184+
flex: 0 0 8px;
185+
cursor: col-resize;
186+
display: flex;
187+
align-items: center;
188+
justify-content: center;
189+
background: transparent;
190+
transition: background 0.15s;
191+
z-index: 10;
192+
position: relative;
193+
}
194+
195+
.split-divider:hover,
196+
.split-divider:active {
197+
background: rgba(100, 149, 237, 0.15);
198+
}
199+
200+
.split-divider-handle {
201+
width: 4px;
202+
height: 40px;
203+
border-radius: 2px;
204+
background: #6c757d;
205+
transition: background 0.15s, height 0.15s;
206+
}
207+
208+
.split-divider:hover .split-divider-handle,
209+
.split-divider:active .split-divider-handle {
210+
background: #0d6efd;
211+
height: 60px;
212+
}
213+
118214
.table-bordered th,
119215
.table-bordered td {
120216
border: 1px solid #dee2e6;

apps/ui/src/app/playground/playground.component.html

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container-fluid p-4">
2-
<div class="row">
2+
<div class="split-pane">
33
<!-- Left side: Configuration -->
4-
<div class="col-md-6">
4+
<div class="split-pane-left" [style.flex-basis.%]="splitPosition">
55
<h2 class="text-xl font-semibold mb-2">Configuration</h2>
66
<form [formGroup]="renovateForm" (ngSubmit)="runRenovate()">
77
<div class="mb-3">
@@ -16,16 +16,32 @@ <h2 class="text-xl font-semibold mb-2">Configuration</h2>
1616
</div>
1717
<div class="mb-3">
1818
<label for="renovateConfig" class="form-label">Renovate Configuration (JSON)</label>
19-
<textarea id="renovateConfig" formControlName="renovateConfig" rows="15" class="form-control"></textarea>
19+
<div class="monaco-editor-wrapper"
20+
[class.monaco-editor-invalid]="renovateForm.get('renovateConfig')?.errors?.['jsonInvalid']">
21+
<div #monacoContainer class="monaco-editor-container"
22+
[style.height.px]="editorHeight"></div>
23+
</div>
24+
<div class="editor-resize-handle"
25+
(mousedown)="onEditorResizeMouseDown($event)">
26+
<div class="editor-resize-grip"></div>
27+
</div>
28+
<input type="hidden" formControlName="renovateConfig">
2029
</div>
2130
<button type="submit" [disabled]="isRunning" class="btn btn-primary">
2231
{{ isRunning ? 'Running...' : 'Run Renovate' }}
2332
</button>
2433
</form>
2534
</div>
2635

36+
<!-- Draggable divider -->
37+
<div class="split-divider"
38+
(mousedown)="onDividerMouseDown($event)"
39+
(dblclick)="resetSplitPosition()">
40+
<div class="split-divider-handle"></div>
41+
</div>
42+
2743
<!-- Right side: Logs -->
28-
<div class="col-md-6">
44+
<div class="split-pane-right" [style.flex-basis.%]="100 - splitPosition">
2945
<div class="d-flex justify-content-between align-items-center mb-2">
3046
<h2 class="text-xl font-semibold mb-0">Live Logs</h2>
3147
<div class="d-flex align-items-center">

0 commit comments

Comments
 (0)