Render text/html support attachments as links#23011
Conversation
Bot replies in the unified support screen can include text/html citation attachments that point to web articles rather than downloadable files. These were rendered as file cards (and tapping one downloaded the raw HTML), which is confusing. Map text/html to a new Link attachment type and render those attachments as tappable links that open the URL in the browser, in both the bot and human-support conversation views. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Generated by 🚫 Danger |
Use startsWith instead of equals so content types like "text/html; charset=utf-8" map to AttachmentType.Link, consistent with the image/ and video/ branches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #23011 +/- ##
==========================================
- Coverage 37.42% 37.41% -0.01%
==========================================
Files 2325 2325
Lines 125399 125451 +52
Branches 17205 17213 +8
==========================================
+ Hits 46929 46942 +13
- Misses 74656 74694 +38
- Partials 3814 3815 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@adalpari I've not tested this yet, but Claude had some suggestions:
|
|
When I click a link, it correctly takes me to the web page, but when I click back it just shows an empty screen. I click back again and I see the "Get Help" screen but it never loads. screen.mov |
Give the clickable filename in AttachmentRow the same contentDescription and Role.Button semantics as UnifiedAttachmentLink so screen readers announce it as an actionable link. Guard both openUri call sites with runCatching to avoid crashing on ActivityNotFoundException, notifying the user via a toast instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Route attachment link taps through a hoisted onLinkClick callback that the Activity wires to ActivityNavigator.openInCustomTab, matching how Help Center opens URLs. This keeps users in-app and inherits its graceful fallback to the external browser on ActivityNotFoundException. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Lowercase content type once so image/video/text-html all match case-insensitively - Compute link content description only for link attachments via shared helper Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@nbradbury I've made some changes. Can you give it another go? |
|
@adalpari I'm still seeing the issue with the back button and it turns out it was due to having "Don't keep activities" enabled, so it's something users are unlikely to experience. I had Claude write up a plan for resolving it in case you want to address the problem, but I'll go ahead an approve. |
Cool! |
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>


Description
Bot replies in the unified support screen can include
text/html"citation" attachments — links to help articles (e.g.https://jetpack.com/support/...) rather than downloadable files.Previously these were rendered as file cards with a generic page icon, and tapping one enqueued an Android
DownloadManagerdownload of the raw HTML — the wrong behavior for a web link. This is especially visible after a conversation is transferred to human support, where the bot's earlier messages render through the human-support path (file-card grid).This PR introduces a new
Linkattachment type fortext/htmlcontent and renders those attachments as tappable, underlined links (with an open-in-new icon) that open the URL in the browser:text/html(case-insensitive) now maps toAttachmentType.Link. All other content types — includingtext/plain— keep their existing behavior.UnifiedAttachmentsList): link attachments are shown as a vertical list of links above the existing card grid; images/videos/other files are unchanged.AttachmentRow): link filenames become tappable links; the citation match-score badge is preserved.AttachmentTypemapping.Testing instructions
Before / after
NOTE: You might not be able to reproduce it since it entirely depends on the bot answers
Note2: use a non-free account