Skip to main content

Crate diffler

Crate diffler 

Source
Expand description

diffler binary internals, exposed as a library so the integration tests can drive the full app (event pump + MCP server) headlessly. The public surface is the binary’s: nothing here is a stable API.

Modules§

app
Application state and event handling. App::handle does no terminal IO, so we can unit-test the whole shell; ui::draw renders the state.
ci
CI and PR review across forges. Adapters implement ForgeProvider over gh/glab/curl through the CommandRunner seam and never touch the terminal.
clipboard
System clipboard with no native build deps, so the static musl binaries stay clean: OSC52, which terminals forward over ssh and tmux, plus a pipe to the platform clipboard CLI for terminals that ignore OSC52.
config
Layered TOML configuration: defaults → global file → project file → CLI.
editor
$EDITOR integration. The main loop owns the terminal, so App queues an EditorRequest and gets the outcome back in App::editor_finished.
event
Terminal events and a periodic tick on one channel. Every decision lives in App::handle, which is what the tests drive.
graph
A navigable orthogonal node-graph component for ratatui. It does no IO: the host builds a Model, pushes it into a GraphView, renders it, and handles the GraphActions it returns.
keymap
Key bindings: neogit-style defaults per screen, overridable from [keys.*] config sections, with multi-key sequence resolution.
mcp
Embedded MCP server: agents read review comments, answer them in place, and long-poll for the human’s feedback. Tool handlers never touch the review directly: every call is sent through the app event channel as an McpRequest and answered by App::handle_mcp on the main loop, so the app stays the single owner of all state (no locks).
proc
Child processes diffler shells out to, kept away from the terminal.
search
Vim-style / search over a pane’s (row index, text) rows: plain substring with smartcase, case-insensitive unless the query has an uppercase letter.
text
Text shaping shared across the UI and the graph engine, both of which truncate author-controlled strings into fixed terminal-column budgets.
theme
Color themes. github-dark is the default; ui.theme selects a built-in, each pairing its palette with a matching syntax-highlight theme.
transient
Magit-style transient menus: a prefix key opens a menu whose keys are all leaves. The model is plain data so resolution and the which-key layout stay unit-testable; the app owns the live state and timer.
tree
Sidebar rows and the directory-trie flattening behind them, with no rendering or app state so the navigation math stays unit-testable.
ui
Rendering. draw reads review state from App and computes none; it takes &mut App for scroll offsets and the diff view’s highlight cache.
watch
Debounced filesystem events on the repo become AppEvent::RepoChanged.
workspace
Project tabs: each tab is a whole App over its own repository. The workspace routes input to the tab on screen, worker answers to the tab that asked, and agent calls to the tab they name.