Skip to content

refactor: decouple the UI from the backend behind a unified data pipeline - #185

Closed
Tryanks wants to merge 7 commits into
mainfrom
refactor/p0-ui-host-boundary
Closed

Tryanks wants to merge 7 commits into
mainfrom
refactor/p0-ui-host-boundary

Conversation

@Tryanks

@Tryanks Tryanks commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Decouples tcode's interface from its underlying state: every interaction between views and the backend crosses one typed, serde-serializable contract, with the desktop app acting as the first client of its own backend. This prepares the architecture for future remote use (one tcode driving another), which itself stays out of scope here — the full design lives in docs/ui-host-decoupling.md.

Scope of the change, landed as incremental commits:

  • Serializable boundary: runtime events and boundary DTOs are serde; gpui-typed colors and clipboard access no longer leak through the runtime's public surface.
  • Window state belongs to the UI: route, palette, sidebar collapse, quit confirmation and screenshot/debug seeds moved out of the backend state into a UI-owned WindowState; the UI performs no direct backend-field writes.
  • Backend-authoritative message assembly: the send commands take the user's typed words plus attachment paths; terminal contexts, review comments and attachment encoding are assembled runtime-side.
  • tcode-protocol crate: the single contract — command/query/event planes, seq-numbered subscriptions, NDJSON framing, forward-tolerant enums, round-trip tests.
  • Client store: views read replicated projections and dispatch typed commands instead of touching backend state directly.
  • Headless-capable backend: the runtime sheds its UI-framework dependency and the in-process transport carries the real serialized protocol.

Merge criteria: backend compiles with no gpui dependency; crates/ui has zero Entity<AppState> references; the app runs fully through the serialized in-process pipe; fmt/clippy/tests/smoke green on all three platforms.

🤖 Generated with Claude Code

Tryanks and others added 6 commits July 29, 2026 13:31
Full plan for splitting the UI from the backend behind one serializable
protocol pipeline (in-app only; remote tcode-to-tcode is future work the
pipeline enables, sketched as design guardrails).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Serde on RuntimeEvent and boundary DTOs, accent colors as plain 0xRRGGBB
integers instead of gpui::Rgba, and the plan-copy clipboard write moved
behind a CopyToClipboard effect handled by the app shell.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Route, palette, sidebar collapse, quit-confirm state and every debug/
screenshot seed now live in a UI-owned WindowState entity; the runtime
keeps only the persisted sidebar preference behind set_sidebar_collapsed
and relaunch continuity returns its Settings section for the UI to apply.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The composer no longer reaches into ActiveSession's terminal workspace;
clear_terminal_contexts is the last direct backend-field write from UI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The four send commands (send_turn, steer, orchestrate_turn,
confirm_relay_and_send) now take the user's typed text plus attachment
paths; terminal contexts, review comments, attachment encoding and
post-send draft clearing all happen runtime-side. Deferred and queued
paths reuse private *_assembled routes so nothing assembles twice.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Tryanks Tryanks changed the title refactor: purify the UI/runtime boundary (decoupling P0) refactor: decouple UI from backend behind a serializable pipeline (P0–P3) Jul 29, 2026
Command (76 variants) / Query / Event planes with a seq-numbered
subscription envelope, NDJSON wire framing, forward-tolerant tagged
enums, protocol-side mirrors for not-yet-serde runtime/services DTOs,
and round-trip + unknown-variant tests. Purely additive; the two
workspace-inventory guard tests register the new crate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Tryanks Tryanks closed this Jul 29, 2026
@Tryanks
Tryanks deleted the refactor/p0-ui-host-boundary branch July 29, 2026 06:49
@Tryanks Tryanks changed the title refactor: decouple UI from backend behind a serializable pipeline (P0–P3) refactor: decouple the UI from the backend behind a unified data pipeline Jul 29, 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.

1 participant