stream-chat-android icon indicating copy to clipboard operation
stream-chat-android copied to clipboard

Add ability to cancel link previews

Open andremion opened this issue 5 months ago โ€ข 2 comments

๐ŸŽฏ Goal

Introduce the ability to cancel link previews in the message composer.

๐Ÿ›  Implementation details

  • Added a cancelLinkPreview method to MessageComposerController and MessageComposerViewModel.
  • Updated ComposerLinkPreview to accept an onCancel callback.
  • When sending a message, if linkPreviews is empty, skipEnrichUrl will be set to true.
  • Connected the cancel action in the UI to the new methods.
  • ๐Ÿšจ Breaking change: Updated ChatComponentFactory and MessageComposer to pass the new onCancelLinkPreviewClick callback.

๐ŸŽจ UI Changes

Before After

๐Ÿงช Testing

  • Type a link in the message composer
  • When the link preview appears, click on the close icon to cancel the link preview
  • Send the message

๐ŸŽ‰ GIF

Please provide a suitable gif that describes your work on this pull request

andremion avatar Jun 17 '25 10:06 andremion

SDK Size Comparison ๐Ÿ“

SDK Before After Difference Status
stream-chat-android-client 3.23 MB 3.23 MB 0.00 MB ๐ŸŸข
stream-chat-android-offline 3.46 MB 3.46 MB 0.00 MB ๐ŸŸข
stream-chat-android-ui-components 10.55 MB 10.55 MB 0.00 MB ๐ŸŸข
stream-chat-android-compose 12.76 MB 12.77 MB 0.00 MB ๐ŸŸข

github-actions[bot] avatar Jun 17 '25 10:06 github-actions[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
13.5% Coverage on New Code (required โ‰ฅ 80%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Jun 17 '25 14:06 sonarqubecloud[bot]

This pull request has been automatically marked as stale because it has been inactive for 14 days. It will be closed in 7 days if no further activity occurs.

github-actions[bot] avatar Oct 06 '25 08:10 github-actions[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
51.4% Coverage on New Code (required โ‰ฅ 80%)
4.4% Duplication on New Code (required โ‰ค 3%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Oct 07 '25 19:10 sonarqubecloud[bot]

To be done when we can do breaking changes

andremion avatar Oct 14 '25 12:10 andremion