Skip to content

feat(proxy): cross-platform desktop GUI (opt-in), CLI stays headless & cross-platform - #186

Merged
dmdhrumilmistry merged 1 commit into
devfrom
feat/proxy-gui
Nov 4, 2026
Merged

dmdhrumilmistry merged 1 commit into
devfrom
feat/proxy-gui

Conversation

@dmdhrumilmistry

Copy link
Copy Markdown
Collaborator

Adds a cross-platform desktop GUI for the proxy, while keeping the CLI fully functional with no UI and no graphics dependencies.

Desktop GUI (egui/eframe) — opt-in

Behind a gui Cargo feature (not default). cargo build --features gui enables the offat-proxy gui window:

  • Live flow list, colour-coded by status / scope / rule tags.
  • Request/response detail pane.
  • Status header: listen address, visible/total counts, scope, MITM & redaction state, rule count.
  • Filter box using the same expression language as the rule engine.
  • Reads the shared flow store read-only; never alters traffic. Runs on Linux, macOS and Windows (egui/eframe, glow/OpenGL backend).

The windowing event loop owns the main thread; the proxy keeps serving on tokio worker threads.

CLI stays headless and cross-platform

  • The GUI is opt-in, so the default build has no windowing/graphics dependencies — run, tui, mcp, ca, export work the same on all platforms.
  • A build without the feature still recognises offat-proxy gui: it prints how to enable it and points to offat-proxy tui (the cross-platform terminal UI).
  • The few Unix-only file-permission calls already have #[cfg(not(unix))] fallbacks, so the CLI compiles on Windows too.

Shared, tested logic

view.rs holds always-compiled, unit-tested helpers (visible_indices, status_label, status_class) used by both the TUI and the GUI, removing duplication.

Verification

  • Default build + 57 unit tests pass; cargo fmt --check and cargo clippy --all-targets clean.
  • cargo build --features gui compiles and links (44 MB binary) and is clippy-clean on the gui feature.
  • The no-GUI binary handles gui gracefully (prints guidance, exit 0).
  • This CI box has no display or GL/X11 runtime libs, so the window is run on a real desktop; GUI-independent logic is covered by the shared view tests.

Docs: proxy-rs/README.md and docs/proxy.md updated; make proxy-gui target added.

…ays headless

Add a native desktop UI behind an opt-in `gui` feature, so the default build
stays a lean, cross-platform CLI with no windowing/graphics dependencies.

- gui.rs (only built with --features gui): an egui/eframe window with a live
  flow list (colour-coded by status/scope/tags), a request/response detail pane,
  a status header (listen, counts, scope, mitm, redact, rules), and a filter box
  using the rule engine's expression language. Reads the flow store read-only.
- `offat-proxy gui` subcommand: launches the window when built with the feature;
  without it, prints how to enable it and points to `offat-proxy tui`. The
  windowing loop owns the main thread while the proxy serves on tokio workers.
- view.rs: shared, always-compiled, unit-tested helpers (visible_indices,
  status_label, status_class) used by both the TUI and the GUI (dedup).
- Makefile `proxy-gui` target; README + docs updated (cross-platform note).

The CLI, terminal UI (`tui`) and MCP work identically on Linux/macOS/Windows
without the `gui` feature. Verified here: default build + 57 unit tests + clippy
clean; `--features gui` compiles, links and is clippy-clean; the no-gui binary
handles `gui` gracefully. The window itself runs on a desktop (this CI box has no
display), so GUI logic is covered via the shared view tests.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@dmdhrumilmistry
dmdhrumilmistry merged commit 9d6bacb into dev Nov 4, 2026
14 checks passed
@dmdhrumilmistry
dmdhrumilmistry deleted the feat/proxy-gui branch November 4, 2026 14:40
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