Skip to content

refactor(gui): consume the API client; replace event streaming with polling #193

Closed

Description

@CameronBrooks11

Part of the local-API GUI architecture epic.

Scope

  • Swap the two backend-wrapper modules (lib/commands.ts, lib/marlin-api.ts) and the 3 stray invoke() sites (useCliHealth, CliUnavailableDialog) to the generated API client. Keep wrapper signatures stable so UI/stores/hooks are largely untouched.
  • Replace the Tauri event subscription (useStreamEvents + onStream* + emit/listen) with polling GET /jobs/{id} during a job; delete the now-dead event apparatus.

Why

The review found the frontend is well-contained — only 4 files call invoke(), two are the dedicated api modules — so this is concentrated, not scattered. UI/stores/converters/error-handling are reusable as-is.

Acceptance

  • The GUI talks only to the API client (no backend invoke()); job progress is polled; no Tauri event listeners remain for streaming.

Activity

  1. added
    gui
    on Jun 26, 2026
  2. CameronBrooks11 commented on Jun 26, 2026

    @CameronBrooks11
    MemberAuthor

    Note from #198 (PR #202): when the GUI moves off the CLI subprocess to the API client, also unify the CLI's JSON output (fiberpath_cli/plan.py, fiberpath_cli/simulate.py) onto the shared fiberpath/wire.py schema. It was deliberately left untouched in #198 because the current GUI parses the CLI's existing (inconsistent snake/camel) shape via fiberpath_gui/src/lib/schemas.ts (expects estimated_time_s), so changing it then would have broken the GUI. Once the GUI consumes the API (which already uses wire.py), the CLI output can be unified or retired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions