diff --git a/apps/docs/app/(diffs)/_components/WorkerPoolContext.tsx b/apps/docs/app/(diffs)/_components/WorkerPoolContext.tsx
index e71160e44..16bb6445f 100644
--- a/apps/docs/app/(diffs)/_components/WorkerPoolContext.tsx
+++ b/apps/docs/app/(diffs)/_components/WorkerPoolContext.tsx
@@ -60,6 +60,7 @@ const HighlighterOptions: WorkerInitializationRenderOptions = {
'cpp',
'css',
'go',
+ 'markdown',
'python',
'rust',
'sh',
diff --git a/apps/docs/app/(diffs)/_examples/ArbitraryFiles/ArbitraryFiles.tsx b/apps/docs/app/(diffs)/_examples/ArbitraryFiles/ArbitraryFiles.tsx
index 4b18a1ce4..ea5c9c23d 100644
--- a/apps/docs/app/(diffs)/_examples/ArbitraryFiles/ArbitraryFiles.tsx
+++ b/apps/docs/app/(diffs)/_examples/ArbitraryFiles/ArbitraryFiles.tsx
@@ -21,16 +21,15 @@ export function ArbitraryFiles({ prerenderedDiff }: ArbitraryFilesProps) {
title="Diff arbitrary files"
description={
<>
- In addition to rendering standard Git diffs and patches, you can
- pass any two files in @pierre/diffs and get a diff
- between them. This is especially useful when comparing across
+ You can also pass any two files in @pierre/diffs to
+ diff them. This is especially useful when comparing across
generative snapshots where linear history isn't always available.
- Edit the css below to see the diff.
+ Edit the CSS files below to see the diff.
>
}
/>
-
+
before.css
);
@@ -84,7 +83,7 @@ function FileTextarea({ value, onChange, className = '' }: FileTextareaProps) {
);
diff --git a/apps/docs/app/(diffs)/_examples/ArbitraryFiles/constants.ts b/apps/docs/app/(diffs)/_examples/ArbitraryFiles/constants.ts
index ec92e3cc0..bca57a90b 100644
--- a/apps/docs/app/(diffs)/_examples/ArbitraryFiles/constants.ts
+++ b/apps/docs/app/(diffs)/_examples/ArbitraryFiles/constants.ts
@@ -9,6 +9,11 @@ export const ARBITRARY_DIFF_EXAMPLE: PreloadMultiFileDiffOptions
= {
contents: `.pizza {
display: flex;
justify-content: center;
+ align-items: center;
+ gap: 8px;
+ padding: 12px;
+ border-radius: 8px;
+ background: #fff;
}
`,
},
@@ -16,6 +21,11 @@ export const ARBITRARY_DIFF_EXAMPLE: PreloadMultiFileDiffOptions = {
name: 'example.css',
contents: `.pizza {
display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 16px;
+ border-radius: 12px;
+ background: var(--surface);
}
`,
},
diff --git a/apps/docs/app/(diffs)/_examples/CustomHeader/CustomHeader.tsx b/apps/docs/app/(diffs)/_examples/CustomHeader/CustomHeader.tsx
index 8df618d25..e6a091e53 100644
--- a/apps/docs/app/(diffs)/_examples/CustomHeader/CustomHeader.tsx
+++ b/apps/docs/app/(diffs)/_examples/CustomHeader/CustomHeader.tsx
@@ -41,8 +41,10 @@ export function CustomHeader({ prerenderedDiff }: CustomHeaderProps) {
title="Custom headers"
description={
<>
- Switch between lightweight header metadata and a fully custom header
- rendered inside the built-in data-diffs-header shell.
+ Customize your File or FileDiff headers
+ with two options: inserting additional header metadata, or a fully
+ custom header rendered inside the built-in{' '}
+ data-diffs-header shell.
>
}
/>
diff --git a/apps/docs/app/(diffs)/_examples/CustomHeader/constants.ts b/apps/docs/app/(diffs)/_examples/CustomHeader/constants.ts
index 84a9fdb92..2c30a54d2 100644
--- a/apps/docs/app/(diffs)/_examples/CustomHeader/constants.ts
+++ b/apps/docs/app/(diffs)/_examples/CustomHeader/constants.ts
@@ -49,16 +49,12 @@ struct AppConfig {
self.enableLogging = true
}
- func headers(token: String? = nil) -> [String: String] {
- var headers = [
+ func headers() -> [String: String] {
+ return [
"Content-Type": "application/json",
"Accept": "application/json",
"X-API-Version": "2.0"
]
- if let token = token {
- headers["Authorization"] = "Bearer \\(token)"
- }
- return headers
}
}
`,
@@ -70,7 +66,7 @@ export const CUSTOM_HEADER_EXAMPLE: PreloadMultiFileDiffOptions = {
options: {
theme: DEFAULT_THEMES,
themeType: 'dark',
- diffStyle: 'split',
+ diffStyle: 'unified',
disableBackground: false,
unsafeCSS: CustomScrollbarCSS,
},
diff --git a/apps/docs/app/(diffs)/_examples/ShikiThemes/constants.ts b/apps/docs/app/(diffs)/_examples/ShikiThemes/constants.ts
index b5a3022a7..b157e1a78 100644
--- a/apps/docs/app/(diffs)/_examples/ShikiThemes/constants.ts
+++ b/apps/docs/app/(diffs)/_examples/ShikiThemes/constants.ts
@@ -37,7 +37,7 @@ fn add(a: i32, b: i32) -> i32 {
`,
},
options: {
- diffStyle: 'split',
+ diffStyle: 'unified',
theme: DEFAULT_THEMES,
unsafeCSS: CustomScrollbarCSS,
enableLineSelection: true,
diff --git a/apps/docs/app/(diffs)/_examples/TokenHover/constants.ts b/apps/docs/app/(diffs)/_examples/TokenHover/constants.ts
index 0da7c8e8c..ac5d67466 100644
--- a/apps/docs/app/(diffs)/_examples/TokenHover/constants.ts
+++ b/apps/docs/app/(diffs)/_examples/TokenHover/constants.ts
@@ -11,9 +11,8 @@ export const TOKEN_HOVER_EXAMPLE: PreloadMultiFileDiffOptions = {
flex-direction: column;
flex-wrap: wrap;
gap: 1rem;
- padding: 2rem 1.5rem;
max-width: 960px;
- margin: 0 auto;
+ margin-inline: auto;
}
.card-grid .card {
@@ -24,14 +23,6 @@ export const TOKEN_HOVER_EXAMPLE: PreloadMultiFileDiffOptions = {
background-color: var(--color-surface);
border-radius: 8px;
border: 1px solid transparent;
- transition: box-shadow 0.2s, border-color 0.2s;
- cursor: pointer;
-}
-
-.card-grid .card h3 {
- font-size: 1rem;
- line-height: 1.4;
- margin: 0;
}
.card-grid .card:hover {
@@ -60,10 +51,8 @@ export const TOKEN_HOVER_EXAMPLE: PreloadMultiFileDiffOptions = {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
- padding-block: 2rem;
- padding-inline: 1.5rem;
max-width: 960px;
- margin: 0 auto;
+ margin-inline: auto;
margin-trim: in-flow;
}
@@ -75,8 +64,6 @@ export const TOKEN_HOVER_EXAMPLE: PreloadMultiFileDiffOptions = {
background-color: var(--color-surface);
border-radius: 8px;
border: 1px solid transparent;
- transition: box-shadow 0.2s, border-color 0.2s;
- cursor: pointer;
&:hover {
border: 1px solid var(--color-border);
@@ -86,15 +73,6 @@ export const TOKEN_HOVER_EXAMPLE: PreloadMultiFileDiffOptions = {
&:focus-visible {
outline: 2px solid var(--color-accent);
}
-
- h3 {
- font-size: 1rem;
- line-height: 1.4;
- margin: 0;
- text-wrap: balance;
- text-box-trim: trim-start;
- text-box-edge: cap alphabetic;
- }
}
@container cards (min-width: 640px) {
diff --git a/apps/docs/app/(diffs)/_home/AgentDemoSection.tsx b/apps/docs/app/(diffs)/_home/AgentDemoSection.tsx
new file mode 100644
index 000000000..d4f8c26b3
--- /dev/null
+++ b/apps/docs/app/(diffs)/_home/AgentDemoSection.tsx
@@ -0,0 +1,37 @@
+import { AgentUi } from './AgentUi';
+import { FeatureHeader } from '@/components/FeatureHeader';
+
+interface AgentDemoSectionProps {
+ // Server-rendered, already-highlighted diff HTML keyed by file path. Built in
+ // Home.tsx so the embedded card paints highlighted on first load and hydrates
+ // without an SSR/client mismatch.
+ prerenderedDiffs: Record;
+}
+
+// Homepage embed of the agent-review surface: a single-file, diff-only card.
+// Always dark (the snapshot is prerendered dark and matching it avoids theme
+// flashing), so there's no light/dark toggle. It reuses the homepage's shared
+// worker pool for highlighting.
+export function AgentDemoSection({ prerenderedDiffs }: AgentDemoSectionProps) {
+ return (
+
+
+ Enable edit mode in any File or FileDiff{' '}
+ component with the EditorProvider. Includes support for
+ selection management, auto-indention, undo history, find-in-file,
+ lint markers, and more. Pairs nicely with @pierre/trees{' '}
+ for AUI style
+ experiences.
+ >
+ }
+ />
+
+
+
+ );
+}
diff --git a/apps/docs/app/(diffs)/_home/AgentUi.tsx b/apps/docs/app/(diffs)/_home/AgentUi.tsx
new file mode 100644
index 000000000..581a47aac
--- /dev/null
+++ b/apps/docs/app/(diffs)/_home/AgentUi.tsx
@@ -0,0 +1,382 @@
+'use client';
+
+import { DEFAULT_THEMES } from '@pierre/diffs';
+import { Editor } from '@pierre/diffs/editor';
+import { EditorProvider, FileDiff } from '@pierre/diffs/react';
+import { IconArrow, IconChevronSm, IconSparkle } from '@pierre/icons';
+import { FileTree, type FileTreeRowDecoration } from '@pierre/trees';
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+
+import './agent-ui.css';
+import {
+ AUI_SESSIONS,
+ type AuiChangedFile,
+ type AuiSession,
+ getFileDiff,
+ getSessionDirectoryPaths,
+ getSessionGitStatus,
+ getSessionPaths,
+} from './mockData';
+
+// The editor's stylesheet flattens every line number to one neutral colour
+// (`--diffs-editor-line-number-fg`) and is injected as an unlayered