feat: document preview widget in chat#4512
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 600b3ffc58
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…-close Address review feedback on PR #4512 (#4639 follow-up): - Replace windowState.togglePanel(.documentEditor) with windowState.selection = .panel(.documentEditor) in handleDocumentEditorShow and handleDocumentLoadResponse to avoid accidentally closing the editor panel when a second document_editor_show or document_load_response message arrives while the panel is already open (e.g. when multiple document preview widgets are present in chat and the user clicks one whose document is already loaded) Co-Authored-By: Claude <noreply@anthropic.com>
…-close (#4828) Address review feedback on PR #4512 (#4639 follow-up): - Replace windowState.togglePanel(.documentEditor) with windowState.selection = .panel(.documentEditor) in handleDocumentEditorShow and handleDocumentLoadResponse to avoid accidentally closing the editor panel when a second document_editor_show or document_load_response message arrives while the panel is already open (e.g. when multiple document preview widgets are present in chat and the user clicks one whose document is already loaded) Co-authored-by: marinatrajk <marina@odyseek.com> Co-authored-by: Claude <noreply@anthropic.com>
|
Addressed in #4828 The P1 feedback (use tapped documentSurfaceId) was also addressed in PR #4639 by using the surfaceId from the notification payload and calling sendDocumentLoad when the document isn't in memory. PR #4828 adds the complementary fix in MainWindow.swift to replace togglePanel with direct selection assignment, preventing the panel from accidentally closing. The P2 feedback (persist document preview surfaces) was addressed in PR #4639 by auto-tracking ui_surface_show messages from tools in currentTurnSurfaces so they survive app restarts. |
Summary
document_createruns, emit aui_surface_show(typedocument_preview) so a clickable card appears inline in the chat message alongside the RTE panel openingInlineDocumentPreviewSwift view (doc icon + title + subtitle) that postsMainWindow.openDocumentEditornotification on tap; wired intoInlineSurfaceRouteralongside the existing dynamic page preview patternMainWindowViewto handle theopenDocumentEditornotification by settingwindowState.selection = .panel(.documentEditor), always opening the panel (never accidentally closing it)🤖 Generated with Claude Code