Skip to content

feat: document preview widget in chat#4512

Merged
marinatrajk merged 1 commit into
mainfrom
feat/document-preview-widget
Feb 18, 2026
Merged

feat: document preview widget in chat#4512
marinatrajk merged 1 commit into
mainfrom
feat/document-preview-widget

Conversation

@marinatrajk

@marinatrajk marinatrajk commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • After document_create runs, emit a ui_surface_show (type document_preview) so a clickable card appears inline in the chat message alongside the RTE panel opening
  • Add InlineDocumentPreview Swift view (doc icon + title + subtitle) that posts MainWindow.openDocumentEditor notification on tap; wired into InlineSurfaceRouter alongside the existing dynamic page preview pattern
  • Wire MainWindowView to handle the openDocumentEditor notification by setting windowState.selection = .panel(.documentEditor), always opening the panel (never accidentally closing it)

🤖 Generated with Claude Code


Open with Devin

Co-Authored-By: Claude <noreply@anthropic.com>
@marinatrajk marinatrajk merged commit 1bbee80 into main Feb 18, 2026
@marinatrajk marinatrajk deleted the feat/document-preview-widget branch February 18, 2026 15:36

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread assistant/src/tools/document/document-tool.ts
marinatrajk pushed a commit that referenced this pull request Feb 19, 2026
…-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>
marinatrajk added a commit that referenced this pull request Feb 19, 2026
…-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>
@marinatrajk

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants