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

Function FileWriteToolCreatedMessage

src/tools/FileWriteTool/UI.tsx:39–127  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

37 return content.endsWith(EOL) ? parts.length - 1 : parts.length;
38}
39function FileWriteToolCreatedMessage(t0) {
40 const $ = _c(25);
41 const {
42 filePath,
43 content,
44 verbose
45 } = t0;
46 const {
47 columns
48 } = useTerminalSize();
49 const contentWithFallback = content || "(No content)";
50 const numLines = countLines(content);
51 const plusLines = numLines - MAX_LINES_TO_RENDER;
52 let t1;
53 if ($[0] !== numLines) {
54 t1 = <Text bold={true}>{numLines}</Text>;
55 $[0] = numLines;
56 $[1] = t1;
57 } else {
58 t1 = $[1];
59 }
60 let t2;
61 if ($[2] !== filePath || $[3] !== verbose) {
62 t2 = verbose ? filePath : relative(getCwd(), filePath);
63 $[2] = filePath;
64 $[3] = verbose;
65 $[4] = t2;
66 } else {
67 t2 = $[4];
68 }
69 let t3;
70 if ($[5] !== t2) {
71 t3 = <Text bold={true}>{t2}</Text>;
72 $[5] = t2;
73 $[6] = t3;
74 } else {
75 t3 = $[6];
76 }
77 let t4;
78 if ($[7] !== t1 || $[8] !== t3) {
79 t4 = <Text>Wrote {t1} lines to{" "}{t3}</Text>;
80 $[7] = t1;
81 $[8] = t3;
82 $[9] = t4;
83 } else {
84 t4 = $[9];
85 }
86 let t5;
87 if ($[10] !== contentWithFallback || $[11] !== verbose) {
88 t5 = verbose ? contentWithFallback : contentWithFallback.split("\n").slice(0, MAX_LINES_TO_RENDER).join("\n");
89 $[10] = contentWithFallback;
90 $[11] = verbose;
91 $[12] = t5;
92 } else {
93 t5 = $[12];
94 }
95 const t6 = columns - 12;
96 let t7;

Callers

nothing calls this directly

Calls 3

useTerminalSizeFunction · 0.85
countLinesFunction · 0.85
getCwdFunction · 0.85

Tested by

no test coverage detected