# Code Review

This block combines [`FileTree`](https://vitehub.dev/docs/ui/file-tree), [`PatchDiff`](https://vitehub.dev/docs/ui/diff), and [`TraceRun`](https://vitehub.dev/docs/ui/trace). Select a changed file to see its diff. The trace below shows the verification run. The patches and run are fake.

_Interactive preview available on the rendered documentation page._


## Wire the panes

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

## Load real data

Read patches from the Agent's Workspace changes or Git. Get the trace run from `deriveTraceRuns()` in `@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)

<!-- vitehub-docs:section-links -->
## In this section

- [Start](https://vitehub.dev/raw/docs/ui.md)
- Blocks
  - [Chat App](https://vitehub.dev/raw/docs/ui/blocks/chat-app.md)
  - [Code Review](https://vitehub.dev/raw/docs/ui/blocks/code-review.md) (this page)
  - [Collaborative Editor](https://vitehub.dev/raw/docs/ui/blocks/collaborative-editor.md)
- [Parts](https://vitehub.dev/raw/docs/ui/message.md)
- [Chat](https://vitehub.dev/raw/docs/ui/chat.md)
- [Collaboration](https://vitehub.dev/raw/docs/ui/avatar-stack.md)
- [Agent work](https://vitehub.dev/raw/docs/ui/tool-list.md)
- [Utilities](https://vitehub.dev/raw/docs/ui/attachments.md)

Next: [Marker](https://vitehub.dev/raw/docs/ui/marker.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
