Skip to content

Conversation

@jbsession
Copy link
Collaborator

This PR changes how we show the dialog for enabling link preview.

Show only the dialog when a user pastes a link instead of typing it.

Comment on lines 44 to 50
// We can only get the latest copied item from the clipboard
val clipText = clipboard.primaryClip
?.getItemAt(0)
?.coerceToText(context)
?.toString()

val copiedFromClipboard = !clipText.isNullOrEmpty() && inserted == clipText
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really care if this is from clipboard? I feel like any "bulk insert" alone warrants the link preview generation prompt

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah this can probably be removed.

Copy link
Collaborator

@SessionHero01 SessionHero01 left a comment

Choose a reason for hiding this comment

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

LGTM

import android.content.res.Resources
import android.net.Uri
import android.util.AttributeSet
import android.util.Log
Copy link
Collaborator

Choose a reason for hiding this comment

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

May need to clean up the import or use our Log instead

@jbsession jbsession merged commit 1a4a122 into session-foundation:dev Dec 16, 2025
4 checks passed
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