@meridianlabs/log-viewer 0.3.196 → 0.3.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/log-list/grid/LogListGrid.d.ts.map +1 -1
- package/lib/app/samples/chat/MessageContent.d.ts.map +1 -1
- package/lib/app/samples/list/SampleList.d.ts.map +1 -1
- package/lib/app/samples-panel/samples-grid/SamplesGrid.d.ts.map +1 -1
- package/lib/{utils → app/utils}/print.d.ts +2 -1
- package/lib/app/utils/print.d.ts.map +1 -0
- package/lib/index.js +96 -64
- package/lib/index.js.map +1 -1
- package/lib/styles/index.css +10 -0
- package/package.json +1 -1
- package/lib/utils/print.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogListGrid.d.ts","sourceRoot":"","sources":["../../../../src/app/log-list/grid/LogListGrid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogListGrid.d.ts","sourceRoot":"","sources":["../../../../src/app/log-list/grid/LogListGrid.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,EAAE,EAEF,SAAS,EAMV,MAAM,OAAO,CAAC;AAMf,OAAO,qBAAqB,CAAC;AAI7B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAkY5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../../src/app/samples/chat/MessageContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EAGb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAYjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,KAAK,aAAa,GACd,WAAW,GACX,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,WAAW,GACX,WAAW,GACX,cAAc,CAAC;AAInB,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;AAEpD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,GAC3B,SAAS,OAAO,KACf,OAAO,IAAI,aAOb,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAoDlD,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageContent.d.ts","sourceRoot":"","sources":["../../../../src/app/samples/chat/MessageContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EAGb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAYjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,KAAK,aAAa,GACd,WAAW,GACX,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,WAAW,GACX,WAAW,GACX,cAAc,CAAC;AAInB,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;AAEpD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,GAC3B,SAAS,OAAO,KACf,OAAO,IAAI,aAOb,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAoDlD,CAAC;AAyRF,MAAM,MAAM,gBAAgB,CAAC,IAAI,EAAE,IAAI,SAAS,WAAW,IAAI,IAAI,SAAS,GAAG,GAC3E,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAChB,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SampleList.d.ts","sourceRoot":"","sources":["../../../../src/app/samples/list/SampleList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SampleList.d.ts","sourceRoot":"","sources":["../../../../src/app/samples/list/SampleList.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,EAAE,EAEF,SAAS,EAKV,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAS3D,OAAO,qBAAqB,CAAC;AAQ7B,UAAU,eAAe;IACvB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;CAC3D;AAKD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA6SzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SamplesGrid.d.ts","sourceRoot":"","sources":["../../../../src/app/samples-panel/samples-grid/SamplesGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SamplesGrid.d.ts","sourceRoot":"","sources":["../../../../src/app/samples-panel/samples-grid/SamplesGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EAMP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,SAAS,EAA2C,MAAM,OAAO,CAAC;AAK/E,OAAO,qBAAqB,CAAC;AAI7B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,UAAU,gBAAgB;IACxB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;CAC9B;AAGD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyQ5C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EvalSpec } from '../../@types/log';
|
|
1
2
|
/**
|
|
2
3
|
* Opens a new window and prints the provided HTML content with optional custom CSS for printing.
|
|
3
4
|
*
|
|
@@ -17,5 +18,5 @@ export declare const printHtml: (html: string, css: string) => void;
|
|
|
17
18
|
* const headingHtml = printHeadingHtml();
|
|
18
19
|
* console.log(headingHtml);
|
|
19
20
|
*/
|
|
20
|
-
export declare const printHeadingHtml: () => string;
|
|
21
|
+
export declare const printHeadingHtml: (evalSpec?: EvalSpec) => string;
|
|
21
22
|
//# sourceMappingURL=print.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../src/app/utils/print.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,SAkClD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,QAAQ,KAAG,MAetD,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -99584,15 +99584,14 @@ const MessageContent = ({
|
|
|
99584
99584
|
};
|
|
99585
99585
|
const messageRenderers = {
|
|
99586
99586
|
text: {
|
|
99587
|
-
render: (key2, content2, isLast,
|
|
99587
|
+
render: (key2, content2, isLast, _context) => {
|
|
99588
99588
|
const c2 = content2;
|
|
99589
99589
|
const cites = c2.citations ?? [];
|
|
99590
99590
|
if (!c2.text && !cites.length) {
|
|
99591
99591
|
return void 0;
|
|
99592
99592
|
}
|
|
99593
99593
|
const purgeInternalContainers = (text2) => {
|
|
99594
|
-
const
|
|
99595
|
-
const internalTags = !isAssistantMessage ? ["internal", "content-internal"] : ["internal", "content-internal", "think"];
|
|
99594
|
+
const internalTags = ["internal", "content-internal"];
|
|
99596
99595
|
internalTags.forEach((tag) => {
|
|
99597
99596
|
const regex2 = new RegExp(`<${tag}[^>]*>[\\s\\S]*?<\\/${tag}>`, "gm");
|
|
99598
99597
|
text2 = text2.replace(regex2, "");
|
|
@@ -106611,7 +106610,7 @@ const ViewerOptionsPopover = ({
|
|
|
106611
106610
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.fullWidth, styles$1d.fullWidthPadded), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1d.logDir, children: logDir2 }) }),
|
|
106612
106611
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }),
|
|
106613
106612
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Version" }),
|
|
106614
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.
|
|
106613
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.199-0-gffdb82c59" }),
|
|
106615
106614
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Schema" }),
|
|
106616
106615
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: DB_VERSION }),
|
|
106617
106616
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }),
|
|
@@ -164629,6 +164628,16 @@ const LogListGrid = ({
|
|
|
164629
164628
|
gridElement.removeEventListener("keydown", handleKeyDown);
|
|
164630
164629
|
};
|
|
164631
164630
|
}, [handleKeyDown]);
|
|
164631
|
+
const handleCellMouseDown = useCallback(
|
|
164632
|
+
(e) => {
|
|
164633
|
+
const mouseEvent = e.event;
|
|
164634
|
+
if (mouseEvent?.button === 1 && e.data?.url) {
|
|
164635
|
+
mouseEvent.preventDefault();
|
|
164636
|
+
window.open(`#${e.data.url}`, "_blank");
|
|
164637
|
+
}
|
|
164638
|
+
},
|
|
164639
|
+
[]
|
|
164640
|
+
);
|
|
164632
164641
|
useEffect(() => {
|
|
164633
164642
|
const loadHeaders = async () => {
|
|
164634
164643
|
const filesToLoad = logFiles.filter((file) => !logPreviews[file.name]);
|
|
@@ -164795,6 +164804,7 @@ const LogListGrid = ({
|
|
|
164795
164804
|
}
|
|
164796
164805
|
},
|
|
164797
164806
|
onRowClicked: handleRowClick,
|
|
164807
|
+
onCellMouseDown: handleCellMouseDown,
|
|
164798
164808
|
onSortChanged: handleSortChanged,
|
|
164799
164809
|
onFilterChanged: handleFilterChanged,
|
|
164800
164810
|
loading: data.length === 0 && (loading > 0 || syncing)
|
|
@@ -166188,51 +166198,6 @@ const NoContentsPanel = ({ text: text2 }) => {
|
|
|
166188
166198
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: text2 })
|
|
166189
166199
|
] }) });
|
|
166190
166200
|
};
|
|
166191
|
-
const printHtml = (html2, css2) => {
|
|
166192
|
-
const printWindow = window.open("", "", "height=600,width=800");
|
|
166193
|
-
if (printWindow !== null) {
|
|
166194
|
-
printWindow.document.write("<html><head><title>Print</title>");
|
|
166195
|
-
printWindow.document.write(`
|
|
166196
|
-
<link rel="stylesheet" crossorigin="" href="./assets/index.css">
|
|
166197
|
-
<style>
|
|
166198
|
-
@media print {
|
|
166199
|
-
${css2}
|
|
166200
|
-
}
|
|
166201
|
-
</style>
|
|
166202
|
-
`);
|
|
166203
|
-
printWindow.document.write("</head><body>");
|
|
166204
|
-
printWindow.document.write(html2);
|
|
166205
|
-
printWindow.document.write("</body></html>");
|
|
166206
|
-
printWindow.document.close();
|
|
166207
|
-
printWindow.onload = function() {
|
|
166208
|
-
printWindow.focus();
|
|
166209
|
-
printWindow.print();
|
|
166210
|
-
printWindow.close();
|
|
166211
|
-
};
|
|
166212
|
-
} else {
|
|
166213
|
-
console.error("Print window failed to open.");
|
|
166214
|
-
}
|
|
166215
|
-
};
|
|
166216
|
-
const printHeadingHtml = () => {
|
|
166217
|
-
const taskEl = document.getElementById("task-title");
|
|
166218
|
-
const modelEl = document.getElementById("task-model");
|
|
166219
|
-
const timeEl = document.getElementById("task-created");
|
|
166220
|
-
if (!taskEl || !modelEl || !timeEl) {
|
|
166221
|
-
throw new Error(
|
|
166222
|
-
"Failed to compute heading HTML. The task, model, or time element can't be found."
|
|
166223
|
-
);
|
|
166224
|
-
}
|
|
166225
|
-
const task = taskEl.innerText;
|
|
166226
|
-
const model2 = modelEl.innerText;
|
|
166227
|
-
const time = timeEl.innerText;
|
|
166228
|
-
const headingHtml = `
|
|
166229
|
-
<div style="display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 0.5em; margin-bottom: 2em; justify-content: space-between; border-bottom: solid 1px silver;">
|
|
166230
|
-
<div style="font-weight: 600">${task}</div>
|
|
166231
|
-
<div style="text-align: center;">${model2}</div>
|
|
166232
|
-
<div style="text-align: right;">${time}</div>
|
|
166233
|
-
</div>`;
|
|
166234
|
-
return headingHtml;
|
|
166235
|
-
};
|
|
166236
166201
|
const messagesToStr = (messages2, options2) => {
|
|
166237
166202
|
const opts = {};
|
|
166238
166203
|
return messages2.map((msg) => messageToStr(msg, opts)).filter((str2) => str2 !== null).join("\n");
|
|
@@ -180010,6 +179975,11 @@ const transformers = () => {
|
|
|
180010
179975
|
matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 2 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT && node2.children[1].event.event === STATE,
|
|
180011
179976
|
process: (node2) => skipFirstChildNode(node2)
|
|
180012
179977
|
},
|
|
179978
|
+
{
|
|
179979
|
+
name: "unwrap_filtered-agent_solver",
|
|
179980
|
+
matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 1 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT,
|
|
179981
|
+
process: (node2) => skipFirstChildNode(node2)
|
|
179982
|
+
},
|
|
180013
179983
|
{
|
|
180014
179984
|
name: "unwrap_agent_solver w/store",
|
|
180015
179985
|
matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 3 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT && node2.children[1].event.event === STATE && node2.children[2].event.event === STORE,
|
|
@@ -180518,6 +180488,43 @@ const TranscriptPanel = memo((props) => {
|
|
|
180518
180488
|
);
|
|
180519
180489
|
}
|
|
180520
180490
|
});
|
|
180491
|
+
const printHtml = (html2, css2) => {
|
|
180492
|
+
const printWindow = window.open("", "", "height=600,width=800");
|
|
180493
|
+
if (printWindow !== null) {
|
|
180494
|
+
printWindow.document.write("<html><head><title>Print</title>");
|
|
180495
|
+
printWindow.document.write(`
|
|
180496
|
+
<link rel="stylesheet" crossorigin="" href="./assets/index.css">
|
|
180497
|
+
<style>
|
|
180498
|
+
@media print {
|
|
180499
|
+
${css2}
|
|
180500
|
+
}
|
|
180501
|
+
</style>
|
|
180502
|
+
`);
|
|
180503
|
+
printWindow.document.write("</head><body>");
|
|
180504
|
+
printWindow.document.write(html2);
|
|
180505
|
+
printWindow.document.write("</body></html>");
|
|
180506
|
+
printWindow.document.close();
|
|
180507
|
+
printWindow.onload = function() {
|
|
180508
|
+
printWindow.focus();
|
|
180509
|
+
printWindow.print();
|
|
180510
|
+
printWindow.close();
|
|
180511
|
+
};
|
|
180512
|
+
} else {
|
|
180513
|
+
console.error("Print window failed to open.");
|
|
180514
|
+
}
|
|
180515
|
+
};
|
|
180516
|
+
const printHeadingHtml = (evalSpec) => {
|
|
180517
|
+
const task = evalSpec?.task || "Unknown Task";
|
|
180518
|
+
const model2 = evalSpec?.model || "Unknown Model";
|
|
180519
|
+
const time = evalSpec?.created ? new Date(evalSpec.created).toLocaleString() : "Unknown Time";
|
|
180520
|
+
const headingHtml = `
|
|
180521
|
+
<div style="display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 0.5em; margin-bottom: 2em; justify-content: space-between; border-bottom: solid 1px silver;">
|
|
180522
|
+
<div style="font-weight: 600">${task}</div>
|
|
180523
|
+
<div style="text-align: center;">${model2}</div>
|
|
180524
|
+
<div style="text-align: right;">${time}</div>
|
|
180525
|
+
</div>`;
|
|
180526
|
+
return headingHtml;
|
|
180527
|
+
};
|
|
180521
180528
|
const SampleDisplay = ({
|
|
180522
180529
|
id,
|
|
180523
180530
|
scrollRef,
|
|
@@ -180615,8 +180622,8 @@ const SampleDisplay = ({
|
|
|
180615
180622
|
const filterRef = useRef(null);
|
|
180616
180623
|
const optionsRef = useRef(null);
|
|
180617
180624
|
const handlePrintClick = useCallback(() => {
|
|
180618
|
-
printSample(id, targetId);
|
|
180619
|
-
}, [id, targetId]);
|
|
180625
|
+
printSample(id, targetId, evalSpec);
|
|
180626
|
+
}, [id, targetId, evalSpec]);
|
|
180620
180627
|
const toggleFilter = useCallback(() => {
|
|
180621
180628
|
setShowing(!isShowing);
|
|
180622
180629
|
}, [setShowing, isShowing]);
|
|
@@ -181041,7 +181048,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => {
|
|
|
181041
181048
|
}
|
|
181042
181049
|
return sampleMetadatas;
|
|
181043
181050
|
};
|
|
181044
|
-
const printSample = (id, targetId) => {
|
|
181051
|
+
const printSample = (id, targetId, evalSpec) => {
|
|
181045
181052
|
const targetTabEl = document.querySelector(
|
|
181046
181053
|
`#${escapeSelector(targetId)} .sample-tab.tab-pane.show.active`
|
|
181047
181054
|
);
|
|
@@ -181050,7 +181057,7 @@ const printSample = (id, targetId) => {
|
|
|
181050
181057
|
if (targetEl) {
|
|
181051
181058
|
const headingId = `sample-heading-${id}`;
|
|
181052
181059
|
const headingEl = document.getElementById(headingId);
|
|
181053
|
-
const headingHtml = printHeadingHtml();
|
|
181060
|
+
const headingHtml = printHeadingHtml(evalSpec);
|
|
181054
181061
|
const css2 = `
|
|
181055
181062
|
html { font-size: 9pt }
|
|
181056
181063
|
/* Allow content to break anywhere without any forced page breaks */
|
|
@@ -181063,13 +181070,6 @@ const printSample = (id, targetId) => {
|
|
|
181063
181070
|
page-break-after: auto;
|
|
181064
181071
|
}
|
|
181065
181072
|
/* Specifically disable all page breaks for divs */
|
|
181066
|
-
div {
|
|
181067
|
-
break-inside: auto;
|
|
181068
|
-
page-break-inside: auto;
|
|
181069
|
-
}
|
|
181070
|
-
body > .transcript-step {
|
|
181071
|
-
break-inside: avoid;
|
|
181072
|
-
}
|
|
181073
181073
|
body{
|
|
181074
181074
|
-webkit-print-color-adjust:exact !important;
|
|
181075
181075
|
print-color-adjust:exact !important;
|
|
@@ -203641,10 +203641,25 @@ const SampleList = memo((props) => {
|
|
|
203641
203641
|
useEffect(() => {
|
|
203642
203642
|
const el2 = gridContainerRef.current;
|
|
203643
203643
|
if (!el2) return;
|
|
203644
|
-
|
|
203645
|
-
|
|
203646
|
-
|
|
203644
|
+
el2.addEventListener("keydown", handleKeyDown);
|
|
203645
|
+
return () => {
|
|
203646
|
+
el2.removeEventListener("keydown", handleKeyDown);
|
|
203647
|
+
};
|
|
203647
203648
|
}, [handleKeyDown]);
|
|
203649
|
+
const handleCellMouseDown = useCallback(
|
|
203650
|
+
(e) => {
|
|
203651
|
+
const mouseEvent = e.event;
|
|
203652
|
+
if (mouseEvent?.button === 1 && e.data) {
|
|
203653
|
+
mouseEvent.preventDefault();
|
|
203654
|
+
const url = sampleNavigation.getSampleUrl(
|
|
203655
|
+
e.data.data.id,
|
|
203656
|
+
e.data.data.epoch
|
|
203657
|
+
);
|
|
203658
|
+
if (url) window.open(url, "_blank");
|
|
203659
|
+
}
|
|
203660
|
+
},
|
|
203661
|
+
[sampleNavigation]
|
|
203662
|
+
);
|
|
203648
203663
|
const selectCurrentSample = useCallback(() => {
|
|
203649
203664
|
if (!listHandle.current?.api || !selectedSampleHandle) {
|
|
203650
203665
|
return;
|
|
@@ -203760,6 +203775,7 @@ const SampleList = memo((props) => {
|
|
|
203760
203775
|
getRowId,
|
|
203761
203776
|
rowSelection: { mode: "singleRow", checkboxes: false },
|
|
203762
203777
|
onRowClicked: handleRowClick,
|
|
203778
|
+
onCellMouseDown: handleCellMouseDown,
|
|
203763
203779
|
onColumnResized: handleColumnResized,
|
|
203764
203780
|
theme: themeBalham,
|
|
203765
203781
|
enableCellTextSelection: true,
|
|
@@ -205745,7 +205761,7 @@ const SamplesGrid = ({
|
|
|
205745
205761
|
(state) => state.log.selectedSampleHandle
|
|
205746
205762
|
);
|
|
205747
205763
|
const internalGridRef = useRef(null);
|
|
205748
|
-
const gridRef = externalGridRef
|
|
205764
|
+
const gridRef = externalGridRef ?? internalGridRef;
|
|
205749
205765
|
const gridContainerRef = useRef(null);
|
|
205750
205766
|
const { startPolling, stopPolling } = useClientEvents();
|
|
205751
205767
|
useEffect(() => {
|
|
@@ -205818,6 +205834,21 @@ const SamplesGrid = ({
|
|
|
205818
205834
|
gridElement.removeEventListener("keydown", handleKeyDown);
|
|
205819
205835
|
};
|
|
205820
205836
|
}, [handleKeyDown]);
|
|
205837
|
+
const handleCellMouseDown = useCallback(
|
|
205838
|
+
(e) => {
|
|
205839
|
+
const mouseEvent = e.event;
|
|
205840
|
+
if (mouseEvent?.button === 1 && e.data) {
|
|
205841
|
+
mouseEvent.preventDefault();
|
|
205842
|
+
navigateToSampleDetail(
|
|
205843
|
+
e.data.logFile,
|
|
205844
|
+
e.data.sampleId,
|
|
205845
|
+
e.data.epoch,
|
|
205846
|
+
true
|
|
205847
|
+
);
|
|
205848
|
+
}
|
|
205849
|
+
},
|
|
205850
|
+
[navigateToSampleDetail]
|
|
205851
|
+
);
|
|
205821
205852
|
const sampleRowId = (logFile, sampleId, epoch) => {
|
|
205822
205853
|
return `${logFile}-${sampleId}-${epoch}`.replace(/\s+/g, "_");
|
|
205823
205854
|
};
|
|
@@ -205889,6 +205920,7 @@ const SamplesGrid = ({
|
|
|
205889
205920
|
}
|
|
205890
205921
|
},
|
|
205891
205922
|
onRowClicked: handleRowClick,
|
|
205923
|
+
onCellMouseDown: handleCellMouseDown,
|
|
205892
205924
|
onFilterChanged: () => {
|
|
205893
205925
|
if (gridRef.current?.api) {
|
|
205894
205926
|
const newDisplayedSamples = gridDisplayedSamples(
|