Text Diff Viewer
Paste two versions of anything — code, config, prose — and see exactly what moved.
+4−2
| 1 | - function greet(name) { | ||
| 2 | - console.log("Hello " + name); | ||
| 1 | + function greet(name, greeting = "Hello") { | ||
| 2 | + if (!name) throw new Error("name is required"); | ||
| 3 | + console.log(`${greeting} ${name}`); | ||
| 3 | } | 4 | } |
| 4 | 5 | ||
| 5 | greet("world"); | 6 | greet("world"); |
| 7 | + greet("vibecoder", "Hey"); |
Built with this prompt
Build a text diff viewer in React with: - Two textareas: original on the left, changed on the right - A real line diff using longest-common-subsequence, not a naive line-by-line compare - Side-by-side output with line numbers on both sides - Green rows for additions, red rows for deletions, muted for unchanged - Toggles for "ignore whitespace" and "hide unchanged lines" - A summary count of added and removed lines - Dark theme, no dependencies