Skip to content

Add the USB forwarding settings section and wire it into the stream - #27

Merged
vibesoftwarecoder merged 1 commit into
masterfrom
feat/usb-forwarding-ui
Oct 24, 2026
Merged

vibesoftwarecoder merged 1 commit into
masterfrom
feat/usb-forwarding-ui

Conversation

@vibesoftwarecoder

Copy link
Copy Markdown
Owner

Fifth step of USB forwarding, after the host tunnel (ApolloVibe #13) and the session manager (#26). This is the first change a user can see. USB forwarding stays OFF by default, and with it off nothing is created and the stream behaves exactly as before.

What it adds

  • A "USB forwarding" section in Settings (Windows only, hidden elsewhere): an enable checkbox, usbipd-win status, a device list with Share / Stop sharing buttons and a per-device "Forward automatically when streaming" checkbox, and plain help text. Sharing asks Windows for permission only when you press the button, and never blocks the window.
  • Session wiring (small, best effort): when enabled, the manager starts after the stream window exists and is stopped in teardown. A single try/catch keeps any failure away from the stream. Updates are logged from the existing idle wake, at most once a second, with no Qt event pump.
  • Hotkey Ctrl+Alt+Shift+U pauses or resumes forwarding. With the setting off it is not intercepted and the keys go to the host as before.
  • The tunnel host is always the stream's host in one canonical form; the pinned server certificate and client identity come from pairing.
  • Quitting a stream cannot freeze behind a slow usbipd: the device check runs on a pool thread, and stopping never waits for it.

Safety notes

  • An independent review acted as the compiler for the stream-path files and found no compile errors. It found no Critical or High issues. Its Medium findings (a possible freeze at teardown, and child processes owned by singletons at exit) are fixed and tested.

Tests

  • 323 passed, 1 skipped, 0 failed across 11 standalone Qt Test projects (loopback only). The skip needs usbipd-win installed.
  • 16 deliberate breaks of the code were each caught by a test.

Not covered

  • The changes to session.cpp, the input handler and main.cpp, and the new QML, were never compiled or run on the test machine; CI compiles them. How the section looks and how gamepad focus behaves is not checked.
  • A real host, a real UAC prompt and a real USB device.
  • qmllint: 254 warnings vs 220 before, all unresolved-module "unqualified access" and import warnings for the new singletons.

🤖 Generated with Claude Code

Adds a "USB forwarding" section to Settings (Windows only) and starts the
session manager when a stream begins. Both are off by default; with the
setting off nothing is created, no thread starts, and the stream behaves
exactly as before.

Settings lets the user turn the feature on, see whether usbipd-win is
installed and running, share or stop sharing a device, and choose which
shared devices are forwarded automatically when a stream starts. Sharing
asks Windows for permission only when the user presses the button, and
never blocks the window.

When the setting is on, the stream starts the manager after the window
exists and stops it during teardown, after the input is released and the
window is gone. The manager never blocks the stream thread: the device
check runs on a pool thread, so quitting a stream cannot freeze behind a
slow usbipd. Its status is logged from the existing idle wake and after
handled events, once a second at most, with no event pump and no
per-frame work. Ctrl+Alt+Shift+U pauses or resumes forwarding; with the
setting off the keys pass through to the host as before.

The tunnel host is always the host the stream is connected to, in one
canonical form, and the pinned server certificate and the client identity
come from pairing, never from user input.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vibesoftwarecoder
vibesoftwarecoder merged commit 2ef2337 into master Oct 24, 2026
4 checks passed
@vibesoftwarecoder
vibesoftwarecoder deleted the feat/usb-forwarding-ui branch October 24, 2026 02:48
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.

1 participant