Devices: fixes from review round 6

- The headset a change is meant for is checked and the work counted in one
  step, so a switch can't slip in between (uploads too).
- A sideloaded title read on one headset can't be installed on another; open
  confirmations close on a switch.
- The only headset can't be removed while its ssh alias stays behind.
- Answers about the previous headset are dropped without touching panels; the
  catalogue's Installed tags are rebuilt for the new headset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-28 22:24:46 +10:00
1 parent 41ac28248a
commit ba33d2ff40
4 files changed
+35 -12

No files matched your search

+5
View File
@@ -904,6 +904,11 @@ def devices_action(link, body, open_setup, busy=lambda: 0):
raise frame_devices.DeviceError(f"Saved, but couldn't update ~/.ssh/config: {e}")
msg = f"Saved {d['name']}"
elif action == "remove":
if not body.get("config") and len(reg.devices()) == 1 and reg.get(did)["alias"] in {
b["alias"] for b in frame_devices.parse_blocks(frame_devices.read_config())}:
# Its ssh alias would stay, and the app would go on using it as a bare alias.
raise frame_devices.DeviceError("This is your only headset. To remove it completely, also remove its "
"entry from ~/.ssh/config (the box below)")
d = reg.remove_device(did)
if is_active:
link.override = None