Skip to content

Installer: connect again without the port picker - #254

Merged
ThomasPohl merged 1 commit into
mainfrom
feature/installer-auto-reconnect
Nov 15, 2026
Merged

ThomasPohl merged 1 commit into
mainfrom
feature/installer-auto-reconnect

Conversation

@ThomasPohl

Copy link
Copy Markdown
Owner

The browser's port picker came up for every connection: after a reload, after a reset of an ESP32-S3/C5 (its USB-Serial-JTAG returns as a new device) and every time a hub on battery woke up again.

The page now remembers the USB ids of the port used last and whether a connection is wanted, and opens the port itself (serial-console.js):

  • Lost connection (asleep, reset, unplugged): the dock shows "Waiting for the hub to come back…" and the port is opened as soon as it is there again (the browser's connect event, and a check every second). Stop waiting ends that.
  • Reload while connected: connected again once the page has loaded.
  • Connect: opens the port used last if it is present; otherwise the picker. New button Other port… (only while a port is remembered) always opens the picker.
  • Disconnect and the firmware installer close the port until the next Connect; no automatic connection after that, also not after a reload.

reconnect() (used after a reset in the assistant and the dock) now waits for that one mechanism instead of opening the port itself, so two openers cannot collide; openPort() refuses a second open while one runs.

Stacked on #253 (base switches to main after that is merged).

Tested in headless Chrome with a simulated port: loss and return (timer and connect event), reload while connected, Stop waiting, Connect without picker, Other port…, no auto-connect after Disconnect, reset from the dock, the assistant's step 3 after a reload. Not tested on hardware: a real USB-Serial-JTAG reset and a hub that falls asleep; whether Chrome reports the same USB ids after a re-enumeration is assumed (the previous reconnect() relied on it too).


Generated by Claude Code

The page remembers the USB ids of the port used last and opens it on its
own after a lost connection (hub asleep, reset, unplugged), after a reload
while connected, and on Connect. Disconnect and the firmware installer end
that; 'Other port…' opens the picker.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Csa4N778M5kZxErLfAfd7D
@ThomasPohl
ThomasPohl changed the base branch from refactor/installer-shared-code to main November 15, 2026 06:58
@ThomasPohl
ThomasPohl merged commit e5de77c into main Nov 15, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants