Rebar UI

1.0

synthetic

DiffViewer

Old and new text compared line by line.

Offline sync changeSwitch between split and unified
main
export function syncTasks(crewId) {
const tasks = fetchTasks(crewId);
return tasks;
}
syncTasks("harbour");
offline-sync
export function syncTasks(crewId, offline = true) {
const tasks = offline ? readCache(crewId) : fetchTasks(crewId);
return tasks;
}
syncTasks("harbour");
syncTasks("mobile");
No differences
syncTasks(crew);
All added
readCache(crew);
syncTasks(crew);
Long line
const note = 'Offline sync is in review.';
const note = 'Offline sync is in review and the crew-interview notes are late.';

In context

ReviewA change awaiting Jonas Weber's approval
Offline sync
Review

Tideline mobile, due 7 Nov

export function syncTasks(crewId) {
const tasks = fetchTasks(crewId);
export function syncTasks(crewId, offline = true) {
const tasks = offline ? readCache(crewId) : fetchTasks(crewId);
return tasks;
}
syncTasks("harbour");
syncTasks("mobile");

Props

PropTypeRequiredDefault
oldTextstringYes—
newTextstringYes—
mode"split" | "unified" | undefinedNosplit
oldLabelstring | undefinedNoBefore
newLabelstring | undefinedNoAfter

A real line alignment

It aligns the two texts with a longest-common-subsequence diff, so an insertion in the middle does not mark every later line as changed. Only the changed signature, the changed body line and the new last line are marked here. It is static, like CodeBlock.

data-rebar-* attributes

data-rebar-component="diff-viewer", data-rebar-mode="split" | "unified"; each line carries data-rebar-line-type="same" | "add" | "remove" | "empty".

Migrating to Ant Design

Not codemod-covered. AntD ships no diff component; a migration typically keeps this LCS-diff logic and re-skins the rendering.