mirror of
https://github.com/block/buzz.git
synced 2026-11-15 22:02:04 +00:00
A link inside a sentence used to be drawn as its own little widget, so a long label jumped to a line of its own and the words after it started yet another line. Plain links are now text in the sentence: a long label breaks mid-label, and the words after it continue on the same line. Tap still opens the link, a finger on it still tints it, and a hold still opens the link sheet (Open, Copy, Share) instead of the message menu. Buzz chips (channel and message links), audio attachments and repository links keep their current widget look. | Before | After | | --- | --- | | <img alt="before" src="https://github.com/user-attachments/assets/e77aa97a-6ac5-43b9-bc44-cc43fb169c8f" width="300"> | <img alt="after" src="https://github.com/user-attachments/assets/4c76bb23-e6df-4244-bf7e-e1753b727d7b" width="300"> | A finger on a text link tints it, across every line of a wrapped label: <img alt="Pressed tint on a wrapped link" src="https://github.com/user-attachments/assets/1cde5a1a-39aa-4bc7-90f8-8d95b15ee852" width="400"> https://github.com/user-attachments/assets/021dd099-d24b-4370-bf75-e60f273e2a92 ### Regressions One tradeoff, accepted so links can wrap: - **VoiceOver users lose Copy and Share on text links.** VoiceOver still opens the link, but a text span can only expose a tap to accessibility, so the link sheet (Copy, Share) can't be reached on text links with VoiceOver. Chips and repository links keep it. A link nothing can open (such as mailto) shows its sheet on a tap, so it isn't dead for VoiceOver users. Nothing else gets worse. The pressed tint is a translucent paint-only layer drawn on top of the message's Markdown over the link's text boxes, so inline code and table header backgrounds can't hide it, so a press repaints that message and rebuilds nothing; a tint that spans a wrapped label covers both lines, and it stays inside what's visible (a long link in a scrolled table cell tints only inside the table). Each message reuses one recognizer per link across rebuilds and disposes them when its text changes or the message goes away, and a scroll that starts on a link cancels the hold, so it never opens the sheet. Only plain links change shape (including any inline code inside a link label, which now taps and holds as part of the link); chips, media and code outside links are untouched. ### Validation Added tests: - A long link label in a narrow message breaks across lines, and the following words continue on the line where it ends. - Holding a link and then sliding off it before the hold delay opens nothing (no sheet, no message menu, no open). - Pressing a text link tints it, and lifting or sliding off clears the tint; lifting a second finger keeps the tint. - A pressed link in a horizontally scrolled table cell is tinted inside the table and nothing past its edge. - Tapping a link nothing can open (mailto), by finger or screen reader activate, shows Copy and Share. - A pressed link in inline code (plain and in a bubble) or in a table header shows its tint (these fail with the tint drawn underneath). - Code inside a link label taps and holds as part of the link; a hold across an edit that removes the link does nothing; a second finger mid-hold doesn't restart it. Existing link tests (tap, hold sheet, copy and open from the sheet, message menu beside a link, swipe to reply from a link, attachment links) now find links inside their paragraph. They all pass, along with the full mobile suite and analyze. Automated simulator run (iPhone 17 Pro, internal community, synthetic message): pressing a wrapped link tinted all three of its lines; holding a text link opened its sheet; holding the text right after it opened the message menu; tapping the second line of a wrapped link opened it in Safari; a scroll starting on a link scrolled the list and opened nothing. --------- Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: Tom Brow <tomb@squareup.com> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>