Skip to content

fix(odrive web): empty-filter fallback + accurate VID-only wording - #772

Merged
finger563 merged 1 commit into
mainfrom
fix/odrive-web-empty-filter-fallback
Sep 5, 2026
Merged

fix(odrive web): empty-filter fallback + accurate VID-only wording#772
finger563 merged 1 commit into
mainfrom
fix/odrive-web-empty-filter-fallback

Conversation

@finger563

Copy link
Copy Markdown
Contributor

#771 was squash-merged while it still only had the initial VID-filter fix; the two follow-up review rounds landed on the branch after the merge, so they never reached main. This re-applies them off main so the odrive consoles carry the same fixes as the other espp web consoles.

Empty-filter fallback (mirrors ota/coredump/haptics/canopen/mcp266)

Both consoles now use the shared requestUsbDevice(anyDevice) helper: the "show all devices" path sends a single empty filter {filters:[{}]} and, if a WebUSB implementation rejects the empty filter (TypeError), retries with a VID-only filter. The helper is byte-identical to the one on the other consoles.

Accurate VID-only wording

After switching the default to VID-only, the comments, the "Any device" tooltip, and the status lines are reworded to the actual filter semantics ("any device with VID 0x1209", not "ODrive VID/PID"/"any espp device"), and the VID hex is zero-padded to 4 digits.

Only odrive_webusb_console.html and odrive_control_panel.html change. These are ODrive ASCII/native consoles with no dispatcher module, so there is no module-presence / warn-tier change. Both pass a JS parse check.

🤖 Generated with Claude Code

#771 was merged with only the initial VID-filter fix; two later review rounds
never reached main. This carries them over so the odrive consoles match the
other espp web consoles:
- requestUsbDevice(): the "show all devices" path uses one empty filter {} and
  falls back to a VID-only filter if a WebUSB implementation rejects the empty
  filter (the shared helper now used by every espp WebUSB console).
- reword the comments, the "Any device" tooltip, and the status lines to the
  actual filter semantics ("any device with VID 0x1209", not "ODrive VID/PID"),
  and zero-pad the VID hex.

Affects odrive_webusb_console.html and odrive_control_panel.html only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 5, 2026 03:15
@finger563
finger563 merged commit 72165bc into main Sep 5, 2026
14 of 15 checks passed
@finger563
finger563 deleted the fix/odrive-web-empty-filter-fallback branch September 5, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Re-applies post-merge WebUSB chooser fixes for the ODrive ASCII WebUSB console and native control panel: adds an empty-filter “show all devices” fallback behavior and updates user-facing wording to match VID-only filtering.

Changes:

  • Add a shared requestUsbDevice(anyDevice) helper in both consoles to retry with VID-only filtering when {filters:[{}]} is rejected.
  • Update checkbox tooltip + connect/status copy to reflect VID-only semantics and zero-pad VID hex output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
components/odrive_ascii/web/odrive_webusb_console.html Adds empty-filter fallback helper and updates chooser/status copy for VID-only semantics.
components/odrive_ascii/web/odrive_control_panel.html Mirrors the same WebUSB request helper and updates filter status wording/VID formatting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

<h1>ODrive Native &mdash; WebUSB Control Panel</h1>
<div class="spacer"></div>
<label class="checkbox-inline" title="Show every USB device in the chooser instead of only the default ODrive VID/PID (0x1209/0x0d32).">
<label class="checkbox-inline" title="Show every USB device in the chooser instead of only espp devices (the default filter is VID 0x1209, any PID).">
<h1>ODrive ASCII &mdash; WebUSB Console</h1>
<div class="spacer"></div>
<label class="checkbox-inline" title="Show every USB device in the chooser instead of only the default ODrive VID/PID (0x1209/0x0d32).">
<label class="checkbox-inline" title="Show every USB device in the chooser instead of only espp devices (the default filter is VID 0x1209, any PID).">
Comment on lines +683 to +684
if (anyDevice && e && e.name === "TypeError")
return await navigator.usb.requestDevice(vidOnly);
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