Skip to content

Add configurable periodic sync & discovery; improve settings UX; sync only watched games - #1

Merged
danielphingston merged 1 commit into
masterfrom
codex/add-configurable-periodic-sync-and-ux-improvements
Aug 26, 2026
Merged

danielphingston merged 1 commit into
masterfrom
codex/add-configurable-periodic-sync-and-ux-improvements

Conversation

@danielphingston

Copy link
Copy Markdown
Owner

Motivation

  • Give users control over background behavior by making periodic R2 sync and game discovery independently configurable and user-friendly.
  • Avoid surprising UI/OS behavior by preventing the Windows folder picker from briefly showing a terminal window.
  • Improve discoverability and clarity of settings so schedules and device controls are easier to understand and change.

Description

  • Introduced an Automation section in config with PeriodicSyncEnabled, SyncIntervalMinutes, PeriodicDiscoveryEnabled, and DiscoveryIntervalMinutes, plus DefaultAutomation() and validation in internal/config/config.go and migration for older configs.
  • Added ConfigureAutomation to the settings manager (internal/settings/manager.go) and a new HTTP endpoint PUT /api/settings/automation with server handling in internal/api/server.go and tests in internal/api/server_test.go.
  • Added UI for automation on the Settings page (internal/api/web/app.js, internal/api/web/styles.css) including toggles, interval inputs, explanatory copy, and an advanced disclosure for launcher paths; settings apply live without restart.
  • Periodic sync now runs from the coordinator loop (internal/app/coordinator.go) on a one-minute ticker, using configured intervals; discovery runs independently on its own configured interval.
  • Periodic sync is limited to watched games only: new DB query PendingSnapshotsForWatchedGames and helpers in internal/database/store.go, and coordinator now syncs watched pending snapshots instead of all pending snapshots for periodic runs while leaving manual SyncPending unchanged.
  • Prevented the Windows folder picker from flashing a PowerShell terminal by launching it with hidden-window flags (internal/platform/folder_windows.go).
  • Added unit tests and integration-style checks for new behavior and persistence (internal/config, internal/settings, internal/database, internal/api tests) and updated README to document the new options.

Testing

  • Ran go test ./... and go test -race ./... and all package tests passed (including new/updated tests in internal/config, internal/settings, internal/database, internal/api).
  • Ran make check (format/lint/tests) and it completed successfully after adjustments to interfaces and constructor wiring.
  • Verified Windows folder picker behavior via GOOS=windows GOARCH=amd64 go test ./internal/platform ./cmd/saveknot (tests passed in this environment).
  • Exercised the Settings UI with agent-browser to open the Settings page, interact with the automation form, save values, and capture a screenshot; the UI flow completed successfully.
  • Note: an attempt to call a local make_pr helper to open a remote PR failed because make_pr is not available in this environment and no remote is configured. No remote Git/GitHub operations were performed.

Codex Task

@danielphingston
danielphingston merged commit 14f081f into master Aug 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant