fix(odrive web): empty-filter fallback + accurate VID-only wording - #772
Merged
Conversation
#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>
Contributor
There was a problem hiding this comment.
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 — 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 — 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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 offmainso 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.htmlandodrive_control_panel.htmlchange. 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