@nocturnium/svelte-ide 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ai/AIPanel.svelte +6 -1
- package/dist/components/ai/AIToolCallDisplay.svelte +1 -1
- package/dist/components/core/Avatar.svelte +14 -14
- package/dist/components/core/Badge.svelte +2 -2
- package/dist/components/core/Button.svelte +2 -2
- package/dist/components/editor/AIFocusLayer.svelte +3 -3
- package/dist/components/editor/CognitiveLoadMeter.svelte +15 -15
- package/dist/components/editor/CommandPalette.svelte +17 -17
- package/dist/components/editor/ComplexityLayer.svelte +11 -9
- package/dist/components/editor/ConflictZoneLayer.svelte +8 -8
- package/dist/components/editor/CustomEditor.svelte +34 -12
- package/dist/components/editor/CustomEditor.svelte.d.ts +5 -1
- package/dist/components/editor/FileIcon.svelte +2 -1
- package/dist/components/editor/GitBlameLayer.svelte +8 -8
- package/dist/components/editor/InlineDiffLayer.svelte +12 -12
- package/dist/components/editor/PluginPreviewSandbox.svelte +21 -21
- package/dist/components/editor/SnippetPalette.svelte +21 -21
- package/dist/components/editor/StructureMap.svelte +47 -30
- package/dist/components/editor/TimelineScrubber.svelte +11 -11
- package/dist/components/editor/core/complexity-analyzer.d.ts +4 -0
- package/dist/components/editor/core/complexity-analyzer.js +70 -12
- package/dist/components/editor/core/diagnostics.js +4 -4
- package/dist/components/editor/core/semantic-analyzer.js +13 -1
- package/dist/components/editor/core/structure-layout.d.ts +31 -0
- package/dist/components/editor/core/structure-layout.js +64 -0
- package/dist/styles/theme.css +24 -0
- package/package.json +1 -1
|
@@ -208,7 +208,9 @@
|
|
|
208
208
|
<Icon name="sparkles" size={16} />
|
|
209
209
|
<span>AI Assistant</span>
|
|
210
210
|
</div>
|
|
211
|
-
<span class="ai-panel__mock-badge"
|
|
211
|
+
<span class="ai-panel__mock-badge" title="Demo mock - no real model"
|
|
212
|
+
>Demo mock - no real model</span
|
|
213
|
+
>
|
|
212
214
|
</div>
|
|
213
215
|
<div class="ai-panel__actions">
|
|
214
216
|
<Button variant="ghost" size="xs" onclick={handleNewConversation} title="New conversation">
|
|
@@ -355,6 +357,8 @@
|
|
|
355
357
|
display: inline-flex;
|
|
356
358
|
align-items: center;
|
|
357
359
|
min-width: 0;
|
|
360
|
+
max-width: 100%;
|
|
361
|
+
overflow: hidden;
|
|
358
362
|
padding: 0.125rem var(--ide-spacing-sm);
|
|
359
363
|
border: 1px solid color-mix(in srgb, var(--ide-accent) 40%, var(--ide-border));
|
|
360
364
|
border-radius: var(--ide-radius-full);
|
|
@@ -363,6 +367,7 @@
|
|
|
363
367
|
font-size: var(--ide-font-size-xs);
|
|
364
368
|
font-weight: 500;
|
|
365
369
|
line-height: var(--ide-line-height-normal);
|
|
370
|
+
text-overflow: ellipsis;
|
|
366
371
|
white-space: nowrap;
|
|
367
372
|
}
|
|
368
373
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
startedAt?: Date;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
let { toolCall, status = '
|
|
14
|
+
let { toolCall, status = 'pending', result, error, duration, startedAt }: Props = $props();
|
|
15
15
|
|
|
16
16
|
let expanded = $state(false);
|
|
17
17
|
let showResult = $state(false);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Icon from './Icon.svelte';
|
|
3
|
+
|
|
2
4
|
interface Props {
|
|
3
5
|
name: string;
|
|
4
6
|
src?: string;
|
|
@@ -45,7 +47,10 @@
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
const initials = $derived(getInitials(name));
|
|
48
|
-
|
|
50
|
+
// Default AI tint is the conversational "assistant" hue. Collaboration/presence
|
|
51
|
+
// call sites (cursors, locks) pass an explicit `--ide-collab-ai` color instead.
|
|
52
|
+
const bgColor = $derived(color ?? (isAI ? 'var(--ide-ai-assistant)' : 'var(--ide-interactive)'));
|
|
53
|
+
const aiGlyphSize = $derived(Math.round(parseInt(sizeMap[size], 10) * 0.58));
|
|
49
54
|
</script>
|
|
50
55
|
|
|
51
56
|
<div
|
|
@@ -60,12 +65,11 @@
|
|
|
60
65
|
>
|
|
61
66
|
{#if src}
|
|
62
67
|
<img class="ide-avatar__img" {src} alt={name} />
|
|
68
|
+
{:else if isAI}
|
|
69
|
+
<span class="ide-avatar__ai-glyph"><Icon name="sparkles" size={aiGlyphSize} /></span>
|
|
63
70
|
{:else}
|
|
64
71
|
<span class="ide-avatar__initials">{initials}</span>
|
|
65
72
|
{/if}
|
|
66
|
-
{#if isAI}
|
|
67
|
-
<span class="ide-avatar__ai-badge">AI</span>
|
|
68
|
-
{/if}
|
|
69
73
|
</div>
|
|
70
74
|
|
|
71
75
|
<style>
|
|
@@ -96,15 +100,11 @@
|
|
|
96
100
|
line-height: 1;
|
|
97
101
|
}
|
|
98
102
|
|
|
99
|
-
.ide-avatar__ai-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
font-weight: 700;
|
|
106
|
-
background: var(--ide-collab-ai);
|
|
107
|
-
border-radius: var(--ide-radius-sm);
|
|
108
|
-
border: 1px solid var(--ide-bg-primary);
|
|
103
|
+
.ide-avatar__ai-glyph {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
line-height: 0;
|
|
108
|
+
color: white;
|
|
109
109
|
}
|
|
110
110
|
</style>
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.ide-badge--primary {
|
|
65
|
-
background: color-mix(in srgb, var(--ide-
|
|
66
|
-
color: var(--ide-
|
|
65
|
+
background: color-mix(in srgb, var(--ide-primary) 20%, transparent);
|
|
66
|
+
color: var(--ide-primary);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.ide-badge--success {
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
|
|
86
86
|
/* Variants */
|
|
87
87
|
.ide-button--primary {
|
|
88
|
-
background: var(--ide-
|
|
88
|
+
background: var(--ide-primary);
|
|
89
89
|
color: var(--ide-text-primary);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.ide-button--primary:hover:not(:disabled) {
|
|
93
|
-
background: var(--ide-
|
|
93
|
+
background: var(--ide-primary-hover);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.ide-button--secondary {
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
right: 8px;
|
|
282
282
|
top: 2px;
|
|
283
283
|
font-size: 10px;
|
|
284
|
-
color: var(--
|
|
284
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
285
285
|
opacity: 0.7;
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
gap: 4px;
|
|
402
402
|
padding: 2px 8px;
|
|
403
403
|
background: rgba(30, 30, 30, 0.95);
|
|
404
|
-
border: 1px solid var(--
|
|
404
|
+
border: 1px solid var(--ide-border, #a8c5d9);
|
|
405
405
|
border-radius: 4px;
|
|
406
406
|
font-size: 11px;
|
|
407
407
|
white-space: nowrap;
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
.ai-focus-layer__label-activity {
|
|
423
|
-
color: var(--
|
|
423
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
424
424
|
font-size: 10px;
|
|
425
425
|
max-width: 150px;
|
|
426
426
|
overflow: hidden;
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
let levelColor = $derived(
|
|
29
29
|
level === 'critical'
|
|
30
|
-
? 'var(--
|
|
30
|
+
? 'var(--ide-error, #ef4444)'
|
|
31
31
|
: level === 'high'
|
|
32
|
-
? 'var(--
|
|
32
|
+
? 'var(--ide-warning, #facc15)'
|
|
33
33
|
: level === 'medium'
|
|
34
|
-
? 'var(--
|
|
35
|
-
: 'var(--
|
|
34
|
+
? 'var(--ide-info, #60a5fa)'
|
|
35
|
+
: 'var(--ide-success, #4ade80)'
|
|
36
36
|
);
|
|
37
37
|
|
|
38
38
|
let levelLabel = $derived(
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
.cognitive-meter:focus-visible {
|
|
177
|
-
outline: 2px solid var(--
|
|
177
|
+
outline: 2px solid var(--ide-interactive-focus, #60a5fa);
|
|
178
178
|
outline-offset: 2px;
|
|
179
179
|
}
|
|
180
180
|
|
|
@@ -230,8 +230,8 @@
|
|
|
230
230
|
transform: translateX(-50%);
|
|
231
231
|
margin-bottom: 8px;
|
|
232
232
|
padding: 12px;
|
|
233
|
-
background-color: var(--
|
|
234
|
-
border: 1px solid var(--
|
|
233
|
+
background-color: var(--ide-bg-secondary, #1a2744);
|
|
234
|
+
border: 1px solid var(--ide-border, #a8c5d9);
|
|
235
235
|
border-radius: 8px;
|
|
236
236
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
237
237
|
min-width: 280px;
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
left: 50%;
|
|
248
248
|
transform: translateX(-50%);
|
|
249
249
|
border: 6px solid transparent;
|
|
250
|
-
border-top-color: var(--
|
|
250
|
+
border-top-color: var(--ide-border, #a8c5d9);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
.cognitive-meter__tooltip-header {
|
|
@@ -256,12 +256,12 @@
|
|
|
256
256
|
align-items: center;
|
|
257
257
|
margin-bottom: 8px;
|
|
258
258
|
padding-bottom: 8px;
|
|
259
|
-
border-bottom: 1px solid var(--
|
|
259
|
+
border-bottom: 1px solid var(--ide-border, #a8c5d9);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
.cognitive-meter__tooltip-title {
|
|
263
263
|
font-weight: 600;
|
|
264
|
-
color: var(--
|
|
264
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
.cognitive-meter__tooltip-score {
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
.cognitive-meter__tooltip-label {
|
|
276
276
|
display: block;
|
|
277
277
|
font-size: 11px;
|
|
278
|
-
color: var(--
|
|
278
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
279
279
|
margin-bottom: 4px;
|
|
280
280
|
text-transform: uppercase;
|
|
281
281
|
letter-spacing: 0.05em;
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
.cognitive-meter__tooltip-region-name {
|
|
299
|
-
color: var(--
|
|
299
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
300
300
|
overflow: hidden;
|
|
301
301
|
text-overflow: ellipsis;
|
|
302
302
|
white-space: nowrap;
|
|
@@ -304,13 +304,13 @@
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
.cognitive-meter__tooltip-region-score {
|
|
307
|
-
color: var(--
|
|
307
|
+
color: var(--ide-warning, #facc15);
|
|
308
308
|
font-weight: 600;
|
|
309
309
|
font-variant-numeric: tabular-nums;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
.cognitive-meter__tooltip-more {
|
|
313
|
-
color: var(--
|
|
313
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
314
314
|
font-style: italic;
|
|
315
315
|
}
|
|
316
316
|
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
background-color: rgba(255, 255, 255, 0.05);
|
|
321
321
|
border-radius: 4px;
|
|
322
322
|
font-size: 11px;
|
|
323
|
-
color: var(--
|
|
323
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
324
324
|
line-height: 1.4;
|
|
325
325
|
}
|
|
326
326
|
</style>
|
|
@@ -257,8 +257,8 @@
|
|
|
257
257
|
width: 100%;
|
|
258
258
|
max-width: 600px;
|
|
259
259
|
max-height: 70vh;
|
|
260
|
-
background: var(--
|
|
261
|
-
border: 1px solid var(--
|
|
260
|
+
background: var(--ide-bg-secondary, #1a2744);
|
|
261
|
+
border: 1px solid var(--ide-border, #a8c5d9);
|
|
262
262
|
border-radius: 12px;
|
|
263
263
|
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
264
264
|
display: flex;
|
|
@@ -271,13 +271,13 @@
|
|
|
271
271
|
align-items: center;
|
|
272
272
|
gap: 12px;
|
|
273
273
|
padding: 12px 16px;
|
|
274
|
-
border-bottom: 1px solid var(--
|
|
275
|
-
background: var(--
|
|
274
|
+
border-bottom: 1px solid var(--ide-border, #a8c5d9);
|
|
275
|
+
background: var(--ide-bg-elevated, #1a2744);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
.command-palette__icon {
|
|
279
279
|
font-size: 18px;
|
|
280
|
-
color: var(--
|
|
280
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
.command-palette__input {
|
|
@@ -286,18 +286,18 @@
|
|
|
286
286
|
border: none;
|
|
287
287
|
outline: none;
|
|
288
288
|
font-size: 16px;
|
|
289
|
-
color: var(--
|
|
289
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
290
290
|
font-family: inherit;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
.command-palette__input::placeholder {
|
|
294
|
-
color: var(--
|
|
294
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
.command-palette__close {
|
|
298
298
|
background: none;
|
|
299
299
|
border: none;
|
|
300
|
-
color: var(--
|
|
300
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
301
301
|
cursor: pointer;
|
|
302
302
|
font-size: 16px;
|
|
303
303
|
padding: 4px 8px;
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
|
|
308
308
|
.command-palette__close:hover {
|
|
309
309
|
background: rgba(255, 255, 255, 0.1);
|
|
310
|
-
color: var(--
|
|
310
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
.command-palette__content {
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
.command-palette__empty {
|
|
320
320
|
padding: 24px;
|
|
321
321
|
text-align: center;
|
|
322
|
-
color: var(--
|
|
322
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
.command-palette__group {
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
font-weight: 600;
|
|
336
336
|
text-transform: uppercase;
|
|
337
337
|
letter-spacing: 0.05em;
|
|
338
|
-
color: var(--
|
|
338
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
.command-palette__group-icon {
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
background: transparent;
|
|
352
352
|
border: none;
|
|
353
353
|
text-align: left;
|
|
354
|
-
color: var(--
|
|
354
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
355
355
|
cursor: pointer;
|
|
356
356
|
font-size: 14px;
|
|
357
357
|
transition: background 0.1s ease;
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
.command-palette__item--selected {
|
|
366
|
-
background: var(--
|
|
366
|
+
background: var(--ide-interactive, #4a8db7) !important;
|
|
367
367
|
color: #fff;
|
|
368
368
|
}
|
|
369
369
|
|
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
padding: 2px 6px;
|
|
393
393
|
background: rgba(255, 255, 255, 0.1);
|
|
394
394
|
border-radius: 4px;
|
|
395
|
-
color: var(--
|
|
395
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
.command-palette__item--selected .command-palette__item-shortcut {
|
|
@@ -405,8 +405,8 @@
|
|
|
405
405
|
justify-content: center;
|
|
406
406
|
gap: 24px;
|
|
407
407
|
padding: 10px 16px;
|
|
408
|
-
border-top: 1px solid var(--
|
|
409
|
-
background: var(--
|
|
408
|
+
border-top: 1px solid var(--ide-border, #a8c5d9);
|
|
409
|
+
background: var(--ide-bg-elevated, #1a2744);
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
.command-palette__hint {
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
align-items: center;
|
|
415
415
|
gap: 6px;
|
|
416
416
|
font-size: 11px;
|
|
417
|
-
color: var(--
|
|
417
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
.command-palette__hint kbd {
|
|
@@ -83,9 +83,11 @@
|
|
|
83
83
|
* Get the color based on score level
|
|
84
84
|
*/
|
|
85
85
|
function getColor(score: number): string {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return '
|
|
86
|
+
// Bands match the analyzer's levels: critical >= 85, high >= 70,
|
|
87
|
+
// medium otherwise (lines below the minScore threshold aren't shown).
|
|
88
|
+
if (score >= 85) return 'var(--ide-error)'; // Critical
|
|
89
|
+
if (score >= 70) return 'var(--ide-warning)'; // High
|
|
90
|
+
return 'var(--ide-info)'; // Medium
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
/**
|
|
@@ -234,8 +236,8 @@
|
|
|
234
236
|
min-width: 200px;
|
|
235
237
|
max-width: 300px;
|
|
236
238
|
padding: 12px;
|
|
237
|
-
background: var(--
|
|
238
|
-
border: 1px solid var(--
|
|
239
|
+
background: var(--ide-bg-secondary, #1a2744);
|
|
240
|
+
border: 1px solid var(--ide-border, #a8c5d9);
|
|
239
241
|
border-radius: 8px;
|
|
240
242
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
241
243
|
font-size: 12px;
|
|
@@ -263,11 +265,11 @@
|
|
|
263
265
|
|
|
264
266
|
.complexity-tooltip__title {
|
|
265
267
|
font-weight: 600;
|
|
266
|
-
color: var(--
|
|
268
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
267
269
|
}
|
|
268
270
|
|
|
269
271
|
.complexity-tooltip__lines {
|
|
270
|
-
color: var(--
|
|
272
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
271
273
|
font-size: 11px;
|
|
272
274
|
margin-bottom: 8px;
|
|
273
275
|
}
|
|
@@ -276,7 +278,7 @@
|
|
|
276
278
|
padding: 8px;
|
|
277
279
|
background: rgba(255, 255, 255, 0.05);
|
|
278
280
|
border-radius: 4px;
|
|
279
|
-
color: var(--
|
|
281
|
+
color: var(--ide-text-secondary, #a8c5d9);
|
|
280
282
|
line-height: 1.4;
|
|
281
283
|
margin-bottom: 8px;
|
|
282
284
|
}
|
|
@@ -285,7 +287,7 @@
|
|
|
285
287
|
display: flex;
|
|
286
288
|
gap: 12px;
|
|
287
289
|
font-size: 10px;
|
|
288
|
-
color: var(--
|
|
290
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
289
291
|
}
|
|
290
292
|
|
|
291
293
|
.complexity-tooltip__factors span {
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
font-size: 10px;
|
|
309
309
|
font-weight: 600;
|
|
310
310
|
color: #fff;
|
|
311
|
-
border: 2px solid var(--
|
|
311
|
+
border: 2px solid var(--ide-bg-secondary, #1a2744);
|
|
312
312
|
margin-left: -8px;
|
|
313
313
|
}
|
|
314
314
|
|
|
@@ -344,8 +344,8 @@
|
|
|
344
344
|
min-width: 220px;
|
|
345
345
|
max-width: 300px;
|
|
346
346
|
padding: 12px;
|
|
347
|
-
background: var(--
|
|
348
|
-
border: 1px solid var(--
|
|
347
|
+
background: var(--ide-bg-secondary, #1a2744);
|
|
348
|
+
border: 1px solid var(--ide-border, #a8c5d9);
|
|
349
349
|
border-radius: 8px;
|
|
350
350
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
351
351
|
font-size: 12px;
|
|
@@ -372,14 +372,14 @@
|
|
|
372
372
|
|
|
373
373
|
.conflict-tooltip__title {
|
|
374
374
|
font-weight: 600;
|
|
375
|
-
color: var(--
|
|
375
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
.conflict-tooltip__region {
|
|
379
379
|
padding: 6px 8px;
|
|
380
380
|
background: rgba(255, 255, 255, 0.05);
|
|
381
381
|
border-radius: 4px;
|
|
382
|
-
color: var(--
|
|
382
|
+
color: var(--ide-text-secondary, #a8c5d9);
|
|
383
383
|
margin-bottom: 8px;
|
|
384
384
|
}
|
|
385
385
|
|
|
@@ -405,12 +405,12 @@
|
|
|
405
405
|
|
|
406
406
|
.conflict-tooltip__name {
|
|
407
407
|
flex: 1;
|
|
408
|
-
color: var(--
|
|
408
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
.conflict-tooltip__line {
|
|
412
412
|
font-size: 10px;
|
|
413
|
-
color: var(--
|
|
413
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
.ai-badge {
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
background: rgba(255, 200, 0, 0.1);
|
|
429
429
|
border-radius: 4px;
|
|
430
430
|
border-left: 2px solid #eab308;
|
|
431
|
-
color: var(--
|
|
431
|
+
color: var(--ide-text-secondary, #a8c5d9);
|
|
432
432
|
font-size: 11px;
|
|
433
433
|
line-height: 1.4;
|
|
434
434
|
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import CommandPalette from './CommandPalette.svelte';
|
|
27
27
|
import { getComplexityAnalyzer, type ComplexityMetrics } from './core/complexity-analyzer';
|
|
28
28
|
import { registerSemanticFoldCommands } from './core/commands';
|
|
29
|
-
import { getSemanticAnalyzer } from './core/semantic-analyzer';
|
|
29
|
+
import { getSemanticAnalyzer, type FoldPreset } from './core/semantic-analyzer';
|
|
30
30
|
import type { AIAwareness } from './core/ai-awareness';
|
|
31
31
|
import {
|
|
32
32
|
CURSOR_BLINK_MS,
|
|
@@ -501,6 +501,38 @@
|
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
+
/**
|
|
505
|
+
* Collapse every semantic region whose category is listed in `preset.hide`,
|
|
506
|
+
* after first expanding everything so presets compose predictably. Shared by
|
|
507
|
+
* the command-palette preset commands and the exported imperative API.
|
|
508
|
+
*/
|
|
509
|
+
function applyFoldPresetInternal(preset: FoldPreset) {
|
|
510
|
+
if (!folding || !editorState) return;
|
|
511
|
+
foldManager.expandAll();
|
|
512
|
+
const analyzer = getSemanticAnalyzer();
|
|
513
|
+
const regions = analyzer.analyze(editorState.lines, language);
|
|
514
|
+
for (const category of preset.hide) {
|
|
515
|
+
for (const region of analyzer.getByCategory(regions, category)) {
|
|
516
|
+
foldManager.collapse(region.startLine);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Imperative API (accessible via `bind:this`): apply a semantic fold preset.
|
|
523
|
+
*/
|
|
524
|
+
export function applyFoldPreset(preset: FoldPreset) {
|
|
525
|
+
applyFoldPresetInternal(preset);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Imperative API (accessible via `bind:this`): expand all folded regions.
|
|
530
|
+
*/
|
|
531
|
+
export function unfoldAll() {
|
|
532
|
+
if (!folding || !editorState) return;
|
|
533
|
+
foldManager.expandAll();
|
|
534
|
+
}
|
|
535
|
+
|
|
504
536
|
function handleFoldIndicatorClick(lineNumber: number, e: MouseEvent) {
|
|
505
537
|
e.preventDefault();
|
|
506
538
|
e.stopPropagation();
|
|
@@ -787,17 +819,7 @@
|
|
|
787
819
|
foldManager?.expandAll();
|
|
788
820
|
},
|
|
789
821
|
onApplyPreset: (preset) => {
|
|
790
|
-
|
|
791
|
-
foldManager?.expandAll();
|
|
792
|
-
// Then collapse categories that should be hidden
|
|
793
|
-
const analyzer = getSemanticAnalyzer();
|
|
794
|
-
const regions = analyzer.analyze(editorState.lines, language);
|
|
795
|
-
for (const category of preset.hide) {
|
|
796
|
-
const categoryRegions = analyzer.getByCategory(regions, category);
|
|
797
|
-
for (const region of categoryRegions) {
|
|
798
|
-
foldManager?.collapse(region.startLine);
|
|
799
|
-
}
|
|
800
|
-
}
|
|
822
|
+
applyFoldPresetInternal(preset);
|
|
801
823
|
},
|
|
802
824
|
getLanguage: () => language
|
|
803
825
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorPreferences } from '../../types';
|
|
2
2
|
import { type Cursor } from './core';
|
|
3
3
|
import { type ComplexityMetrics } from './core/complexity-analyzer';
|
|
4
|
+
import { type FoldPreset } from './core/semantic-analyzer';
|
|
4
5
|
import type { AIAwareness } from './core/ai-awareness';
|
|
5
6
|
interface Props {
|
|
6
7
|
content: string;
|
|
@@ -32,6 +33,9 @@ interface Props {
|
|
|
32
33
|
onComplexityChange?: (metrics: ComplexityMetrics | null) => void;
|
|
33
34
|
onSave?: () => void;
|
|
34
35
|
}
|
|
35
|
-
declare const CustomEditor: import("svelte").Component<Props, {
|
|
36
|
+
declare const CustomEditor: import("svelte").Component<Props, {
|
|
37
|
+
applyFoldPreset: (preset: FoldPreset) => void;
|
|
38
|
+
unfoldAll: () => void;
|
|
39
|
+
}, "content">;
|
|
36
40
|
type CustomEditor = ReturnType<typeof CustomEditor>;
|
|
37
41
|
export default CustomEditor;
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const ext = $derived(getExtension(filename));
|
|
76
|
-
const
|
|
76
|
+
const colorKey = $derived(ext || filename.toLowerCase().replace(/^\./, ''));
|
|
77
|
+
const color = $derived(extensionColors[colorKey] ?? 'var(--ide-text-muted)');
|
|
77
78
|
|
|
78
79
|
// Simple file type icon paths
|
|
79
80
|
const icons = {
|
|
@@ -347,8 +347,8 @@
|
|
|
347
347
|
min-width: 280px;
|
|
348
348
|
max-width: 400px;
|
|
349
349
|
padding: 12px;
|
|
350
|
-
background: var(--
|
|
351
|
-
border: 1px solid var(--
|
|
350
|
+
background: var(--ide-bg-secondary, #1a2744);
|
|
351
|
+
border: 1px solid var(--ide-border, #a8c5d9);
|
|
352
352
|
border-radius: 8px;
|
|
353
353
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
354
354
|
font-size: 12px;
|
|
@@ -382,12 +382,12 @@
|
|
|
382
382
|
|
|
383
383
|
.tooltip-author {
|
|
384
384
|
font-weight: 600;
|
|
385
|
-
color: var(--
|
|
385
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
.tooltip-email {
|
|
389
389
|
font-size: 11px;
|
|
390
|
-
color: var(--
|
|
390
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
.tooltip-commit {
|
|
@@ -407,12 +407,12 @@
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
.tooltip-date {
|
|
410
|
-
color: var(--
|
|
410
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
411
411
|
font-size: 11px;
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
.tooltip-message {
|
|
415
|
-
color: var(--
|
|
415
|
+
color: var(--ide-text-primary, #f4f1e0);
|
|
416
416
|
line-height: 1.4;
|
|
417
417
|
margin-bottom: 8px;
|
|
418
418
|
}
|
|
@@ -429,8 +429,8 @@
|
|
|
429
429
|
|
|
430
430
|
.tooltip-hint {
|
|
431
431
|
font-size: 10px;
|
|
432
|
-
color: var(--
|
|
433
|
-
border-top: 1px solid var(--
|
|
432
|
+
color: var(--ide-text-muted, #a8c5d9);
|
|
433
|
+
border-top: 1px solid var(--ide-border, #a8c5d9);
|
|
434
434
|
padding-top: 8px;
|
|
435
435
|
margin-top: 4px;
|
|
436
436
|
}
|