Repository navigation
feat(chat): sender-built link previews - #1071
Merged
Merged
Conversation
bmc08gt
force-pushed
the
feat/link-preview-send
branch
from
October 15, 2026 21:41
38e0bcd to
d4e1044
Compare
bmc08gt
changed the base branch from
chore/sync-contract-ocp-00ea80d0-flipcash2-1897108a
to
main
October 15, 2026 21:41
bmc08gt
marked this pull request as ready for review
October 16, 2026 01:02
…e store A text message now holds the sender's `MessageLinkPreview` (url, title, description, image) next to its text. It goes out in `TextContent.link_previews`, plaintext and sealed, and is read back from both, dropping a preview whose url is not a whole link in the text or whose title is empty. A sealed preview's image is checked like encrypted media; one uploaded for the other encryption mode is left off. An edit sends no new fetch: it keeps the stored preview while its link is still whole in the edited text, and the local rewrite does the same. The store keeps the preview in a new `conversation_message.linkPreviewJson` column, so `Database.schemaVersion` goes to 52.
… text The composer fetches the draft's first web link, uploads the page image through the chat photo uploader (sealed for an encrypted chat), and shows a 56pt thumbnail with a remove control beside the field. A text send attaches the preview only if it is ready, its URL is still a whole link in the text, and its title cleans to something; a send never waits on it. No preview is built while photos are staged, since a caption carries none, or during an edit. The fetcher no longer reads the webLinkPreviews flag.
…ceive-side fetch A recipient now draws a web card only from the preview its sender attached: the card sits at the first place the preview's url appears in the text as a whole link, and a preview whose url is not there, or whose title is empty, draws nothing. No fetch rule is applied on read, so a link the composer would not fetch still draws if the sender's platform previewed it. The image loads through the chat photo resolver, so a sealed preview image decrypts the same way a sealed photo does. A Flipcash card in the same text still wins. Removed with no fallback, since the receive-side fetch never shipped: the web paths in LinkCardFeed, LinkCardResolver and LinkCardMemo, the transcript prefetch and the first-paint wait on the memo, the tap-to-load mode and chip, WebImageDiskCache, the linkPreview table, and the webLinkPreviews beta flag with its settings row. The page fetcher stays for the composer.
…mage uploads The composer chip only drew the page's image once the upload finished, and a failed upload left the link glyph, so the sender rarely saw what would be sent. The fetch and the upload are now two steps: the card appears as soon as the page is fetched, with the image under a spinner while it uploads. The chip widens to the field and shows the title, description and host next to the image. A send while the image is still uploading goes with the title and description only, as before. A failed upload drops the thumbnail so the card matches what will be sent.
A caption carries no link preview, so staging a photo hid the preview card and dropped it from the send. The card now stays up with photos staged, and when it has a preview the text goes out as its own message after the photos instead of as the last photo's caption. A reply still goes on the first photo only.
…to it The link card's remove button floated alone at the card's trailing edge, unlike a staged photo's. It now sits on the image's top-trailing corner through the same button as the photo chip. The image grows to 80pt and the description wraps to two lines to fill the height.
…remove button on the corner
The draft is restored before the bottom bar starts watching it, so a link already in a saved draft never reached the preview.
bmc08gt
force-pushed
the
feat/link-preview-send
branch
from
October 16, 2026 01:08
3a37fc9 to
38dff33
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on flipcash2 0.19.0 (#1065). Design: code-payments/flipcash-client-orchestrator#49,
docs/specs/link-preview-send.md.Link previews move from the recipient to the sender. The composer fetches the draft's link, and the message carries the preview in
TextContent.link_previews, plaintext or sealed. Recipients draw it from the message and fetch nothing.Sender
LinkPreviewSendChecks(9f06aeb), run against the sharedlink_preview_send.jsonvectors.Wire and store
linkPreviewJsoncolumn onconversation_message.Database.schemaVersion51 → 52, which wipes and rebuilds the store. ThelinkPreviewtable is dropped in the same bump, since only the receive-side memo used it.Recipient
http:link, or a host iOS wouldn't fetch, still draws if the sender's platform previewed it.ChatMediaURLResolver, so a sealed preview image decrypts and caches the same way a sealed photo does.Removed
The receive-side fetch never shipped, so it is gone with no fallback:
LinkCardFeed,LinkCardResolverandLinkCardMemoWebImageDiskCacheand thelinkPreviewtablewebLinkPreviewsbeta flag and its settings rowThe page fetcher stays because the composer uses it. There was no hardcoded 17408 ciphertext cap to raise.
Decisions the spec leaves open