Skip to content

Handle sync code pasting - #9332

Merged
MiSikora merged 8 commits into
developfrom
feature/mehow/simple-sync/manual-entry-ui
Jul 30, 2026
Merged

Handle sync code pasting#9332
MiSikora merged 8 commits into
developfrom
feature/mehow/simple-sync/manual-entry-ui

Conversation

@MiSikora

@MiSikora MiSikora commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1216103556496795/task/1216955858261368?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/1216103556496795/task/1216509582049467?focus=true
API Proposals URL(s) (if applicable): N/A

Description

Adds the manual code entry UI to the "Enter Code" tab of the simplified Sync With Another Device screen.

  • The "Enter Code" tab now shows instructions for finding the code in the DuckDuckGo app on the other device, an example of what a sync code looks like, and a "Paste Sync Code" button.
  • Tapping "Paste Sync Code" reads the clipboard and validates the content as a sync pairing URL.
  • When the code is pasted, the sync process starts. For now this opens a temporary placeholder screen, SyncAnotherDeviceActivity.
  • When the placeholder screen closes, the Sync With Another Device screen closes as well and the user returns to Sync Settings.

Steps to test this PR

Paste a valid sync code

  • Open Sync Dev Settings.
  • Tap "Launch Sync Settings V2".
  • Tap "Sync With Another Device".
  • Complete the device authentication prompt.
  • Tap the "Show QR Code" icon in the toolbar.
  • Tap "Copy Text Code".
  • Go back to the Sync With Another Device screen.
  • Open the "Enter Code" tab.
  • Verify the tab shows the instructions, the example code, and the "Paste Sync Code" button.
  • Tap "Paste Sync Code".
  • Verify a placeholder screen opens showing the pasted sync URL on a magenta background.
  • Go back.
  • Verify the Sync With Another Device screen closed as well, returning you to Sync Settings.

UI changes

Screenshot_20260729-112513

Note

Medium Risk
Touches sync pairing entry and clipboard handling on a security-sensitive path; real pairing is still stubbed, but pasted content is passed forward without validation in this change.

Overview
The Enter Code tab on Sync With Another Device is no longer a stub: it shows pairing instructions, an example sync code, and a Paste Sync Code button wired through ReadSyncCodeViewModel and shared activity-scoped commands.

Paste Sync Code reads the clipboard and emits StartSyncProcess; ReadSyncCodeActivity launches the new ExchangeSyncCodeActivity via ExchangeSyncCodeContract and finishes the read-sync screen when that flow returns. ExchangeSyncCodeActivity is a temporary placeholder (magenta background, pasted URL text) registered in the manifest.

Strings for manual entry and an invalid-paste message are added; the diff does not wire validation or show the invalid message on paste.

Reviewed by Cursor Bugbot for commit fc63823. Bugbot is set up for automated code reviews on this repo. Configure here.


@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/manual-entry-ui branch from 6c0db36 to c7f3a61 Compare July 29, 2026 10:05
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/name-refactor branch from 2a2937b to bfdca0b Compare July 29, 2026 10:05
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/name-refactor branch from bfdca0b to 9d2969f Compare July 29, 2026 12:20
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/manual-entry-ui branch from c7f3a61 to 85f0042 Compare July 29, 2026 12:20

MiSikora commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/manual-entry-ui branch from df99fd8 to 6284013 Compare July 30, 2026 12:10
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/name-refactor branch from 9d2969f to 5d273c7 Compare July 30, 2026 12:10
@MiSikora
MiSikora changed the base branch from feature/mehow/simple-sync/name-refactor to graphite-base/9332 July 30, 2026 12:33
@MiSikora
MiSikora changed the base branch from graphite-base/9332 to develop July 30, 2026 12:41
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/manual-entry-ui branch from 6284013 to fc63823 Compare July 30, 2026 12:41

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fc63823. Configure here.

<activity
android:name=".ui.v2.ExchangeSyncCodeActivity"
android:exported="false"
android:label="@string/sync_scanner_v2_qr_code_screen_title"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Manifest label is wrong copy-paste from QR activity

Low Severity

ExchangeSyncCodeActivity uses android:label="@string/sync_scanner_v2_qr_code_screen_title" which resolves to "QR Code". This was clearly copy-pasted from the DisplayQrCodeActivity entry directly above it. The label appears in the system task manager/recent apps and doesn't reflect what this activity actually does (sync code exchange).

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fc63823. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix that in the upper branches of the stack

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.

2 participants