From 72659afbd3cf3746b9707748e355af48dc2bbdc7 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Sun, 9 Aug 2026 13:52:19 +0800 Subject: [PATCH] feat(agent-documents): replace page navigation with right-side drawer - Create AgentDocumentDrawer.vue: right-side drawer with document list + detail view - AgentSidebar: change document NuxtLink to button emitting showDocuments - AgentToolbar: change document NuxtLink to button emitting showDocuments - AgentChatArea: forward showDocuments event from toolbar to page - Chat page: wire showDocumentDrawer state + render AgentDocumentDrawer Drawer features: - List view with type filter (all/document/memory) + search - Detail view with markdown rendering via AgentMarkdown - Slide-in transition + overlay backdrop - Teleport to body for proper z-index stacking Co-authored-by: CodeFree --- app/components/agent/AgentChatArea.vue | 2 + app/components/agent/AgentDocumentDrawer.vue | 508 +++++++++++++++++++++++++++ app/components/agent/AgentSidebar.vue | 9 +- app/components/agent/AgentToolbar.vue | 7 +- app/pages/chat/[agentSlug]/index.vue | 8 + 5 files changed, 527 insertions(+), 7 deletions(-) create mode 100644 app/components/agent/AgentDocumentDrawer.vue diff --git a/app/components/agent/AgentChatArea.vue b/app/components/agent/AgentChatArea.vue index 9f43a92..02d0a89 100644 --- a/app/components/agent/AgentChatArea.vue +++ b/app/components/agent/AgentChatArea.vue @@ -37,6 +37,7 @@ const emit = defineEmits<{ regenerate: []; toggleSidebar: []; showPrompt: []; + showDocuments: []; example: [content: string]; }>(); @@ -87,6 +88,7 @@ watch( @update:model-id="emit('update:modelId', $event)" @show-prompt="emit('showPrompt')" @toggle-sidebar="emit('toggleSidebar')" + @show-documents="emit('showDocuments')" />
diff --git a/app/components/agent/AgentDocumentDrawer.vue b/app/components/agent/AgentDocumentDrawer.vue new file mode 100644 index 0000000..80bdd4d --- /dev/null +++ b/app/components/agent/AgentDocumentDrawer.vue @@ -0,0 +1,508 @@ + + + + + diff --git a/app/components/agent/AgentSidebar.vue b/app/components/agent/AgentSidebar.vue index 47a3216..2b07444 100644 --- a/app/components/agent/AgentSidebar.vue +++ b/app/components/agent/AgentSidebar.vue @@ -18,6 +18,7 @@ const emit = defineEmits<{ login: []; toggle: []; close: []; + showDocuments: []; }>(); const isAdmin = computed(() => props.user?.role === "admin"); @@ -53,10 +54,10 @@ const isAdmin = computed(() => props.user?.role === "admin");