@meridianlabs/log-viewer 0.3.184 → 0.3.186

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.
@@ -1 +1 @@
1
- {"version":3,"file":"LogListGrid.d.ts","sourceRoot":"","sources":["../../../../src/app/log-list/grid/LogListGrid.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,SAAS,EAA2C,MAAM,OAAO,CAAC;AAK/E,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,CA0P5C,CAAC"}
1
+ {"version":3,"file":"LogListGrid.d.ts","sourceRoot":"","sources":["../../../../src/app/log-list/grid/LogListGrid.tsx"],"names":[],"mappings":"AAOA,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,CAsX5C,CAAC"}
@@ -12,6 +12,7 @@ export interface LogListRow {
12
12
  completedAt?: string;
13
13
  itemCount?: number;
14
14
  log?: LogHandle;
15
+ searchText?: string;
15
16
  [key: string]: any;
16
17
  }
17
18
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/app/log-list/grid/columns/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/app/log-list/grid/columns/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SampleDetailComponent.d.ts","sourceRoot":"","sources":["../../../src/app/samples/SampleDetailComponent.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAYnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wDAAwD;IACxD,WAAW,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gEAAgE;IAChE,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5D,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,gCAAgC;IAChC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,mFAAmF;IACnF,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,oDAAoD;IACpD,UAAU,EAAE,sBAAsB,CAAC;IACnC,8DAA8D;IAC9D,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAoKhE,CAAC"}
1
+ {"version":3,"file":"SampleDetailComponent.d.ts","sourceRoot":"","sources":["../../../src/app/samples/SampleDetailComponent.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAYnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wDAAwD;IACxD,WAAW,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gEAAgE;IAChE,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5D,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,gCAAgC;IAChC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,mFAAmF;IACnF,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,oDAAoD;IACpD,UAAU,EAAE,sBAAsB,CAAC;IACnC,8DAA8D;IAC9D,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAqKhE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FindBand.d.ts","sourceRoot":"","sources":["../../src/components/FindBand.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EAOH,MAAM,OAAO,CAAC;AAMf,OAAO,gBAAgB,CAAC;AAExB,UAAU,aAAa;CAAG;AAU1B,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAyWtC,CAAC"}
1
+ {"version":3,"file":"FindBand.d.ts","sourceRoot":"","sources":["../../src/components/FindBand.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAOH,MAAM,OAAO,CAAC;AAOf,UAAU,aAAa;CAAG;AAU1B,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAuUtC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { FC, KeyboardEvent, RefObject } from 'react';
2
+ interface FindBandUIProps {
3
+ onClose: () => void;
4
+ onNext: () => void;
5
+ onPrevious: () => void;
6
+ onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
7
+ onChange?: () => void;
8
+ onBeforeInput?: () => void;
9
+ value?: string;
10
+ matchCount?: number;
11
+ matchIndex?: number;
12
+ noResults?: boolean;
13
+ disableNav?: boolean;
14
+ inputRef?: RefObject<HTMLInputElement | null>;
15
+ }
16
+ export declare const FindBandUI: FC<FindBandUIProps>;
17
+ export {};
18
+ //# sourceMappingURL=FindBandUI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FindBandUI.d.ts","sourceRoot":"","sources":["../../src/components/FindBandUI.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,aAAa,EAAE,SAAS,EAAU,MAAM,OAAO,CAAC;AAEpE,OAAO,gBAAgB,CAAC;AAExB,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA4E1C,CAAC"}
package/lib/index.js CHANGED
@@ -17274,7 +17274,6 @@ const createSampleSlice = (set3, get2, _store) => {
17274
17274
  state.sample.sampleStatus = "loading";
17275
17275
  state.sample.sampleError = void 0;
17276
17276
  state.sample.sample_identifier = { logFile, id, epoch };
17277
- state.log.selectedSampleHandle = void 0;
17278
17277
  });
17279
17278
  },
17280
17279
  setSampleStatus: (status2) => set3((state) => {
@@ -106556,7 +106555,7 @@ const ViewerOptionsPopover = ({
106556
106555
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.fullWidth, styles$1d.fullWidthPadded), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1d.logDir, children: logDir2 }) }),
106557
106556
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }),
106558
106557
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Version" }),
106559
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.184-0-g924aa90c5" }),
106558
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.186-0-ge771f5dd8" }),
106560
106559
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Schema" }),
106561
106560
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: DB_VERSION }),
106562
106561
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }),
@@ -164277,6 +164276,82 @@ var AgGridReact = class extends Component$1 {
164277
164276
  return /* @__PURE__ */ React3__default.createElement(AgGridReactUi, { ...this.props, passGridApi: this.setGridApi });
164278
164277
  }
164279
164278
  };
164279
+ const FindBandUI = ({
164280
+ onClose,
164281
+ onNext,
164282
+ onPrevious,
164283
+ onKeyDown,
164284
+ onChange,
164285
+ onBeforeInput,
164286
+ value: value2,
164287
+ matchCount,
164288
+ matchIndex,
164289
+ noResults = false,
164290
+ disableNav,
164291
+ inputRef: externalRef
164292
+ }) => {
164293
+ const internalRef = useRef(null);
164294
+ const inputRef = externalRef ?? internalRef;
164295
+ const inputProps = {
164296
+ type: "text",
164297
+ placeholder: "Find",
164298
+ onKeyDown,
164299
+ onBeforeInput,
164300
+ onChange
164301
+ };
164302
+ if (value2 !== void 0) {
164303
+ inputProps.value = value2;
164304
+ }
164305
+ const hasCount = matchCount !== void 0 && matchIndex !== void 0;
164306
+ const showStatus = noResults || hasCount && matchCount > 0;
164307
+ const statusText2 = hasCount && matchCount > 0 ? `${matchIndex + 1} of ${matchCount}` : "No results";
164308
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-unsearchable": "true", className: clsx("findBand"), children: [
164309
+ /* @__PURE__ */ jsxRuntimeExports.jsx("input", { ref: inputRef, ...inputProps }),
164310
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164311
+ "span",
164312
+ {
164313
+ className: clsx(
164314
+ "findBand-match-count",
164315
+ noResults && matchCount === 0 && "findBand-no-results"
164316
+ ),
164317
+ style: { visibility: showStatus ? "visible" : "hidden" },
164318
+ children: statusText2
164319
+ }
164320
+ ),
164321
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164322
+ "button",
164323
+ {
164324
+ type: "button",
164325
+ title: "Previous match",
164326
+ className: "btn prev",
164327
+ onClick: onPrevious,
164328
+ disabled: disableNav,
164329
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.up })
164330
+ }
164331
+ ),
164332
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164333
+ "button",
164334
+ {
164335
+ type: "button",
164336
+ title: "Next match",
164337
+ className: "btn next",
164338
+ onClick: onNext,
164339
+ disabled: disableNav,
164340
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.down })
164341
+ }
164342
+ ),
164343
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164344
+ "button",
164345
+ {
164346
+ type: "button",
164347
+ title: "Close",
164348
+ className: "btn close",
164349
+ onClick: onClose,
164350
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.close })
164351
+ }
164352
+ )
164353
+ ] });
164354
+ };
164280
164355
  ModuleRegistry.registerModules([AllCommunityModule]);
164281
164356
  const createGridKeyboardHandler = ({
164282
164357
  gridRef,
@@ -164378,6 +164453,17 @@ const LogListGrid = ({
164378
164453
  const internalGridRef = useRef(null);
164379
164454
  const gridRef = externalGridRef ?? internalGridRef;
164380
164455
  const gridContainerRef = useRef(null);
164456
+ const [showFind, setShowFind] = useState(false);
164457
+ const [findTerm, setFindTerm] = useState("");
164458
+ const [matchIds, setMatchIds] = useState([]);
164459
+ const [currentMatchIndex, setCurrentMatchIndex] = useState(0);
164460
+ const findInputRef = useRef(null);
164461
+ const closeFind = useCallback(() => {
164462
+ setShowFind(false);
164463
+ setFindTerm("");
164464
+ setMatchIds([]);
164465
+ setCurrentMatchIndex(0);
164466
+ }, []);
164381
164467
  const logFiles = useMemo(() => {
164382
164468
  return items.filter((item2) => item2.type === "file").map((item2) => item2.log).filter((file) => file !== void 0);
164383
164469
  }, [items]);
@@ -164427,6 +164513,7 @@ const LogListGrid = ({
164427
164513
  }
164428
164514
  }
164429
164515
  }
164516
+ row2.searchText = [row2.name, row2.task, row2.model, row2.id].filter(Boolean).join(" ").toLowerCase();
164430
164517
  return row2;
164431
164518
  });
164432
164519
  }, [items, logDetails]);
@@ -164513,47 +164600,145 @@ const LogListGrid = ({
164513
164600
  useEffect(() => {
164514
164601
  resizeGridColumns();
164515
164602
  }, [columns, resizeGridColumns]);
164516
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$18.gridWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$18.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
164517
- AgGridReact,
164518
- {
164519
- ref: gridRef,
164520
- rowData: data,
164521
- animateRows: false,
164522
- columnDefs: columns,
164523
- defaultColDef: {
164524
- sortable: true,
164525
- filter: true,
164526
- resizable: true
164527
- },
164528
- autoSizeStrategy: { type: "fitGridWidth" },
164529
- headerHeight: 25,
164530
- rowSelection: { mode: "singleRow", checkboxes: false },
164531
- getRowId: (params) => params.data.id,
164532
- onGridColumnsChanged: (e) => {
164533
- const cols = e.api.getColumnDefs();
164534
- if (cols && cols?.length > maxColCount.current) {
164535
- maxColCount.current = cols.length;
164536
- resizeGridColumns();
164603
+ const performSearch = useCallback(
164604
+ (term) => {
164605
+ const api2 = gridRef.current?.api;
164606
+ if (!api2 || !term) {
164607
+ setMatchIds([]);
164608
+ setCurrentMatchIndex(0);
164609
+ return;
164610
+ }
164611
+ const lowerTerm = term.toLowerCase();
164612
+ const foundIds = [];
164613
+ api2.forEachNode((node2) => {
164614
+ const rowData = node2.data;
164615
+ if (!rowData?.searchText) return;
164616
+ if (rowData.searchText.includes(lowerTerm)) {
164617
+ foundIds.push(rowData.id);
164537
164618
  }
164538
- },
164539
- onGridSizeChanged: resizeGridColumns,
164540
- theme: themeBalham,
164541
- enableCellTextSelection: true,
164542
- initialState: initialGridState,
164543
- suppressCellFocus: true,
164544
- onStateUpdated: (e) => {
164545
- setGridState(e.state);
164546
- if (gridRef.current?.api) {
164547
- const displayedRowCount = gridRef.current.api.getDisplayedRowCount();
164548
- setFilteredCount(displayedRowCount);
164619
+ });
164620
+ setMatchIds(foundIds);
164621
+ setCurrentMatchIndex(0);
164622
+ if (foundIds.length > 0) {
164623
+ const firstNode = api2.getRowNode(foundIds[0]);
164624
+ if (firstNode) {
164625
+ api2.deselectAll();
164626
+ api2.ensureNodeVisible(firstNode, "middle");
164627
+ firstNode.setSelected(true, true);
164549
164628
  }
164550
- },
164551
- onRowClicked: handleRowClick,
164552
- onSortChanged: handleSortChanged,
164553
- onFilterChanged: handleFilterChanged,
164554
- loading: data.length === 0 && (loading > 0 || syncing)
164629
+ }
164630
+ },
164631
+ [gridRef]
164632
+ );
164633
+ const goToMatch = useCallback(
164634
+ (index) => {
164635
+ if (matchIds.length === 0) return;
164636
+ const idx = (index % matchIds.length + matchIds.length) % matchIds.length;
164637
+ setCurrentMatchIndex(idx);
164638
+ const api2 = gridRef.current?.api;
164639
+ if (!api2) return;
164640
+ const node2 = api2.getRowNode(matchIds[idx]);
164641
+ if (node2) {
164642
+ api2.deselectAll();
164643
+ api2.ensureNodeVisible(node2, "middle");
164644
+ node2.setSelected(true, true);
164645
+ }
164646
+ },
164647
+ [matchIds, gridRef]
164648
+ );
164649
+ const handleInputKeyDown = useCallback(
164650
+ (e) => {
164651
+ if (e.key === "Escape") {
164652
+ closeFind();
164653
+ } else if (e.key === "Enter") {
164654
+ e.preventDefault();
164655
+ goToMatch(currentMatchIndex + (e.shiftKey ? -1 : 1));
164656
+ }
164657
+ },
164658
+ [goToMatch, currentMatchIndex, closeFind]
164659
+ );
164660
+ useEffect(() => {
164661
+ const handleFindKeyDown = (e) => {
164662
+ if ((e.metaKey || e.ctrlKey) && e.key === "f") {
164663
+ e.preventDefault();
164664
+ e.stopPropagation();
164665
+ setShowFind(true);
164666
+ setTimeout(() => findInputRef.current?.focus(), 100);
164667
+ }
164668
+ if (e.key === "Escape" && showFind) {
164669
+ closeFind();
164670
+ }
164671
+ };
164672
+ document.addEventListener("keydown", handleFindKeyDown, true);
164673
+ return () => document.removeEventListener("keydown", handleFindKeyDown, true);
164674
+ }, [closeFind, showFind]);
164675
+ useEffect(() => {
164676
+ if (findTerm) {
164677
+ performSearch(findTerm);
164678
+ } else {
164679
+ setMatchIds([]);
164680
+ setCurrentMatchIndex(0);
164555
164681
  }
164556
- ) }) });
164682
+ }, [findTerm, performSearch]);
164683
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$18.gridWrapper), children: [
164684
+ showFind && /* @__PURE__ */ jsxRuntimeExports.jsx(
164685
+ FindBandUI,
164686
+ {
164687
+ inputRef: findInputRef,
164688
+ value: findTerm,
164689
+ onChange: () => setFindTerm(findInputRef.current?.value ?? ""),
164690
+ onKeyDown: handleInputKeyDown,
164691
+ onClose: closeFind,
164692
+ onPrevious: () => goToMatch(currentMatchIndex - 1),
164693
+ onNext: () => goToMatch(currentMatchIndex + 1),
164694
+ disableNav: matchIds.length === 0,
164695
+ noResults: !!findTerm && matchIds.length === 0,
164696
+ matchCount: findTerm ? matchIds.length : void 0,
164697
+ matchIndex: findTerm ? currentMatchIndex : void 0
164698
+ }
164699
+ ),
164700
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$18.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
164701
+ AgGridReact,
164702
+ {
164703
+ ref: gridRef,
164704
+ rowData: data,
164705
+ animateRows: false,
164706
+ columnDefs: columns,
164707
+ defaultColDef: {
164708
+ sortable: true,
164709
+ filter: true,
164710
+ resizable: true
164711
+ },
164712
+ autoSizeStrategy: { type: "fitGridWidth" },
164713
+ headerHeight: 25,
164714
+ rowSelection: { mode: "singleRow", checkboxes: false },
164715
+ getRowId: (params) => params.data.id,
164716
+ onGridColumnsChanged: (e) => {
164717
+ const cols = e.api.getColumnDefs();
164718
+ if (cols && cols?.length > maxColCount.current) {
164719
+ maxColCount.current = cols.length;
164720
+ resizeGridColumns();
164721
+ }
164722
+ },
164723
+ onGridSizeChanged: resizeGridColumns,
164724
+ theme: themeBalham,
164725
+ enableCellTextSelection: true,
164726
+ initialState: initialGridState,
164727
+ suppressCellFocus: true,
164728
+ onStateUpdated: (e) => {
164729
+ setGridState(e.state);
164730
+ if (gridRef.current?.api) {
164731
+ const displayedRowCount = gridRef.current.api.getDisplayedRowCount();
164732
+ setFilteredCount(displayedRowCount);
164733
+ }
164734
+ },
164735
+ onRowClicked: handleRowClick,
164736
+ onSortChanged: handleSortChanged,
164737
+ onFilterChanged: handleFilterChanged,
164738
+ loading: data.length === 0 && (loading > 0 || syncing)
164739
+ }
164740
+ ) })
164741
+ ] });
164557
164742
  };
