@@ -157,8 +188,13 @@ const recentOffset = computed(() =>
!query.value.trim() && spotlightStore.recentItems.length > 0 ? spotlightStore.recentItems.length : 0
)
+// "Talk to AIUI about it" is appended after the matches, so it is the last
+// selectable row whenever there is a query (including the zero-match case,
+// where it is the only one).
+const askAiuiIndex = computed(() => filteredItems.value.length)
+
const selectableCount = computed(() => {
- if (query.value.trim()) return filteredItems.value.length
+ if (query.value.trim()) return filteredItems.value.length + 1
return recentOffset.value + allSearchableItems.value.length
})
@@ -247,6 +283,17 @@ function selectItem(item: SearchableItem) {
}
}
+// Hand the raw typed text to AIUI instead of trying to match it to a screen.
+// The nonce is what makes re-asking the identical question work: without a
+// changing query the router treats the push as a no-op and Chat.vue never sees
+// a new `ask` to forward.
+function askAiui() {
+ const text = query.value.trim()
+ if (!text) return
+ spotlightStore.close()
+ router.push({ path: '/dashboard/chat', query: { ask: text, askedAt: String(Date.now()) } })
+}
+
function selectHelpItem(section: { id: string }, item: { id: string; label: string; path?: string; content?: string; relatedPath?: string }) {
const type = section.id === 'navigate' ? 'navigate' : section.id === 'learn' ? 'learn' : 'action'
spotlightStore.addRecentItem({
@@ -315,6 +362,7 @@ function onInputKeydown(e: KeyboardEvent) {
e.preventDefault()
const idx = spotlightStore.selectedIndex
if (query.value.trim()) {
+ if (idx === askAiuiIndex.value) { askAiui(); return }
const item = filteredItems.value[idx]
if (item) selectItem(item)
return
diff --git a/neode-ui/src/views/Chat.vue b/neode-ui/src/views/Chat.vue
index 06d638fc..e486fa7b 100644
--- a/neode-ui/src/views/Chat.vue
+++ b/neode-ui/src/views/Chat.vue
@@ -63,8 +63,8 @@