feat: per-rule local override of Firefox Sync #2

Merged
lksz merged 8 commits from feature/local-rule-toggles into dev 2026-10-26 01:49:41 +00:00
Owner

Adds a "Sync this rule" toggle to each rule card (visible only when Firefox Sync is enabled) so individual rules can stay local to this device:

  • Placement defines state — overridden rules live in a new localRules key (local storage); sync storage's rules key only ever contains fully-synced rules. Effective rule set = synced rules overlaid with local overrides (options, background, and popup all resolve this).
  • Conflict-safe re-sync — toggling a rule back to sync compares canonical-JSON hashes (overrideMeta.lastSyncedHash, FNV-1a). Remote unchanged → local wins silently; local untouched → remote wins silently; both diverged → 3-way modal (Keep Local / Keep Remote / Cancel).
  • Backup includes overrides — localRules + overrideMeta are exported and merged on import (imported wins).
  • Bug fix — popup read rules from local storage unconditionally, ignoring useSync.

Backward compatible: no migration needed — absence of the new keys means no overrides. Includes 47 automated checks (harnesses in _build/, gitignored) plus the 21-test build suite; web-ext lint clean.

Adds a **"Sync this rule"** toggle to each rule card (visible only when Firefox Sync is enabled) so individual rules can stay local to this device: - **Placement defines state** — overridden rules live in a new `localRules` key (local storage); sync storage's `rules` key only ever contains fully-synced rules. Effective rule set = synced rules overlaid with local overrides (options, background, and popup all resolve this). - **Conflict-safe re-sync** — toggling a rule back to sync compares canonical-JSON hashes (`overrideMeta.lastSyncedHash`, FNV-1a). Remote unchanged → local wins silently; local untouched → remote wins silently; both diverged → 3-way modal (Keep Local / Keep Remote / Cancel). - **Backup includes overrides** — `localRules` + `overrideMeta` are exported and merged on import (imported wins). - **Bug fix** — popup read rules from local storage unconditionally, ignoring `useSync`. Backward compatible: no migration needed — absence of the new keys means no overrides. Includes 47 automated checks (harnesses in `_build/`, gitignored) plus the 21-test build suite; `web-ext lint` clean.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Toggle hiding was implemented with the toggle UI (sync-off class) in the previous commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(options): keep synced-rule snapshot fresh after saves so override hashes are accurate
All checks were successful
PR Check / Check PR Target (pull_request) Has been skipped
PR Check / Lint (pull_request) Successful in 35s
PR Check / Build Preview (pull_request) Has been skipped
223942ec9a
Co-authored-by: Cursor <cursoragent@cursor.com>
lksz merged commit 4b81547a78 into dev 2026-10-26 01:49:41 +00:00
lksz deleted branch feature/local-rule-toggles 2026-10-26 01:49:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lksz/sticky-tabsz!2
No description provided.