Skip to content

Conversation

@Aerilym
Copy link
Collaborator

@Aerilym Aerilym commented Dec 2, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 2, 2025 05:30
Copy link

Copilot AI left a 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 showLinkSharingConfirmationModalDialog to enable link previews on user acceptance
  • Refactored link preview logic into SessionStagedLinkPreview component with a new PreviewFetch class and caching mechanism
  • Introduced enabledLinkPreviewsDuringLinkPaste state 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.

@Aerilym Aerilym force-pushed the fix/add_image_processing_alternative branch from 2dd7e57 to 12ad9d4 Compare December 2, 2025 22:25
@Aerilym Aerilym force-pushed the fix/refactor_link_previews branch from e4f2e98 to 6972b34 Compare December 2, 2025 22:36
@Aerilym Aerilym changed the base branch from fix/add_image_processing_alternative to dev December 2, 2025 22:37
Bilb
Bilb previously approved these changes Dec 2, 2025
draft: string;
enabledLinkPreviewsDuringLinkPaste: boolean;
};
export const SessionStagedLinkPreview = (props: Props) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

new line please

Bilb
Bilb previously approved these changes Dec 3, 2025
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.

3 participants