AI changeset tree
Shown as Lathe, a made-up product
The files a coding agent changed, as a tree to review: added, modified, deleted and renamed files with line counts that roll up, the agent's reason and diff for each file, sensitive files flagged for a person, review progress on every folder, and a replay of the run.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/lathe-tree.json?token=…"Adds the piece to components/propui/09-lathe-tree/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- Reviewing what a coding agent changed before it opens a pull request.
- Any changeset people sign off file by file: code, config, content or migrations.
- Showing which changes need a person, not just which files moved.
Something else fits when
- A single file the agent edited: show that one diff inline instead of a tree.
- Browsing a whole repository: a file explorer without change marks fits better.
- Line-by-line review comments: a full diff viewer with threads is the right tool.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/09-lathe-tree/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace FILES and TASK in data.ts. The tree, folder totals, the header counts and the review progress are all built from FILES; its order is the order the replay writes them in.
Your data
Replace these and everything on screen follows.
FILES{ path; change; from?; add; del; why; risk?; diff }[]- Every file in the tree, its change mark, line counts, the agent's reason, the sensitive flag and the diff.
Line{ t: "ctx" | "add" | "del" | "hunk"; s; a?; b? }- One diff line, with its old and new line numbers.
TASK{ id; title; branch; base; minutes }- The header: task, title and branch.
Interactions
- Open and fold folders; pick a file to read why the agent changed it and its diff.
- Tick files off as reviewed; each folder fills a ring, and Approve unlocks when every file is reviewed.
- Filter by Added, Modified or Deleted, show only unreviewed files, or filter by path.
- Expand or collapse every folder at once.
- Replay the run to watch the tree rebuild in the order the agent wrote the files.
- On phones, a file opens over the tree; close it to go back.
Keyboard
- ↑or↓
- Move between rows.
- →
- Open a folder, or move into it.
- ←
- Fold a folder, or move to its parent.
- HomeorEnd
- Jump to the first or last row.
- Enter
- Open a file, or fold or unfold a folder.
- Space
- Mark a file, or every file in a folder, as reviewed.
- *
- Expand every folder.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- The files are a tree with treeitems, aria-level, aria-expanded and aria-selected, and one tab stop that moves with the arrows.
- Each row has a label that reads its change, line counts, whether it needs review and whether it is reviewed.
- Change type is a letter as well as a colour; deleted files are also struck through.
- The diff is a focusable region; Mark reviewed is a toggle with aria-pressed.
- Approve is aria-disabled until every file is reviewed; the replay status is a polite live region.
Motion
- Rows slide in as folders open; the replay flashes each file as it is written.
- The filter pill glides between options; folder rings and the progress bar fill smoothly.
- Reduced motion drops the flash, the pulse and the slides.
Responsive
- The card is at most 1040px wide and fills the window's height; the tree and the file each scroll inside it.
- At 860px and below the file opens over the tree with a close button, and the path filter takes its own row.
- At 640px and below the card goes nearly edge to edge and Replay becomes an icon.
- At 380px and below the tree indents less and file rows drop their line counts, which stay in the file view.
Performance
- The tree is rebuilt from the file list with plain array work; there is no timer except during a replay.
- One local font file; no images.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every count summed from FILES; never type a folder or header total.
- Mark sensitive files with risk and say why a person should look; Approve depends on every file, sensitive or not.
- Every class is prefixed lt- and scoped under .lt; keep colours in the tokens at the top of post.css.
/p/lathe-tree/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.