164558
164743
  const footer$1 = "_footer_14uod_1";
164559
164744
  const spinnerContainer$1 = "_spinnerContainer_14uod_11";
@@ -165539,64 +165724,21 @@ const FindBand = () => {
165539
165724
  document.removeEventListener("keydown", handleGlobalKeyDown, true);
165540
165725
  };
165541
165726
  }, [handleSearch, restoreCursor]);
165542
- const matchCountLabel = useMemo(() => {
165543
- if (matchCount === null) return null;
165544
- if (matchCount === 0) return "No results";
165545
- return `${currentMatchIndex} of ${matchCount}`;
165546
- }, [matchCount, currentMatchIndex]);
165547
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-unsearchable": "true", className: clsx("findBand"), children: [
165548
- /* @__PURE__ */ jsxRuntimeExports.jsx(
165549
- "input",
165550
- {
165551
- type: "text",
165552
- ref: searchBoxRef,
165553
- placeholder: "Find",
165554
- onKeyDown: handleKeyDown,
165555
- onBeforeInput: handleBeforeInput,
165556
- onChange: handleInputChange
165557
- }
165558
- ),
165559
- matchCountLabel !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(
165560
- "span",
165561
- {
165562
- className: clsx(
165563
- "findBand-match-count",
165564
- matchCount === 0 && "findBand-no-results"
165565
- ),
165566
- children: matchCountLabel
165567
- }
165568
- ),
165569
- /* @__PURE__ */ jsxRuntimeExports.jsx(
165570
- "button",
165571
- {
165572
- type: "button",
165573
- title: "Previous match",
165574
- className: "btn next",
165575
- onClick: findPrevious,
165576
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.up })
165577
- }
165578
- ),
165579
- /* @__PURE__ */ jsxRuntimeExports.jsx(
165580
- "button",
165581
- {
165582
- type: "button",
165583
- title: "Next match",
165584
- className: "btn prev",
165585
- onClick: findNext,
165586
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.down })
165587
- }
165588
- ),
165589
- /* @__PURE__ */ jsxRuntimeExports.jsx(
165590
- "button",
165591
- {
165592
- type: "button",
165593
- title: "Close",
165594
- className: "btn close",
165595
- onClick: storeHideFind,
165596
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.close })
165597
- }
165598
- )
165599
- ] });
165727
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
165728
+ FindBandUI,
165729
+ {
165730
+ inputRef: searchBoxRef,
165731
+ onClose: storeHideFind,
165732
+ onNext: findNext,
165733
+ onPrevious: findPrevious,
165734
+ onKeyDown: handleKeyDown,
165735
+ onBeforeInput: handleBeforeInput,
165736
+ onChange: handleInputChange,
165737
+ noResults: matchCount !== null && matchCount === 0,
165738
+ matchCount: matchCount ?? void 0,
165739
+ matchIndex: matchCount !== null && matchCount > 0 ? currentMatchIndex - 1 : void 0
165740
+ }
165741
+ );
165600
165742
  };
