fraudTech commited on
Commit
0fbf11a
·
1 Parent(s): db07961

Show cited fact text in Debug

Browse files
Files changed (1) hide show
  1. src/App.js +16 -1
src/App.js CHANGED
@@ -1073,7 +1073,22 @@ function Message({ message }) {
1073
  {message.debug.evidence.citations.map((c, idx) => (
1074
  <li key={idx} style={{ marginBottom: "4px" }}>
1075
  <span style={{ color: "#0066cc", fontWeight: "600" }}>[{c.fact_index}]</span>
1076
- {c.why ? <span style={{ marginLeft: "6px", color: "#333" }}>— {c.why}</span> : null}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1077
  </li>
1078
  ))}
1079
  </ul>
 
1073
  {message.debug.evidence.citations.map((c, idx) => (
1074
  <li key={idx} style={{ marginBottom: "4px" }}>
1075
  <span style={{ color: "#0066cc", fontWeight: "600" }}>[{c.fact_index}]</span>
1076
+ {(() => {
1077
+ const facts = message.debug.evidence.facts || [];
1078
+ const i = typeof c.fact_index === "number" ? c.fact_index : Number(c.fact_index);
1079
+ const factText = Number.isFinite(i) && i >= 0 && i < facts.length ? facts[i] : null;
1080
+
1081
+ return (
1082
+ <>
1083
+ {factText ? (
1084
+ <span style={{ marginLeft: "8px", color: "#1a1a1a" }}>{String(factText)}</span>
1085
+ ) : (
1086
+ <span style={{ marginLeft: "8px", color: "#aa0000" }}>(missing fact)</span>
1087
+ )}
1088
+ {c.why ? <span style={{ marginLeft: "6px", color: "#333" }}>— {c.why}</span> : null}
1089
+ </>
1090
+ );
1091
+ })()}
1092
  </li>
1093
  ))}
1094
  </ul>