-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: preview panel #7092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat: preview panel #7092
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a side preview panel feature that allows users to view content (tool outputs, Mermaid diagrams, markdown messages, and reasoning output) in a dedicated panel, improving content readability and UX when dealing with long tool outputs or complex visualizations.
Key Changes
- Added a new Zustand-based state management hook (
useToolCallPanel) to manage panel open/close state and panel data - Implemented
SidePreviewPanelcomponent with support for multiple content types (tool calls, Mermaid diagrams, messages, thinking/reasoning) - Integrated "View in Panel" buttons across tool call blocks, thinking blocks, message content, and Mermaid code blocks
- Added Mermaid diagram rendering support with new utility functions and renderer component
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
web-app/src/hooks/useToolCallPanel.ts |
New Zustand hook managing preview panel state with mutual exclusivity to left panel |
web-app/src/containers/ToolCallPanel.tsx |
New side panel component supporting multiple content types with copy/download functionality |
web-app/src/components/MermaidRenderer.tsx |
New component for rendering Mermaid diagrams with error handling |
web-app/src/lib/utils.ts |
Added utility functions to detect and extract Mermaid diagrams from markdown |
web-app/src/containers/ToolCallBlock.tsx |
Added "View in Panel" button to tool call blocks |
web-app/src/containers/ThinkingBlock.tsx |
Added "View in Panel" button to thinking/reasoning blocks |
web-app/src/containers/ThreadContent.tsx |
Added "View in Panel" button to message content |
web-app/src/containers/RenderMarkdown.tsx |
Added "View in Panel" button for Mermaid code blocks |
web-app/src/routes/threads/$threadId.tsx |
Integrated panel into thread layout with responsive design |
web-app/src/containers/LeftPanel.tsx |
Added logic to close preview panel when left panel opens |
web-app/src/containers/HeaderPage.tsx |
Added logic to close preview panel when left panel opens via header toggle |
web-app/src/providers/KeyboardShortcuts.tsx |
Added logic to close preview panel on sidebar keyboard shortcut |
web-app/src/containers/dialogs/AppUpdater.tsx |
Changed z-index from z-50 to z-60 (likely to appear above preview panel) |
web-app/src/locales/en/common.json |
Added new translation keys for panel UI elements |
web-app/package.json |
Added mermaid dependency (^11.12.2) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@louis-jan I'd like to ask a question about this. I've been contemplating adding in a feature like this to my local Jan install, but actually by making it available to Jan in an agentic fashion -- giving it a self-hosted MCP server that it can use to update a shared artifact with the user. This would allow for what you have added here, but in a very different fashion as it would allow continued back and forth interaction with the user through both the conversation and through changes to the artifact. Paradigmatically I think it would fit well with where agents are heading. My biggest interest is actually to have a shared rendered markdown editor I can use with Jan, but I would also like to be able to work in other domains and documents as well (esp. mermaid). This way I could ask Jan to prepare some thoughts for me then we could co-edit documents in a google-doc like experience, where the model is able to continuously update portions of the document based on further conversational instruction. So why comment on this PR? It seems partway there for what I've been exploring, but also functionally different, so I was hoping you might share some thoughts on how well what I've outlined might fit on top of what you have written, or whether I should pursue it in a different manner. |
|
Hi @cab938, what a great thought. I did think about it as I also have the same use case, so I mentioned artifacts / interactive content. This PR is more or less a draft and still thinking about
@cab938 I will mark this PR as draft and continue discussing here. |
Describe Your Changes
This PR is to add a side preview panel (later can be artifacts / canvas or interactive content?).
As a user, I find it hard to view the response content, especially when:
Some of the preview content supported in this PR
Fixes Issues
Self Checklist