MCPcopy
hub / github.com/codeaashu/claude-code / StructuredDiffFallback

Function StructuredDiffFallback

src/components/StructuredDiff/Fallback.tsx:81–119  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

79// Threshold for when we show a full-line diff instead of word-level diffing
80const CHANGE_THRESHOLD = 0.4;
81export function StructuredDiffFallback(t0) {
82 const $ = _c(10);
83 const {
84 patch,
85 dim,
86 width
87 } = t0;
88 const [theme] = useTheme();
89 let t1;
90 if ($[0] !== dim || $[1] !== patch.lines || $[2] !== patch.oldStart || $[3] !== theme || $[4] !== width) {
91 t1 = formatDiff(patch.lines, patch.oldStart, width, dim, theme);
92 $[0] = dim;
93 $[1] = patch.lines;
94 $[2] = patch.oldStart;
95 $[3] = theme;
96 $[4] = width;
97 $[5] = t1;
98 } else {
99 t1 = $[5];
100 }
101 const diff = t1;
102 let t2;
103 if ($[6] !== diff) {
104 t2 = diff.map(_temp);
105 $[6] = diff;
106 $[7] = t2;
107 } else {
108 t2 = $[7];
109 }
110 let t3;
111 if ($[8] !== t2) {
112 t3 = <Box flexDirection="column" flexGrow={1}>{t2}</Box>;
113 $[8] = t2;
114 $[9] = t3;
115 } else {
116 t3 = $[9];
117 }
118 return t3;
119}
120
121// Transform lines to line objects with type information
122function _temp(node, i) {

Callers

nothing calls this directly

Calls 2

formatDiffFunction · 0.85
useThemeFunction · 0.50

Tested by

no test coverage detected