165601
165743
  function windowFind(searchTerm, back) {
165602
165744
  return window.find(
@@ -180930,7 +181072,8 @@ const SampleDetailComponent = ({
180930
181072
  }, [sampleData]);
180931
181073
  const sampleStatus2 = useStore((state) => state.sample.sampleStatus);
180932
181074
  const sampleMatchesRequest = useMemo(() => {
180933
- if (!sample2 || !sampleId || !epoch) return false;
181075
+ if (!sampleId || !epoch) return false;
181076
+ if (!sample2) return true;
180934
181077
  return String(sample2.id) === sampleId && sample2.epoch === parseInt(epoch, 10);
180935
181078
  }, [sample2, sampleId, epoch]);
180936
181079
  const showFind = useStore((state) => state.app.showFind);
@@ -181043,7 +181186,7 @@ const SampleDetailComponent = ({
181043
181186
  ] })
181044
181187
  }
181045
181188
  ),
181046
- sampleStatus2 !== "loading" && sample2 && sampleMatchesRequest && /* @__PURE__ */ jsxRuntimeExports.jsx(
181189
+ sampleStatus2 !== "loading" && sampleMatchesRequest && /* @__PURE__ */ jsxRuntimeExports.jsx(
181047
181190
  InlineSampleComponent,
181048
181191
  {
181049
181192
  showActivity: false,