# Diff Apply: Release Note Edit

> Not only code: a writing assistant tightens a Markdown release note, with `wrap` on and no line numbers. The reply under it follows `onComplete` and `onReview`.

A shadcn/ui block from the [@keyframeui](https://keyframeui.com/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/keyframeui/diff-apply-copy-demo).

- Page, with a live preview: https://shadcn.exchange/r/keyframeui/diff-apply-copy-demo
- Screenshot: https://shadcn.exchange/shot/keyframeui/diff-apply-copy-demo/light.png
- Registry item: https://keyframeui.com/r/diff-apply-copy-demo.json
- Categories: code, developer, ai
- Listed: 2026-11-02, source last changed 2026-11-02

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/keyframeui/diff-apply-copy-demo.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `https://keyframeui.com/r/diff-apply.json`

## Notes from the registry

Live preview, examples and props: https://keyframeui.com/components/diff-apply#diff-apply-copy-demo

## Files

### `registry/demos/diff-apply-copy-demo.tsx`

```tsx
"use client";

import * as React from "react";
import { DiffApply, type DiffApplyDecision } from "@/components/ui/diff-apply";

const before = `
## Tinta 2.4

We are really excited to announce that Tinta 2.4 is finally here and available for everyone to use today!

### What's new

- Exports are now a lot faster than they used to be.
- Fixed a bug where some people could sometimes not sign in.
- Dark mode.

Thanks to everyone who sent us feedback!
`;

const after = `
## Tinta 2.4

Tinta 2.4 is out today.

### What's new

- PDF exports finish up to 3× faster.
- Fixed sign-in failing for accounts created with Google.
- Dark mode now follows your system setting.

Thanks to the 412 people who sent feedback during the beta.
`;

export function DiffApplyCopyDemo() {
  const [done, setDone] = React.useState(false);
  const [decisions, setDecisions] = React.useState<DiffApplyDecision[]>([]);
  const kept = decisions.filter((d) => d === "kept").length;
  const undone = decisions.filter((d) => d === "undone").length;
  const reviewed = decisions.length > 0 && decisions.every((d) => d !== "pending");

  return (
    <div className="flex w-full max-w-xl flex-col gap-3">
      <div className="ml-auto max-w-[85%] rounded-2xl rounded-br-md bg-zinc-900 px-3.5 py-2 text-[14px] leading-snug text-white dark:bg-zinc-100 dark:text-zinc-900">
        Tighten this for the changelog. Be specific.
      </div>
      <DiffApply
        filename="release-notes.md"
        before={before}
        after={after}
        wrap
        lineNumbers={false}
        onComplete={() => setDone(true)}
        onReview={setDecisions}
      />
      <p
        aria-live="polite"
        className="min-h-5 px-1 text-[13px] text-zinc-500 transition-opacity duration-300 dark:text-zinc-400"
        style={{ opacity: done ? 1 : 0 }}
      >
        {reviewed
          ? kept === decisions.length
            ? "All three edits kept. Ready to publish."
            : `${kept} kept, ${undone} undone.`
          : "Cut 12 words and named the numbers. Keep what reads right."}
      </p>
    </div>
  );
}
```
