Skip to content

refactor: loco backends, bigfred-client crate, and drive flow split - #7

Merged
keskad merged 4 commits into
mainfrom
refactor/loco-programming-backends
Sep 1, 2026
Merged

refactor: loco backends, bigfred-client crate, and drive flow split#7
keskad merged 4 commits into
mainfrom
refactor/loco-programming-backends

Conversation

@keskad

@keskad keskad commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Loco programming (Rust): LocoProgrammer trait with DccBusProgrammer and Z21Programmer; Hub::select from live locoProgramming.mode. programming_api uses one code path (no is_direct() branches).
  • bigfred-client crate: OAuth drop-in, HTTP proxy, dcc-bus WebSocket, wire types, and apis::verify_pin. Wizard keeps thin axum wrappers under src/bigfred/ (oauth, pin, proxy) plus From<bigfred_client::Error> for ApiError.
  • Drive flow (web): Split the 2700-line DriveFlowPage.tsx into per-device flows (pages/drive/flows/), shared useDriveSession, and reusable step components (components/drive/steps/). Header comments on each step screen.
  • Docs: ARCHITECTURE.md updated for the new crate, module layout, and web structure.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all
  • npm run build (web)
  • Manual: loco flow with locoProgramming.mode: bigfred (CV read/write, address set)
  • Manual: loco flow with locoProgramming.mode: direct and configured Z21 address/port
  • Manual: F2 pulse via dcc-bus drive socket in both modes
  • Manual: WiFred / LongFred / Fred / WlanMaus / Railbox drive flows (spot-check after UI split)
  • Manual: POST /api/v1/wizard/verify-pin (WiFred Soft-AP)

keskad and others added 4 commits August 31, 2026 21:09
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>
@keskad keskad changed the title refactor: unify loco CV programming backends refactor: loco backends, bigfred-client crate, and drive flow split Aug 31, 2026
@keskad
keskad merged commit a475202 into main Sep 1, 2026
3 checks passed
@keskad
keskad deleted the refactor/loco-programming-backends branch September 1, 2026 17:55
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