docs(demos): add AssistantPageExample demo#318
Conversation
WalkthroughThe PR introduces a new chat assistant demo page component with conversation management, message handling, file drag-and-drop support, and MCP tool integration. An existing container demo's default visibility state is toggled, and documentation is updated to separately reference the two example implementations. Changes
Sequence DiagramsequenceDiagram
actor User
participant Page as AssistantPage
participant Conv as useConversation
participant Engine as Conversation<br/>Engine
participant Tool as toolPlugin<br/>(MCP)
participant UI as Bubble List<br/>UI
User->>Page: Send message
activate Page
Page->>Conv: sendMessage()
activate Conv
Conv->>Engine: Process message
activate Engine
Engine->>Tool: Execute tool call
activate Tool
Tool-->>Engine: Tool result
deactivate Tool
Engine-->>Conv: Response ready
deactivate Engine
Conv-->>Page: Update state
deactivate Conv
Page->>UI: Render response bubble
deactivate Page
UI-->>User: Display result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/demos/examples/AssistantPageExample.vue (1)
348-348: UnusedsuggestionOpenref.The
suggestionOpenref is declared and written to in the watcher, but it's never read to control any UI element. Consider removing it if not needed.🧹 Proposed cleanup
const senderRef = ref<InstanceType<typeof TrSender> | null>(null) const inputMessage = ref('') const currentTemplate = ref<UserItem[]>([]) -const suggestionOpen = ref(false)And remove the watcher at lines 406-413:
-watch( - () => inputMessage.value, - (value) => { - if (suggestionOpen.value && value === '') { - suggestionOpen.value = false - } - }, -)Also applies to: 406-413
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/demos/examples/AssistantPageExample.vue` at line 348, Remove the unused suggestionOpen ref and its associated watcher: delete the const suggestionOpen = ref(false) declaration and remove the watcher that only writes to suggestionOpen (the watcher callback that toggles suggestionOpen based on suggestions/commands). If the UI should respond instead, replace the watcher logic to update the actual reactive/UI state used elsewhere (e.g., a visible prop or computed) otherwise simply delete both the declaration and the watcher to clean up dead code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/demos/examples/AssistantPageExample.vue`:
- Line 348: Remove the unused suggestionOpen ref and its associated watcher:
delete the const suggestionOpen = ref(false) declaration and remove the watcher
that only writes to suggestionOpen (the watcher callback that toggles
suggestionOpen based on suggestions/commands). If the UI should respond instead,
replace the watcher logic to update the actual reactive/UI state used elsewhere
(e.g., a visible prop or computed) otherwise simply delete both the declaration
and the watcher to clean up dead code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2b642066-bbeb-4071-8250-9e6eb9023123
📒 Files selected for processing (3)
docs/demos/examples/AssistantContainerExample.vuedocs/demos/examples/AssistantPageExample.vuedocs/src/examples/assistant.md
📦 Package Previewpnpm add https://pkg.pr.new/@opentiny/tiny-robot@de82d20 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-kit@de82d20 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-svgs@de82d20 commit: de82d20 |
🧹 Preview Cleaned UpThe preview deployment has been removed. |

Summary by CodeRabbit
Documentation