-
Notifications
You must be signed in to change notification settings - Fork 45
fix: link preview generation after acceptance and blinking issue #1725
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?
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 refactors link preview functionality to fix issues with link preview generation after user acceptance and to resolve a blinking issue. The changes extract link preview logic from CompositionBox into a standalone component with improved state management and caching.
Key Changes:
- Added optional callback to
showLinkSharingConfirmationModalDialogto enable link previews on user acceptance - Refactored link preview logic into
SessionStagedLinkPreviewcomponent with a newPreviewFetchclass and caching mechanism - Introduced
enabledLinkPreviewsDuringLinkPastestate to handle link preview generation after user accepts the setting
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| ts/interactions/conversationInteractions.ts | Added optional onOk callback parameter to enable link previews upon user confirmation |
| ts/components/conversation/composition/CompositionBox.tsx | Removed link preview logic, added state flag for paste-triggered preview enablement, passes draft and flag to SessionStagedLinkPreview |
| ts/components/conversation/SessionStagedLinkPreview.tsx | Complete refactor with PreviewFetch class, module-level cache Map, and hook-based state management for link preview fetching and display |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2dd7e57 to
12ad9d4
Compare
e4f2e98 to
6972b34
Compare
| draft: string; | ||
| enabledLinkPreviewsDuringLinkPaste: boolean; | ||
| }; | ||
| export const SessionStagedLinkPreview = (props: Props) => { |
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.
new line please
300b2b1 to
0d8b43e
Compare
No description provided.