# Code Review

This block combines [`AgentFileTree`](https://vitehub.dev/docs/ui/file-tree), [`AgentPatchDiff`](https://vitehub.dev/docs/ui/diff), and [`AgentTrace`](https://vitehub.dev/docs/ui/trace). Select a changed file in the tree to see its diff. The trace under the diff shows the verification run. The patches and the run are synthetic.

_Interactive preview available on the rendered documentation page._


## Wire the panes

- Create the tree model with `useAgentFileTree()` and read the selection with `useAgentFileTreeSelection()`.
- Mark changed files with the `gitStatus` option.
- Key the diff by the selected path, so Pierre renders a new view for each file.

## Load real data

Read patches from the Agent's change activities, for example with `invocationActivities(invocation)`, or from Git. Derive the trace run with `deriveTraceRuns()` from `@vite-hub/runtime`.

## Components used

- [File tree](https://vitehub.dev/docs/ui/file-tree)
- [Diff](https://vitehub.dev/docs/ui/diff)
- [Trace](https://vitehub.dev/docs/ui/trace)
