arkaos 2.92.0 → 2.93.0
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/VERSION +1 -1
- package/dashboard/app/components/ConfirmDialog.vue +61 -0
- package/dashboard/app/components/PersonaDetailDrawer.vue +18 -11
- package/dashboard/app/composables/useConfirmDialog.ts +38 -0
- package/dashboard/app/pages/knowledge.vue +10 -6
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/__pycache__/dashboard-api.cpython-313.pyc +0 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.93.0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// PR75 v2.93.0 — canonical confirm dialog (Nuxt UI v4 pattern).
|
|
3
|
+
//
|
|
4
|
+
// Replaces native window.confirm() calls. Driven by useConfirmDialog()
|
|
5
|
+
// composable, which itself uses useOverlay() to mount this component
|
|
6
|
+
// imperatively. Emits a boolean on close: true = confirm,
|
|
7
|
+
// false = cancel.
|
|
8
|
+
//
|
|
9
|
+
// Per the Nuxt UI v4 docs (https://ui.nuxt.com/docs/composables/use-overlay).
|
|
10
|
+
|
|
11
|
+
interface ConfirmDialogProps {
|
|
12
|
+
title?: string
|
|
13
|
+
description?: string
|
|
14
|
+
confirmLabel?: string
|
|
15
|
+
cancelLabel?: string
|
|
16
|
+
/**
|
|
17
|
+
* Display variant for the confirm button. Use 'error' for destructive
|
|
18
|
+
* actions (delete, etc.) so the dialog visually warns the operator.
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'default' | 'danger'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<ConfirmDialogProps>(), {
|
|
24
|
+
title: 'Confirm action',
|
|
25
|
+
description: '',
|
|
26
|
+
confirmLabel: 'Confirm',
|
|
27
|
+
cancelLabel: 'Cancel',
|
|
28
|
+
variant: 'default',
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const emits = defineEmits<{
|
|
32
|
+
close: [value: boolean]
|
|
33
|
+
}>()
|
|
34
|
+
|
|
35
|
+
const confirmColor = computed(() =>
|
|
36
|
+
props.variant === 'danger' ? 'error' : 'primary',
|
|
37
|
+
)
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<UModal
|
|
42
|
+
:title="title"
|
|
43
|
+
:description="description"
|
|
44
|
+
:dismissible="false"
|
|
45
|
+
:ui="{ footer: 'justify-end' }"
|
|
46
|
+
>
|
|
47
|
+
<template #footer>
|
|
48
|
+
<UButton
|
|
49
|
+
:label="cancelLabel"
|
|
50
|
+
color="neutral"
|
|
51
|
+
variant="outline"
|
|
52
|
+
@click="emits('close', false)"
|
|
53
|
+
/>
|
|
54
|
+
<UButton
|
|
55
|
+
:label="confirmLabel"
|
|
56
|
+
:color="confirmColor"
|
|
57
|
+
@click="emits('close', true)"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
</UModal>
|
|
61
|
+
</template>
|
|
@@ -25,6 +25,7 @@ const emit = defineEmits<{
|
|
|
25
25
|
|
|
26
26
|
const { apiBase } = useApi()
|
|
27
27
|
const toast = useToast()
|
|
28
|
+
const confirmDialog = useConfirmDialog()
|
|
28
29
|
|
|
29
30
|
const detail = ref<DetailResponse | null>(null)
|
|
30
31
|
const editing = ref(false)
|
|
@@ -117,12 +118,14 @@ async function saveEdit() {
|
|
|
117
118
|
|
|
118
119
|
async function deletePersona() {
|
|
119
120
|
if (!props.personaId) return
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
const ok = await confirmDialog({
|
|
122
|
+
title: `Delete persona "${detail.value?.name ?? 'Unknown'}"?`,
|
|
123
|
+
description:
|
|
124
|
+
'Removes it from the JSON store. The Obsidian file (if any) is '
|
|
125
|
+
+ 'left in place — delete manually from Obsidian if you want it gone.',
|
|
126
|
+
confirmLabel: 'Delete persona',
|
|
127
|
+
variant: 'danger',
|
|
128
|
+
})
|
|
126
129
|
if (!ok) return
|
|
127
130
|
deleting.value = true
|
|
128
131
|
try {
|
|
@@ -147,12 +150,16 @@ async function deletePersona() {
|
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
|
|
150
|
-
function closeDrawer() {
|
|
153
|
+
async function closeDrawer() {
|
|
151
154
|
if (editing.value && !saving.value) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
const ok = await confirmDialog({
|
|
156
|
+
title: 'Discard unsaved edits?',
|
|
157
|
+
description: 'Any changes you made will be lost.',
|
|
158
|
+
confirmLabel: 'Discard',
|
|
159
|
+
cancelLabel: 'Keep editing',
|
|
160
|
+
variant: 'danger',
|
|
161
|
+
})
|
|
162
|
+
if (!ok) return
|
|
156
163
|
}
|
|
157
164
|
cancelEdit()
|
|
158
165
|
emit('update:modelValue', false)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// PR75 v2.93.0 — confirm-dialog composable.
|
|
2
|
+
//
|
|
3
|
+
// Async wrapper around the canonical Nuxt UI v4 useOverlay pattern.
|
|
4
|
+
// Replaces every window.confirm() call across the dashboard.
|
|
5
|
+
//
|
|
6
|
+
// Usage:
|
|
7
|
+
// const confirm = useConfirmDialog()
|
|
8
|
+
// const ok = await confirm({
|
|
9
|
+
// title: 'Delete persona',
|
|
10
|
+
// description: 'This removes the persona from the JSON store.',
|
|
11
|
+
// confirmLabel: 'Delete',
|
|
12
|
+
// variant: 'danger',
|
|
13
|
+
// })
|
|
14
|
+
// if (ok) { ... }
|
|
15
|
+
|
|
16
|
+
import { ConfirmDialog } from '#components'
|
|
17
|
+
|
|
18
|
+
export interface ConfirmDialogOptions {
|
|
19
|
+
title: string
|
|
20
|
+
description?: string
|
|
21
|
+
confirmLabel?: string
|
|
22
|
+
cancelLabel?: string
|
|
23
|
+
variant?: 'default' | 'danger'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const useConfirmDialog = () => {
|
|
27
|
+
const overlay = useOverlay()
|
|
28
|
+
|
|
29
|
+
return async (options: ConfirmDialogOptions): Promise<boolean> => {
|
|
30
|
+
const modal = overlay.create(ConfirmDialog, {
|
|
31
|
+
destroyOnClose: true,
|
|
32
|
+
props: options,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const result = await modal.open()
|
|
36
|
+
return result === true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -336,14 +336,18 @@ const vectorSearchActive = computed(() =>
|
|
|
336
336
|
|
|
337
337
|
const deletingSource = ref<string | null>(null)
|
|
338
338
|
|
|
339
|
+
const confirmDialog = useConfirmDialog()
|
|
340
|
+
|
|
339
341
|
async function askDeleteSource(source: string) {
|
|
340
342
|
if (!source) return
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
const ok = await confirmDialog({
|
|
344
|
+
title: 'Delete every indexed chunk from this source?',
|
|
345
|
+
description:
|
|
346
|
+
`${source}\n\nRemoves the source from search results but does NOT `
|
|
347
|
+
+ 'delete the original file. You can re-ingest later if needed.',
|
|
348
|
+
confirmLabel: 'Delete chunks',
|
|
349
|
+
variant: 'danger',
|
|
350
|
+
})
|
|
347
351
|
if (!ok) return
|
|
348
352
|
await deleteSource(source)
|
|
349
353
|
}
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
Binary file
|