refactor: loco backends, bigfred-client crate, and drive flow split - #7
Merged
Conversation
Extract dcc-bus and Z21 direct backends into src/loco_programming/ with a shared interface and Hub::select per request, so HTTP handlers no longer branch on is_direct(). F2/drive stays on DccBusClient. Co-authored-by: Cursor <cursoragent@cursor.com>
Move OAuth drop-in, HTTP proxy, dcc-bus WebSocket, and wire types into a reusable crate; keep thin axum wrappers under src/bigfred/. Co-authored-by: Cursor <cursoragent@cursor.com>
Extract POST /api/v1/auth/login into the client crate and keep a thin axum wrapper under src/bigfred/pin.rs. Co-authored-by: Cursor <cursoragent@cursor.com>
Extract device flows, useDriveSession, and reusable drive steps from the 2693-line page; add brief header comments on each step screen. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
LocoProgrammertrait withDccBusProgrammerandZ21Programmer;Hub::selectfrom livelocoProgramming.mode.programming_apiuses one code path (nois_direct()branches).bigfred-clientcrate: OAuth drop-in, HTTP proxy, dcc-bus WebSocket, wire types, andapis::verify_pin. Wizard keeps thin axum wrappers undersrc/bigfred/(oauth,pin,proxy) plusFrom<bigfred_client::Error> for ApiError.DriveFlowPage.tsxinto per-device flows (pages/drive/flows/), shareduseDriveSession, and reusable step components (components/drive/steps/). Header comments on each step screen.ARCHITECTURE.mdupdated for the new crate, module layout, and web structure.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test --allnpm run build(web)locoProgramming.mode: bigfred(CV read/write, address set)locoProgramming.mode: directand configured Z21 address/portPOST /api/v1/wizard/verify-pin(WiFred Soft-AP)