Skip to content

feat: keep user configurations in sync between computers via a shared file (#3058) - #3063

Merged
mondalaci merged 1 commit into
masterfrom
feat/keymap-sync-between-uhks-3058
Oct 5, 2026
Merged

mondalaci merged 1 commit into
masterfrom
feat/keymap-sync-between-uhks-3058

Conversation

@mondalaci

Copy link
Copy Markdown
Member

Implements #3058.

Adds a Configuration file section to Settings that lets two computers share one keyboard configuration through a file in a synced folder (Dropbox, Google Drive, a network share, ...).

Behavior

  • Choose a shared configuration file with a native file picker, or reset to the default path. The row always shows the path, greyed with (default path) / (custom path).
  • Detect configuration changes made on the other computer and prompt to apply them checkbox. It is only enabled (and can only be checked) once a custom path is set.
  • Agent exports the current configuration to the shared file when it is saved to the keyboard.
  • On a detected change, a top notification panel (same design as the dongle-pairing / firmware panels) shows the full path with Load it / ignore actions, instead of a native popup.
  • "Load it" goes through the normal import path (autoSave: false), so the config is previewed and the usual Save to keyboard progress button appears.

Detecting changes while Agent is not running

The acknowledged content hash (SHA-256) is persisted (shared-config-acknowledged-content-hash). On startup the file is compared against it, so a change made while Agent was not running is still offered. Applying or ignoring records acknowledgement, so the same content is not offered again (including after a restart) until the file changes. Agent's own exports are also marked acknowledged.

Watching

fs.watch on the file's directory plus a 3 s polling fallback (some sync clients and network shares don't emit reliable events). Bursts are coalesced without starving the check, and a generation guard prevents a stale configure() from re-enabling watching.

Notes

  • The file-picker support comes from the already-merged Remember import/export folder #3060 (FileDialogService).
  • Verified: uhk-common build, uhk-agent webpack + eslint, uhk-web renderer build + ng lint + unit tests all pass.

#3058)

Add a shared configuration file to the Settings page. Agent exports the
configuration there when it is saved to the keyboard, watches the file for
changes, and offers to load changes made on another computer.

- configurable shared configuration file path via a native file picker
- change detection checkbox that is only enabled once a custom path is set
- top notification panel (matching the other top panels) showing the full
  path instead of a native popup
- persisted acknowledged content hash so a change made while Agent was not
  running is offered on startup, and applied/ignored changes are not offered
  again until the file changes
- fs.watch plus a polling fallback for sync folders and network shares
@mondalaci
mondalaci merged commit ee3c86d into master Oct 5, 2026
6 checks passed
@mondalaci
mondalaci deleted the feat/keymap-sync-between-uhks-3058 branch October 5, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant