Skip to content

refactor(ui): centralize event subscriptions#55

Merged
Dimillian merged 3 commits intoDimillian:mainfrom
slkzgm:pr1-events-abstraction
Jan 15, 2026
Merged

refactor(ui): centralize event subscriptions#55
Dimillian merged 3 commits intoDimillian:mainfrom
slkzgm:pr1-events-abstraction

Conversation

@slkzgm
Copy link
Contributor

@slkzgm slkzgm commented Jan 15, 2026

This is PR1 from the RFC/design discussion in #54.

What

UI-only refactor (no intended behavior changes).

  • Add src/services/events.ts to centralize event subscriptions.
  • Update:
    • src/features/app/hooks/useAppServerEvents.ts
    • src/features/terminal/hooks/useTerminalSession.ts
      to use the new subscription helpers.

Why

For an optional "remote backend" mode (e.g. WSL2 daemon + native Windows UI), we need the UI to be able to swap the event source (Tauri listen(...) today, WebSocket tomorrow) without rewriting multiple hooks/components.

This PR moves the event wiring behind a small service module so later work can introduce alternate implementations in one place.

Notes

  • Event names/payloads remain unchanged (app-server-event, terminal-output).
  • No UI/UX changes expected.

Validation

  • npm ci
  • npm run typecheck
  • npm run build

@slkzgm slkzgm force-pushed the pr1-events-abstraction branch from a7d252f to 8370b9a Compare January 15, 2026 15:19
@slkzgm
Copy link
Contributor Author

slkzgm commented Jan 15, 2026

Rebased onto latest main to account for the recent frontend re-org (hooks moved under src/features/*).

The branch should now be mergeable cleanly.

@Dimillian Dimillian merged commit 3dc7c49 into Dimillian:main Jan 15, 2026
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