Skip to content

fix(android): replace broken clipboard auto-detect with Paste button#344

Merged
therealaleph merged 1 commit intotherealaleph:mainfrom
yyoyoian-pixel:fix/config-paste-button
Apr 27, 2026
Merged

fix(android): replace broken clipboard auto-detect with Paste button#344
therealaleph merged 1 commit intotherealaleph:mainfrom
yyoyoian-pixel:fix/config-paste-button

Conversation

@yyoyoian-pixel
Copy link
Copy Markdown
Contributor

Bug

The "Config detected in clipboard" banner was intermittently not showing — sometimes it appeared on first app open but never on resume from another app. This made config import via clipboard unreliable.

Root cause: Android 13+ restricts ClipboardManager.getPrimaryClip() for background-to-foreground transitions. Apps can only read clipboard during active user interaction, not on resume. The auto-detect logic read clipboard during recomposition, which silently returned empty on Android 13+ after switching apps.

Fix

Replace the unreliable auto-detect banner with a permanent Paste button that reads clipboard on tap — user interaction grants clipboard access on all Android versions.

Also: Export button changed to icon-only (share icon) to keep the row compact.

Before: [Export config] [Scan QR] + broken auto-detect banner
After: 🔗 [Paste] [Scan QR]

1 file, 19 insertions, 49 deletions.

🤖 Generated with Claude Code

Android 13+ restricts clipboard access for background-to-foreground
transitions — the auto-detect banner never appeared on resume.
Replace with a permanent Paste button that reads clipboard on tap
(user interaction grants clipboard permission).

Also: Export button is now icon-only (share icon) to save space.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the type: fix fix: PR — auto-applied by release-drafter label Apr 27, 2026
Copy link
Copy Markdown
Owner

@therealaleph therealaleph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed via Anthropic Claude (reviewed by @therealaleph).

Approving and merging — diagnosis is correct (Android 13+ getPrimaryClip() restriction on background-foreground transitions) and the fix is the right shape: a permanent Paste button that reads on tap, since user-tap grants the clipboard access the auto-detect couldn't reliably get.

Net -30 LOC + simpler control flow + works on every Android version. The icon-only Export button is a nice compactness win too.

Trusted contributor — your earlier deep-link security fix was excellent. Thanks @yyoyoian-pixel.

@therealaleph therealaleph merged commit f5bd82b into therealaleph:main Apr 27, 2026
1 check passed
therealaleph added a commit that referenced this pull request Apr 27, 2026
…file

Patch release for the changes shipped via #337 (Apps Script range
probe gzip-decoded body handling) and #344 (Android Paste button on
13+) plus a CI fix that restores the Win7 i686 binary missing from
v1.7.9 (Cargo.lock format mismatch with Rust 1.77).

The Cargo.lock version=4 (Rust 1.78+) wasn't readable by the pinned
1.77.2 toolchain on the i686 job. Workflow now regenerates the
lockfile with the pinned toolchain on that job only, leaving every
other target unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
therealaleph added a commit that referenced this pull request Apr 27, 2026
…download

v1.7.10 release run shipped no assets due to two CI failures stacked:

1. The i686-pc-windows-msvc job (added in v1.7.7 for Win7 support per
   #318) failed because Rust 1.77.2 — the last stable that produces
   Win7-loadable binaries — can't parse modern transitive crate
   manifests (`time` 0.3.47 in this case). Pinning transitives across
   the dep tree at every MSRV bump in our deps isn't sustainable, so
   the target is removed from the release matrix. Win7 32-bit users
   self-build per #318's instructions.

2. The `release` job hit `actions/download-artifact@v4`'s 5-retries-
   exhausted error on multiple artifacts. Same flake we worked around
   in #288 for `commit-releases`. The `release` and `telegram` jobs
   now use `gh run download` wrapped in a 3-attempt retry loop, mirror-
   ing the working pattern.

v1.7.11 is the first full release after v1.7.9; ships #337 (Apps
Script gzip-decoded range probe) and #344 (Android Paste button) that
were tagged in v1.7.10 but never published as assets.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix fix: PR — auto-applied by release-drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants