Repository navigation
ADFA-5130: route feedback share by channel (email vs messaging) - #401
Merged
Merged
Conversation
The feedback FAB built a single message/rfc822 share, so messaging apps (Slack/WhatsApp) kept only the screenshot and dropped the report text. Route by channel instead, keeping the report as real text (never baked into an image) so it stays accessible and extractable. - FeedbackRenderer.shareText(): the report as one plain-text block (+ test). - MessagingFeedbackSender: ACTION_SEND text/plain (EXTRA_TEXT survives with no stream) + best-effort copy of the screenshot to the clipboard + a hint toast. - FeedbackShareRouter: worker -> POST; no screenshot -> email (unchanged); screenshot -> a native two-option dialog (Email / Share to another app). - FeedbackFab delegates to the router; analytics/toast centralised there. - Strings: feedback_channel_title/email/share + feedback_share_copied + 33 locales. Native UI only (system share sheet + a two-button dialog); no custom picker. Email path and the crash reporter are unchanged.
…alog Field testing showed only Slack drops the text; Telegram/Signal/WhatsApp keep text + image from one ACTION_SEND. So the two-action dialog over-corrected (it dropped the screenshot for the apps that would have shown it). Replace it with one native share built to keep both everywhere: - HybridFeedbackSender: ACTION_SEND with a wildcard */* type (denies Slack its image-only fast path), EXTRA_TEXT + EXTRA_STREAM + subject + recipient, a composite ClipData.Item binding text + image URI, and a grant flag. The report text is also copied to the clipboard as a deterministic fallback for Slack's ~500-char text-truncation bug (kept as real, accessible text — never baked into the image). - FeedbackShareRouter: no dialog — worker POSTs; no screenshot -> mail; with a screenshot -> the hybrid share. - Remove MessagingFeedbackSender, FeedbackRenderer.shareText, and the channel dialog strings; reword feedback_share_copied (text, not screenshot) + 33 locales. Native share sheet only; no custom picker, no per-app branching.
The */* + composite-ClipData coercion did not make Slack keep the text on a real device (only the clipboard fallback did). So special-case exactly one receiver: Slack gets a text-only intent (no stream -> it keeps the full text), everyone else (email, WhatsApp, Telegram, Signal) keeps the rich image+text intent. - HybridFeedbackSender: rich intent as the base; detect Slack via queryIntentActivities (package contains "slack"), exclude its rich entry with EXTRA_EXCLUDE_COMPONENTS and add a text-only LabeledIntent via EXTRA_INITIAL_INTENTS. Native share sheet only; no custom picker. - Clipboard-text + hint kept as a graceful fallback if Slack is renamed/absent. - No manifest change: targetSdk 28 is exempt from API 30 package visibility.
Correct comments that still described the abandoned */* + ClipData "coercion": document EXTRA_EXCLUDE_COMPONENTS as forcing text-only for Slack (with the Direct Share trade-off), the */* type as a broad type to list all targets, and note the override is extensible to other apps with the same defect. No behaviour change.
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.
What
The feedback FAB shared a report as ACTION_SEND message/rfc822 with the screenshot as EXTRA_STREAM and the report in EXTRA_TEXT. Messaging apps that treat an attached image as an image share (Slack) dropped the text, so only the screenshot arrived. This reworks the share so the report text is never lost, prioritising text over the screenshot.
Why
No Android contract guarantees a receiver honours both EXTRA_TEXT and EXTRA_STREAM in one send. Baking the text into the image was rejected (destroys accessibility); a wildcard / + composite ClipData coercion was tried and did not change Slack’s behaviour on device; a custom picker / per-app dictionary was rejected (maintenance sink). Special-casing exactly one receiver (Slack), through the native sheet, was the least-bad way to keep the text everywhere.
Notes / known limitations
Verification
javalang parse on the changed Java; XML well-formedness on all 34 strings.xml; FeedbackRendererTest (report body contract). Device-tested: Slack keeps the text; email/WhatsApp/Telegram/Signal keep image+text.