Skip to content

ADFA-5130: route feedback share by channel (email vs messaging) - #401

Merged
luisguzman-adfa merged 4 commits into
mainfrom
feat/ADFA-5130-feedback-share-channels
Aug 13, 2026
Merged

luisguzman-adfa merged 4 commits into
mainfrom
feat/ADFA-5130-feedback-share-channels

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • HybridFeedbackSender (new): every target gets a rich intent (screenshot + text) — email, WhatsApp, Telegram, Signal keep both. Slack alone drops EXTRA_TEXT when a stream is present, so it is given a text-only intent through the native share sheet: its rich entry is removed with EXTRA_EXCLUDE_COMPONENTS and a text-only one is added with EXTRA_INITIAL_INTENTS. The report text is also copied to the clipboard as a deterministic, accessible fallback.
  • FeedbackShareRouter (new): worker → POST; no screenshot → mail (unchanged); screenshot → the hybrid share. FeedbackFab delegates to the router.

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

  • Excluding Slack’s component also removes its Direct Share targets, so from Slack the user picks the recipient inside the app. Accepted: text is prioritised over the screenshot and over the Direct Share shortcut. There is no public way to keep Direct Share and override the payload simultaneously.
  • Slack is identified by package name (case-insensitive); if it is renamed/absent the override no-ops and the clipboard fallback still carries the text. Extensible to other apps with the same defect.
  • No manifest change: targetSdk 28 is exempt from API 30 package-visibility filtering.
  • UI is the native share sheet only; no custom picker. Email path and crash reporter unchanged.

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.

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.
@luisguzman-adfa
luisguzman-adfa merged commit 8f2766e into main Aug 13, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/ADFA-5130-feedback-share-channels branch August 13, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant