Skip to content

Recently Added survives app restart and is configurable in Settings #42

@tashda

Description

@tashda

Summary

Two issues with the device list's "Recently Added" section that landed together:

  1. Section disappeared on every app restart. AppStore persists deviceFirstSeen to UserDefaults precisely so the 30-minute window survives restarts, but AppStore.reset() was clearing both the in-memory map and the UserDefaults entry. ConnectionSessionController.connect() calls reset() on every connection attempt — including the auto-reconnect on app launch — so the persisted state was wiped before any UI saw it.
  2. Window length wasn't user-configurable. 30 minutes was hard-coded in AppConfig.UX.recentDeviceWindow. Users with high pairing volumes wanted longer; users who rarely pair wanted shorter.

Fix (commit on dev)

  • AppStore.reset() no longer touches deviceFirstSeen or its UserDefaults entry. The 30-minute (or user-chosen) window in DeviceListViewModel already self-prunes the visible list.
  • Settings → General → Devices → Recently Added Window picker: 5 min / 15 min / 30 min (default) / 1 hour / 2 hours / 4 hours / 1 day. Stored under DeviceList.recentWindowMinutes. DeviceListViewModel.recentWindow reads the value on each render so changes apply immediately.
  • The picker only governs window length. Visibility stays a separate concern handled by the existing "Show Recents" toggle in the device list's Sort menu — single source of truth.

Acceptance criteria

  • Pair a device, force-quit and relaunch the app — the device is still in "Recently Added".
  • Change the window in Settings → the device list updates without a restart.
  • "Show Recents" toggle still hides the section regardless of window length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions