# Application Comments and Annotation: Code Review Thread

Code diff panel with line numbers, added and removed rows, and a line anchored review thread with replies, composer, and resolve action.

- Page: https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/code-review-thread
- Collection: [Application](https://www.shadcn-ui-blocks.com/blocks/application-pro), Standard tier
- Group: [Comments and Annotations](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations)
- Created: 2026-07-04
- Preview image: https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/code-review-thread.png

## Install

```bash
npx shadcn@latest add @shadcn-ui-blocks/application-pro-comments-annotations-code-review-thread
```

Needs an API key from a Pro or Team plan: add `@shadcn-ui-blocks` to the registries in components.json with the key as an `Authorization: Bearer` header. Setup: https://www.shadcn-ui-blocks.com/docs/shadcn-cli. The MCP server installs it without the setup: https://www.shadcn-ui-blocks.com/docs/mcp.

## Depends on

- npm packages: class-variance-authority, lucide-react, radix-ui
- shadcn/ui components: avatars, badge, button
- Installs to: `@/components/blocks/application-pro/comments-annotations/code-review-thread`

## About this block

Code Review Thread is the pull request inline discussion
pattern: a diff panel for src/lib/retry.ts with old and new
line number gutters, a removed row and two added rows tinted
from theme tokens, and a comment thread anchored to line 21.
Maya Chen asks whether backoffMs caps the delay, Jordan Lee
confirms it clamps to a 20 second ceiling and promises a
test, and a reply composer sits below as Noah Park. The file
header carries added and removed badges, and the thread
carries an Unresolved badge with a Resolve conversation
action.

Diff rows are two typed arrays, one above the thread and one
below, each row tagged context, add, or del to pick its tint
and sign. The composer renders as static markup rather than
a Radix control so it stays inside the preview root and
screenshots correctly. The footer note explains that
resolving collapses the thread and that it stays pinned to
line 21 as later commits shift the code.

## When to use

Reach for this block wherever code changes get discussed on
a specific line, wired to your diff endpoint and comment
API. Bind Reply to your thread mutation and Resolve
conversation to your thread-close call.

A natural flow around it on an Application Pro page:

**Before**

- [Developer tools](https://www.shadcn-ui-blocks.com/blocks/application-pro/developer-tools)

**After**

- [Comment sidebar](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations)
- [Resolved comments list](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations)

## What you can display

One strong use is the pull request line comment. Other diff
anchored threads:

- **Config change review.** A YAML diff with a thread
  questioning the new timeout value.
- **Migration approval.** A schema diff and a thread from a
  DBA asking about the index rebuild.
- **Docs pull request.** A prose diff with a thread
  suggesting a clearer heading for the section.

> Tip: keeping the thread attached to the line rather than a
> file offset is what survives rebases, anchor to the
> logical line so the conversation follows the code.

## More in Application Comments and Annotations

- [Annotation Layers Rail](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/annotation-layers-rail)
- [Annotation Toolbar Blueprint](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/annotation-toolbar-blueprint)
- [Canvas Pin Comments](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/canvas-pin-comments)
- [Comment Assignments](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/comment-assignments)
- [Comment Composer](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/comment-composer)
- [Comment Notification Inbox](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/comment-notification-inbox)
- [Comment Sidebar](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/comment-sidebar)
- [Inline Annotation Thread](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/inline-annotation-thread)
- [Mention Picker Blueprint](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/mention-picker-blueprint)
- [Outdated Comments Panel](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/outdated-comments-panel)
- [Pending Review Tray](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/pending-review-tray)
- [Reaction Bar](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/reaction-bar)
- [Resolved Comments List](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/resolved-comments-list)
- [Spreadsheet Cell Comments](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/spreadsheet-cell-comments)
- [Suggestion Review Row](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/suggestion-review-row)
- [Video Timestamp Comments](https://www.shadcn-ui-blocks.com/blocks/application-pro/comments-annotations/video-timestamp-comments)
