Skip to content

refactor: trim unused client surface - #1

Merged
KyleDerZweite merged 5 commits into
mainfrom
codex/ponytail-ultra
Aug 3, 2026
Merged

refactor: trim unused client surface#1
KyleDerZweite merged 5 commits into
mainfrom
codex/ponytail-ultra

Conversation

@KyleDerZweite

Copy link
Copy Markdown
Member

Summary

  • Collapses the one-implementation backend trait into MockBackend and removes 13 unused bridge commands plus their stubs.
  • Removes unproduced event variants and orphan event types, then regenerates src/bindings.ts.
  • Removes the unused async-trait and direct serde_json dependencies plus the unused MockBackend default implementation.
  • Reduces TypeScript and Tailwind configuration to settings used by the current client.
  • Inlines the default TypeScript binding configuration and updates compatibility documentation.

Skipped findings

  • None. All seven audit findings matched current callers, event producers, and configuration use.

Compatibility

  • The generated command API now exposes restoreSession, listSpaces, listRooms, loadTimeline, and sendMessage.
  • The event union now exposes Timeline and Typing.
  • Rust users of ChatBackend must use MockBackend directly. Restore an operation with backend behavior, a Tauri wrapper, and a UI caller. Add a shared trait when a second backend needs it.

Checks

  • Rustfmt check using edition 2021 on every changed Rust source
  • Cargo tests with workspace scope
  • Frontend typecheck and production build with bun run build

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.

Pull request overview

Refactors the client by shrinking the Rust↔UI contract surface to only what the current prototype uses, removing the previously generic backend trait seam, and aligning generated TypeScript bindings + configuration with that reduced API.

Changes:

  • Removes the ChatBackend trait and prunes unused commands/events/types across Rust core, Tauri bridge, and generated src/bindings.ts.
  • Implements/extends mock-only functionality for replies, edits, redaction, and reactions, including expanded Rust tests for these behaviors.
  • Simplifies frontend configuration (TypeScript/Tailwind) and updates compatibility documentation to reflect the prototype-only contract.

Reviewed changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Simplifies TS compiler options to only what the current client uses.
tailwind.config.js Reduces Tailwind config to minimal settings used by the UI.
src/bindings.ts Regenerated bindings after pruning commands/events/types.
src/App.tsx Adds reply/edit/delete/reaction UI flows and improves async error handling and race-safety when switching rooms.
src-tauri/src/lib.rs Removes trait-based backend indirection; exposes only the remaining commands and inlines TS export config.
src-tauri/Cargo.toml Drops unused serde_json dependency.
src-tauri/build.rs Formatting-only change.
README.md Updates project framing to clarify prototype/mock-only behavior and future Matrix replacement steps.
docs/DATA_INTERFACE.md Updates contract documentation to match the reduced API/event surface and prototype scope.
core/src/model.rs Removes unused session/login and membership/member types; minor formatting.
core/src/mock.rs Implements reply/edit/redact/reaction behavior and adds substantial test coverage.
core/src/lib.rs Removes backend trait module/re-exports and narrows public exports.
core/src/event.rs Prunes events to Timeline and Typing only and removes unused event-related types.
core/src/backend.rs Deletes the unused ChatBackend trait module.
core/Cargo.toml Drops unused async-trait dependency.
Cargo.lock Removes async-trait and serde_json from the lockfile dependency graph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KyleDerZweite
KyleDerZweite merged commit e69a62d into main Aug 3, 2026
1 check passed
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