Compare two versions of text or code line by line, see exactly what was added and what was removed, and copy the result as a unified diff patch.
-export function Button({ label, tone }) {
- const classes = cn("rounded-lg px-4 py-2", tone);
+export function Button({ label, tone = "primary", size = "md" }) {
+ const classes = cn(buttonVariants({ tone, size }));
return <button className={classes}>{label}</button>;
}
By the longest common subsequence, the same idea git uses. Lines both sides share stay in place, so a change reads as a change rather than as everything after it having moved.
The line number on each side. A removed line has only a left number and an added line only a right one, which is what makes it obvious where the two files stopped agreeing.
Yes. The patch below the comparison is in unified format, so it renders as a diff anywhere markdown is read.