Skip to content

Commit 009d001

Browse files
dxllivcursoragent
andcommitted
Revamp Debug into OWD diagnostics and PrimeVue theme lab.
Replace the minimal state/config tabs with a sidebar shell for desktop inspection, store snapshots, terminal commands, and kit-primevue component showcases in a larger maximizable window. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a002376 commit 009d001

25 files changed

Lines changed: 1915 additions & 187 deletions

src/module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default defineNuxtModule({
1818

1919
addComponentsDir({
2020
path: resolve('./runtime/components'),
21+
pathPrefix: false,
2122
})
2223
}
2324

@@ -32,7 +33,7 @@ export default defineNuxtModule({
3233

3334
registerTailwindPath(
3435
nuxt,
35-
resolve('./runtime/components/**/*.{vue,mjs,ts}'),
36+
resolve('./runtime/**/*.{vue,mjs,ts}'),
3637
)
3738
}
3839
},

src/runtime/app.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ export default {
88
main: {
99
component: () => import('./components/Window/WindowDebug.vue'),
1010
resizable: true,
11+
maximizable: true,
1112
size: {
12-
width: 400,
13-
height: 500,
13+
width: 960,
14+
height: 720,
15+
minWidth: 720,
16+
minHeight: 480,
1417
},
1518
},
1619
},
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
id: string
4+
title: string
5+
subtitle?: string
6+
category?: string
7+
full?: boolean
8+
footer?: string
9+
}>()
10+
</script>
11+
12+
<template>
13+
<section
14+
:id="id"
15+
class="debug-block"
16+
:class="{ 'debug-block--full': full }"
17+
>
18+
<header class="debug-block__header">
19+
<div class="debug-block__titles">
20+
<h3 class="debug-block__title">{{ title }}</h3>
21+
<p v-if="subtitle" class="debug-block__subtitle">{{ subtitle }}</p>
22+
</div>
23+
<Tag v-if="category" :value="category" severity="secondary" class="debug-block__badge" />
24+
</header>
25+
26+
<div class="debug-block__body">
27+
<slot />
28+
</div>
29+
30+
<p v-if="footer" class="debug-block__footer">{{ footer }}</p>
31+
</section>
32+
</template>
33+
34+
<style scoped lang="scss">
35+
.debug-block {
36+
height: fit-content;
37+
padding: 1rem;
38+
background: rgba(0, 0, 0, 0.18);
39+
border: 1px solid var(--owd-surface-700, #1d293d);
40+
border-radius: 8px;
41+
42+
&--full {
43+
grid-column: 1 / -1;
44+
}
45+
46+
&__header {
47+
display: flex;
48+
align-items: flex-start;
49+
justify-content: space-between;
50+
gap: 0.75rem;
51+
margin-bottom: 0.875rem;
52+
padding-bottom: 0.625rem;
53+
border-bottom: 1px solid var(--owd-surface-700, #1d293d);
54+
}
55+
56+
&__titles {
57+
display: flex;
58+
flex-direction: column;
59+
gap: 0.125rem;
60+
min-width: 0;
61+
}
62+
63+
&__title {
64+
margin: 0;
65+
font-size: 0.9375rem;
66+
font-weight: 600;
67+
color: var(--owd-color, #e8eef6);
68+
}
69+
70+
&__subtitle {
71+
margin: 0;
72+
font-size: 0.75rem;
73+
color: rgba(200, 212, 228, 0.55);
74+
}
75+
76+
&__badge {
77+
flex-shrink: 0;
78+
font-size: 0.65rem;
79+
text-transform: uppercase;
80+
letter-spacing: 0.04em;
81+
}
82+
83+
&__body {
84+
display: flex;
85+
flex-direction: column;
86+
gap: 0.75rem;
87+
}
88+
89+
&__footer {
90+
margin: 0.75rem 0 0;
91+
font-size: 0.75rem;
92+
color: rgba(200, 212, 228, 0.45);
93+
font-style: italic;
94+
}
95+
}
96+
</style>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<script setup lang="ts">
2+
import { computed, ref } from 'vue'
3+
import { serializeForDebug } from './utils/utilSerialize'
4+
5+
const props = defineProps<{
6+
value: unknown
7+
note?: string
8+
}>()
9+
10+
const copied = ref(false)
11+
12+
const text = computed(() => {
13+
if (typeof props.value === 'string') {
14+
return props.value
15+
}
16+
return serializeForDebug(props.value)
17+
})
18+
19+
async function copy() {
20+
try {
21+
await navigator.clipboard.writeText(text.value)
22+
copied.value = true
23+
setTimeout(() => {
24+
copied.value = false
25+
}, 1500)
26+
} catch {
27+
// clipboard unavailable
28+
}
29+
}
30+
</script>
31+
32+
<template>
33+
<div class="debug-code-block">
34+
<div class="debug-code-block__toolbar">
35+
<span v-if="note" class="debug-code-block__note">{{ note }}</span>
36+
<Button
37+
type="button"
38+
size="small"
39+
severity="secondary"
40+
variant="text"
41+
:label="copied ? 'Copied' : 'Copy'"
42+
@click="copy"
43+
/>
44+
</div>
45+
<pre class="debug-code-block__pre">{{ text }}</pre>
46+
</div>
47+
</template>
48+
49+
<style scoped lang="scss">
50+
.debug-code-block {
51+
&__toolbar {
52+
display: flex;
53+
align-items: center;
54+
justify-content: space-between;
55+
gap: 0.5rem;
56+
margin-bottom: 0.5rem;
57+
}
58+
59+
&__note {
60+
font-size: 0.75rem;
61+
color: rgba(200, 212, 228, 0.55);
62+
}
63+
64+
&__pre {
65+
margin: 0;
66+
padding: 0.75rem;
67+
max-height: 320px;
68+
overflow: auto;
69+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
70+
font-size: 0.75rem;
71+
line-height: 1.45;
72+
background: rgba(0, 0, 0, 0.25);
73+
border: 1px solid var(--owd-surface-700, #1d293d);
74+
border-radius: 6px;
75+
color: var(--owd-color, #e8eef6);
76+
white-space: pre-wrap;
77+
word-break: break-word;
78+
}
79+
}
80+
</style>

0 commit comments

Comments
 (0)