fraudTech commited on
Commit
6b27ebb
·
1 Parent(s): 03588a4

debug panel to show descriptions in citations

Browse files
Files changed (1) hide show
  1. src/App.js +36 -0
src/App.js CHANGED
@@ -1025,6 +1025,42 @@ function Message({ message }) {
1025
  </div>
1026
  )}
1027
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1028
  {message.debug.queries_executed && message.debug.queries_executed.length > 0 && (
1029
  <div style={{ marginBottom: "15px" }}>
1030
  <strong style={{ color: "#1a1a1a" }}>Executed Queries ({message.debug.queries_executed.length}):</strong>
 
1025
  </div>
1026
  )}
1027
 
1028
+ {message.debug.predicate_docs && message.debug.predicate_docs.length > 0 && (
1029
+ <div style={{ marginBottom: "15px" }}>
1030
+ <strong style={{ color: "#1a1a1a" }}>Predicate Descriptions:</strong>
1031
+ <ul style={{ marginTop: "8px", paddingLeft: "20px", color: "#1a1a1a" }}>
1032
+ {message.debug.predicate_docs.map((p, idx) => {
1033
+ const sig = p && (p.signature || p.predicate) ? String(p.signature || p.predicate) : "";
1034
+ const doc = p && p.doc ? String(p.doc) : "";
1035
+ const usage = p && p.usage ? String(p.usage) : "";
1036
+ const latex = p && p.latex ? String(p.latex) : "";
1037
+
1038
+ const md = [
1039
+ sig ? `**${sig}**` : "**(unknown)**",
1040
+ doc ? doc : "",
1041
+ usage ? `Usage: \`${usage}\`` : "",
1042
+ latex ? `LaTeX: $$${latex}$$` : "",
1043
+ ]
1044
+ .filter(Boolean)
1045
+ .join("\n\n");
1046
+
1047
+ return (
1048
+ <li key={idx} style={{ marginBottom: "10px" }}>
1049
+ <div style={{ background: "#fff", border: "1px solid #e2e2e2", borderRadius: "4px", padding: "8px" }}>
1050
+ <ReactMarkdown
1051
+ remarkPlugins={[remarkMath]}
1052
+ rehypePlugins={[[rehypeKatex, { strict: "ignore", throwOnError: false, trust: true }]]}
1053
+ >
1054
+ {md}
1055
+ </ReactMarkdown>
1056
+ </div>
1057
+ </li>
1058
+ );
1059
+ })}
1060
+ </ul>
1061
+ </div>
1062
+ )}
1063
+
1064
  {message.debug.queries_executed && message.debug.queries_executed.length > 0 && (
1065
  <div style={{ marginBottom: "15px" }}>
1066
  <strong style={{ color: "#1a1a1a" }}>Executed Queries ({message.debug.queries_executed.length}):</strong>