Skip to content

feat(profiles): choose which profiles sync and link them - #374

Merged
A-EDev merged 7 commits into
mainfrom
feat/profiles-sync-choice
Nov 1, 2026
Merged

A-EDev merged 7 commits into
mainfrom
feat/profiles-sync-choice

Conversation

@A-EDev

@A-EDev A-EDev commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Profiles card: Linked devices now has a Profiles card with a Sync switch for each local profile.
    • Turning a profile on starts its own link, or joins a profile another device syncs. A joined link is read from its snapshot on the next run.
    • Turning it off stops syncing on this computer, or on every device (a deleted profiles record). Each device keeps its data either way.
    • Profiles only other devices have can be added here as a new local profile.
    • The last syncing profile can't be turned off.
    • Only the running profile can start syncing, because a profile's data goes out only while it runs; any other profile shows Switch to sync instead (flow-sync Feat/adaptive grid columns #65).
  • profiles collection: canonical records {"deleted","hlc","link","name"} go in batches with a null link, merged last-writer-wins by HLC (spec/protocol.md, Profiles).
    • A device writes a record for every link it syncs that has none, and a new one when a linked profile is renamed.
    • A deleted record unlinks that profile on every device.
    • The collection gets its own snapshot, and new devices start from it.
  • Groups and pairing:
    • Any profile can create, join or restore a group. A new group syncs the profile that created it.
    • welcome.link names Default's link, or the first synced one, whichever profile runs (flow-sync Feat/adaptive grid columns #65).
    • A restored device that finds several synced profiles asks which one Default joins.
  • Sync page: Linked devices shows in every profile. Nearby sync (FLOW-SYNC/1) stays Default-only, with updated wording.
  • Local edits and resets: they are recorded for sync in any profile that syncs a link, and in Default as before. Resetting a profile that syncs leaves the group first, as Default did.
  • Profile changes: deleting a local profile stops its link here.

Related issue

Flow-Tube/Flow#1039 (choose which profiles sync). Android has the matching PR.

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Documentation
  • Build, packaging, or CI

Validation

Run on the head of this branch (aba3e37), in its worktree with the shared Cargo target dir:

  • pnpm test: 189 files, 1101 tests passed
  • pnpm build: passed
  • cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check: clean
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features: finished; every warning it prints is on a line older than this stack (checked with git blame)
  • cargo test --manifest-path src-tauri/Cargo.toml --all-targets --all-features: 1113 passed, 0 failed, 9 ignored
  • I smoke-tested the affected desktop behavior.

New tests:

  • tests/sync2_profile_names.rs: last writer wins; names reach other devices; a deleted link stops syncing there; nothing is sent twice.
  • tests/sync2_recovery.rs: a restored device waits for a choice when several links sync.
  • tests/sync2_profiles.rs: the garbage collection test now deletes the link through the profiles collection, with its snapshot.
  • src/lib/linked/useLinkedProfiles.test.ts: the color a profile added from another device gets.

Screenshots or recordings

Risk and compatibility

  • Migrations: none (uses 0036).

  • Older builds:

    • They skip profiles batches (unknown collection) and batches of links they don't sync, so a Phase 5 build keeps syncing Default's link.
    • A restored device on a Phase 5 build would still take the first link it finds.
  • Store inventory: sync_changes is now per profile, since every profile that syncs records its own edits.

  • No new secrets, private data, telemetry, or broad Tauri permissions were introduced.

  • User-facing documentation was updated where needed.

  • Dependency and lockfile changes are intentional and limited to this PR.

  • Breaking changes and upgrade steps are clearly documented.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@A-EDev
A-EDev changed the base branch from feat/sync2-batches-per-profile to main November 1, 2026 21:16
@A-EDev
A-EDev merged commit 9c620d4 into main Nov 1, 2026
7 checks passed
@A-EDev
A-EDev deleted the feat/profiles-sync-choice branch November 1, 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.

2 participants