Add floating AI chat panel with page context awareness
Replace the standalone /chat page with a bottom-right floating widget available on every page. The panel sends page context with each message so the AI knows what the user is viewing. On the Transactions page, the full visible transaction list (with filters) is serialized into the context so the AI can answer questions about on-screen entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
:title="item.title"
|
||||
:to="item.route"
|
||||
:value="item.route"
|
||||
:active="isNavActive(item.route)"
|
||||
rounded="xl"
|
||||
>
|
||||
<v-tooltip v-if="rail" activator="parent" location="end">{{ item.title }}</v-tooltip>
|
||||
@@ -116,6 +117,8 @@
|
||||
<slot />
|
||||
</v-container>
|
||||
</v-main>
|
||||
|
||||
<ChatPanel />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -124,6 +127,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { useTheme } from 'vuetify'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { useNotifications } from '@/composables/useNotifications'
|
||||
import ChatPanel from '@/components/chat/ChatPanel.vue'
|
||||
import type { AppNotification } from '@/types'
|
||||
|
||||
const drawer = ref(true)
|
||||
@@ -150,13 +154,18 @@ const navItems = [
|
||||
{ title: 'Loans', icon: 'mdi-home-city', route: '/loans' },
|
||||
{ title: 'Reports', icon: 'mdi-chart-bar', route: '/reports' },
|
||||
{ title: 'Investments', icon: 'mdi-finance', route: '/investments' },
|
||||
{ title: 'AI Chat', icon: 'mdi-robot-outline', route: '/chat' },
|
||||
{ title: 'Plugins', icon: 'mdi-puzzle', route: '/plugins' },
|
||||
{ title: 'Settings', icon: 'mdi-cog', route: '/settings' },
|
||||
]
|
||||
|
||||
function isNavActive(navRoute: string) {
|
||||
if (route.path === navRoute) return true
|
||||
// Highlight "Transactions" when viewing account-scoped transactions
|
||||
if (navRoute === '/transactions' && route.name === 'account-transactions') return true
|
||||
return false
|
||||
}
|
||||
|
||||
const currentPageTitle = computed(() => {
|
||||
const item = navItems.find(n => n.route === route.path)
|
||||
const item = navItems.find(n => isNavActive(n.route))
|
||||
return item?.title || 'Purrse'
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user