Offer to switch the web.esphome.io flow when a port belongs to another board - #1819
Conversation
|
@esphbot review |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Warning
Important issues found.
- The plug-in listener reads
event.port, which current Chromium leaves undefined, so it throws
|
Cleanup pass: the connect-event decoding (spec @esphbot review |
…hing the URL twice
|
That review ran on the head before the cleanup commit; all four points are covered now:
@esphbot review |
Verified all four at head. |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Hardware check: an nRF52 running ESPHome enumerates as a Zephyr USB device ( @esphbot review |
Checked at head. |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Generic UART bridges can be misclassified as ESP devices, and an in-flight nRF log connection can leak when the card is removed.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds board-family detection and opt-in flow-switch suggestions for ESPHome Web, covering selected and reconnected serial devices.
Changes:
- Adds Pico, nRF52, and ESP classification with persistent flow switching.
- Shares serial reconnect handling and deduplication helpers.
- Adds translations, test coverage, and port-announcement integrations.
| File | Description |
|---|---|
test/web/web-app-flow-switch.test.ts |
Tests flow suggestions and switching. |
test/web/nrf-card.test.ts |
Tests nRF port announcements. |
test/web/esp-connect-card.test.ts |
Tests ESP port announcements. |
test/web/board-family.test.ts |
Tests board-family classification. |
test/web/_make-web-serial-port.ts |
Adds serial-port test fixtures. |
test/util/serial-connect-events.test.ts |
Tests shared serial-event helpers. |
test/_web-serial.ts |
Provides configurable serial mocks. |
src/web/util/board-family.ts |
Classifies ports by board family. |
src/web/install/esphome-web-install-nrf-dialog.ts |
Announces selected install ports. |
src/web/esphome-web-app.ts |
Handles flow suggestions and switching. |
src/web/dashboard/esphome-web-nrf-card.ts |
Announces selected nRF ports. |
src/web/dashboard/esphome-web-esp-connect-card.ts |
Announces selected ESP ports. |
src/util/web-serial.ts |
Exposes serial identity helpers. |
src/util/serial-reacquire.ts |
Shares serial reconnect handling. |
src/util/serial-console-match.ts |
Exposes UART bridge detection. |
src/translations/en.json |
Adds flow-switch messages. |
src/components/app-shell.ts |
Reuses shared serial helpers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Agreed, and removed: the nRF install dialog no longer announces its pick. That pick is for the bootloader port right before the DFU write, and a toast accepted during the flash would have unmounted the dialog. The ESP card and the nRF card keep announcing, since their picks are the discovery moments. PR description updated. @esphbot review |
|
The offer is now suppressed while an operation may be running: the shell asks the base dialog registry ( @esphbot review |
|
Both suggestions addressed: @esphbot review |
Both fixes confirmed. JSDoc back on |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
@esphbot review |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Both taken: a refused toast action now replaces the toast with "Finish the current operation first, then switch flows." (new @esphbot review |
Verified on branch. |
PR Review — Offer to switch the web.esphome.io flow when a port belongs to another boardReady to merge. The findings from earlier reviews are fixed, and this pass found nothing new. What the PR does well:
Nothing needs attention. Checklist
Automated review by Kōan (Claude) |
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.

What does this implement/fix?
web.esphome.io now offers to switch to the right board flow when the port a user picks, or a device they plug in, clearly belongs to another family. It never switches on its own: a toast says "The connected device looks like a Raspberry Pi Pico." with a "Switch to the Pico flow" action, and the flow the user is in carries on either way.
0x2fe3, ESPHome's only Zephyr platform), Nordic's own id is nRF52 outright, and Adafruit's and Seeed's known nRF52840 product ids cover the bootloader and other firmwares; Espressif's id or a dedicated UART bridge is the esptool path. Anything else says nothing, and the site stays quiet. Ids are a hint, not proof, which is why this is a suggestion and not a route.connectevents, which the browser fires only for ports the site already has permission for, so a returning user who plugs a known board in gets the same offer. The event decoding, the "our own touch or flash re-enumerating" gate and the once-per-port memory moved out of the Device Builder's shell into shared helpers inserial-reacquire.ts, so both shells handle the event the same way.?picoand?nrfstay as the explicit override and the shareable link.The Device Builder's "USB device connected / Set it up" toast is not reused: it opens the dashboard's setup flow and has no equivalent on the site.
Related issue or feature (if applicable):
Screenshots
An info toast in the site's existing toaster (bottom right) with one action button; no other UI change.
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesChecklist
pnpm run lintpasses.pnpm run testpasses.