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");
syncTasks(crew);
-
+readCache(crew);
+syncTasks(crew);
-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
| Prop | Type | Required | Default |
|---|---|---|---|
oldText | string | Yes | — |
newText | string | Yes | — |
mode | "split" | "unified" | undefined | No | split |
oldLabel | string | undefined | No | Before |
newLabel | string | undefined | No | After |
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.