@railtownai/railtracks-visualizer 0.0.55 → 0.0.57

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/dist/cjs/index.js CHANGED
@@ -114702,27 +114702,58 @@ const EvaluationDetailsDrawer = ({ evaluation, open, onClose, getEvaluatorResult
114702
114702
  })))));
114703
114703
  };
114704
114704
 
114705
- const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefresh, onRowClick, onCompare, compareIdsFromUrl, onCompareUrlChange, showFilters = true, showCompare = true, emptyMessage, title })=>{
114705
+ const GITHUB_URL = "https://github.com/RailtownAI/railtracks/";
114706
+ const EvaluationsErrorCard = ({ error, onRetry })=>/*#__PURE__*/ React.createElement(Alert, {
114707
+ type: "error",
114708
+ title: "Error loading evaluations",
114709
+ description: /*#__PURE__*/ React.createElement("div", {
114710
+ style: {
114711
+ display: "flex",
114712
+ flexDirection: "column",
114713
+ gap: "8px"
114714
+ }
114715
+ }, /*#__PURE__*/ React.createElement("span", null, error), /*#__PURE__*/ React.createElement(Typography.Text, {
114716
+ type: "secondary",
114717
+ style: {
114718
+ fontSize: "13px"
114719
+ }
114720
+ }, "Need help?", " ", /*#__PURE__*/ React.createElement(Typography.Link, {
114721
+ href: GITHUB_URL,
114722
+ target: "_blank",
114723
+ rel: "noopener noreferrer"
114724
+ }, "GitHub"), " · ", /*#__PURE__*/ React.createElement(Typography.Link, {
114725
+ href: `${GITHUB_URL}discussions`,
114726
+ target: "_blank",
114727
+ rel: "noopener noreferrer"
114728
+ }, "Discussions"), " · ", /*#__PURE__*/ React.createElement(Typography.Link, {
114729
+ href: `${GITHUB_URL}issues`,
114730
+ target: "_blank",
114731
+ rel: "noopener noreferrer"
114732
+ }, "Report issue"))),
114733
+ action: onRetry ? /*#__PURE__*/ React.createElement(Button$1, {
114734
+ size: "small",
114735
+ danger: true,
114736
+ onClick: onRetry,
114737
+ icon: /*#__PURE__*/ React.createElement(RefreshCw, {
114738
+ size: 14
114739
+ })
114740
+ }, "Retry") : undefined,
114741
+ showIcon: true
114742
+ });
114743
+
114744
+ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefresh, onRowClick, onCompare, compareIdsFromUrl, onCompareUrlChange, showFilters = true, showCompare = true, emptyMessage, title, pagination: serverPagination, onFiltersChange, onFetchEvaluationsByIds, errorRender })=>{
114706
114745
  const { theme } = useTheme$1();
114707
114746
  const [selectedAgents, setSelectedAgents] = React.useState([]);
114708
114747
  const [selectedRowKeys, setSelectedRowKeys] = React.useState([]);
114709
114748
  const [compareDrawerOpen, setCompareDrawerOpen] = React.useState(false);
114710
114749
  const [evaluationId1, setEvaluationId1] = React.useState(null);
114711
114750
  const [evaluationId2, setEvaluationId2] = React.useState(null);
114712
- // Sync drawer when compare param comes from URL
114713
- React.useEffect(()=>{
114714
- if (compareIdsFromUrl) {
114715
- setEvaluationId1(compareIdsFromUrl[0]);
114716
- setEvaluationId2(compareIdsFromUrl[1]);
114717
- setCompareDrawerOpen(true);
114718
- }
114719
- }, [
114720
- compareIdsFromUrl
114721
- ]);
114722
114751
  const [selectedEvaluation, setSelectedEvaluation] = React.useState(null);
114723
114752
  const [detailsDrawerOpen, setDetailsDrawerOpen] = React.useState(false);
114724
114753
  const [pageSize, setPageSize] = React.useState(50);
114725
114754
  const [selectedMetricFilter, setSelectedMetricFilter] = React.useState(null);
114755
+ const [drawerEvaluations, setDrawerEvaluations] = React.useState([]);
114756
+ const isServerPagination = !!serverPagination;
114726
114757
  const normalized = React.useMemo(()=>evaluations.map((e)=>isEvaluationDto(e) ? transformEvaluation(e) : e), [
114727
114758
  evaluations
114728
114759
  ]);
@@ -114771,6 +114802,63 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114771
114802
  selectedAgents,
114772
114803
  selectedMetricFilter
114773
114804
  ]);
114805
+ const tableDataSource = filteredEvaluations;
114806
+ const compareDrawerEvaluations = React.useMemo(()=>{
114807
+ if (drawerEvaluations.length === 0) return normalized;
114808
+ const byId = new Map(normalized.map((e)=>[
114809
+ e.evaluation_id,
114810
+ e
114811
+ ]));
114812
+ for (const e of drawerEvaluations){
114813
+ const id = e.evaluation_id ?? e.evaluation_id;
114814
+ if (id && !byId.has(id)) byId.set(id, e);
114815
+ }
114816
+ return Array.from(byId.values());
114817
+ }, [
114818
+ normalized,
114819
+ drawerEvaluations
114820
+ ]);
114821
+ // Sync drawer when compare param comes from URL
114822
+ React.useEffect(()=>{
114823
+ if (compareIdsFromUrl) {
114824
+ setEvaluationId1(compareIdsFromUrl[0]);
114825
+ setEvaluationId2(compareIdsFromUrl[1]);
114826
+ setCompareDrawerOpen(true);
114827
+ }
114828
+ }, [
114829
+ compareIdsFromUrl
114830
+ ]);
114831
+ // Fetch evaluations by ID for compare drawer when opened from URL (server pagination)
114832
+ React.useEffect(()=>{
114833
+ if (!compareDrawerOpen || !onFetchEvaluationsByIds || !evaluationId1 || !evaluationId2) {
114834
+ setDrawerEvaluations([]);
114835
+ return;
114836
+ }
114837
+ const ids = [
114838
+ evaluationId1,
114839
+ evaluationId2
114840
+ ];
114841
+ const inNormalized = ids.every((id)=>normalized.some((e)=>e.evaluation_id === id));
114842
+ if (inNormalized) {
114843
+ setDrawerEvaluations([]);
114844
+ return;
114845
+ }
114846
+ let cancelled = false;
114847
+ onFetchEvaluationsByIds(ids).then((fetched)=>{
114848
+ if (!cancelled) {
114849
+ setDrawerEvaluations(fetched);
114850
+ }
114851
+ });
114852
+ return ()=>{
114853
+ cancelled = true;
114854
+ };
114855
+ }, [
114856
+ compareDrawerOpen,
114857
+ evaluationId1,
114858
+ evaluationId2,
114859
+ normalized,
114860
+ onFetchEvaluationsByIds
114861
+ ]);
114774
114862
  // Handle row selection - limit to 2 rows
114775
114863
  const handleRowSelectionChange = (selectedKeys)=>{
114776
114864
  if (selectedKeys.length <= 2) {
@@ -114815,21 +114903,16 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114815
114903
  setSelectedEvaluation(null);
114816
114904
  };
114817
114905
  if (error) {
114818
- return /*#__PURE__*/ React.createElement("div", {
114819
- style: {
114820
- padding: "24px",
114821
- textAlign: "center"
114822
- }
114823
- }, /*#__PURE__*/ React.createElement("p", {
114824
- style: {
114825
- color: theme.colors.destructive
114826
- }
114827
- }, "Error loading evaluations: ", error), onRefresh && /*#__PURE__*/ React.createElement(Button$1, {
114828
- onClick: onRefresh,
114829
- icon: /*#__PURE__*/ React.createElement(RefreshCw, {
114830
- size: 14
114831
- })
114832
- }, "Retry"));
114906
+ if (errorRender) {
114907
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, errorRender({
114908
+ error,
114909
+ onRetry: onRefresh ?? undefined
114910
+ }));
114911
+ }
114912
+ return /*#__PURE__*/ React.createElement(EvaluationsErrorCard, {
114913
+ error: error,
114914
+ onRetry: onRefresh ?? undefined
114915
+ });
114833
114916
  }
114834
114917
  const columns = [
114835
114918
  {
@@ -114922,7 +115005,12 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114922
115005
  placeholder: "Filter by Agent",
114923
115006
  allowClear: true,
114924
115007
  value: selectedAgents,
114925
- onChange: setSelectedAgents,
115008
+ onChange: (v)=>{
115009
+ setSelectedAgents(v);
115010
+ if (isServerPagination && onFiltersChange) {
115011
+ onFiltersChange(v, selectedMetricFilter);
115012
+ }
115013
+ },
114926
115014
  style: {
114927
115015
  width: 200
114928
115016
  },
@@ -114934,7 +115022,13 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114934
115022
  placeholder: "Filter by Evaluator / Metric",
114935
115023
  allowClear: true,
114936
115024
  value: selectedMetricFilter ?? undefined,
114937
- onChange: (v)=>setSelectedMetricFilter(v ?? null),
115025
+ onChange: (v)=>{
115026
+ const next = v ?? null;
115027
+ setSelectedMetricFilter(next);
115028
+ if (isServerPagination && onFiltersChange) {
115029
+ onFiltersChange(selectedAgents, next);
115030
+ }
115031
+ },
114938
115032
  style: {
114939
115033
  width: 240
114940
115034
  },
@@ -114957,7 +115051,7 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114957
115051
  }
114958
115052
  }, emptyMessage ?? defaultEmptyMessage) : /*#__PURE__*/ React.createElement(ForwardTable, {
114959
115053
  columns: columns,
114960
- dataSource: filteredEvaluations,
115054
+ dataSource: tableDataSource,
114961
115055
  loading: loading,
114962
115056
  rowKey: "evaluation_id",
114963
115057
  rowSelection: showCompare ? {
@@ -114968,7 +115062,20 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114968
115062
  disabled: selectedRowKeys.length >= 2 && !selectedRowKeys.includes(record.evaluation_id)
114969
115063
  })
114970
115064
  } : undefined,
114971
- pagination: filteredEvaluations.length <= pageSize ? false : {
115065
+ pagination: isServerPagination && serverPagination ? {
115066
+ total: serverPagination.total,
115067
+ current: serverPagination.current,
115068
+ pageSize: serverPagination.pageSize,
115069
+ showSizeChanger: true,
115070
+ showTotal: (total)=>`Total ${total} evaluations`,
115071
+ pageSizeOptions: [
115072
+ "10",
115073
+ "20",
115074
+ "50",
115075
+ "100"
115076
+ ],
115077
+ onChange: (page, size)=>serverPagination.onPageChange(page, size ?? serverPagination.pageSize)
115078
+ } : tableDataSource.length <= pageSize ? false : {
114972
115079
  pageSize,
114973
115080
  showSizeChanger: true,
114974
115081
  showTotal: (total)=>`Total ${total} evaluations`,
@@ -115004,7 +115111,7 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
115004
115111
  onClose: handleDrawerClose,
115005
115112
  evaluationId1: evaluationId1,
115006
115113
  evaluationId2: evaluationId2,
115007
- evaluations: normalized,
115114
+ evaluations: compareDrawerEvaluations,
115008
115115
  onEvaluationId1Change: onCompareUrlChange ? handleEvaluationId1Change : setEvaluationId1,
115009
115116
  onEvaluationId2Change: onCompareUrlChange ? handleEvaluationId2Change : setEvaluationId2
115010
115117
  }), !onRowClick && /*#__PURE__*/ React.createElement(EvaluationDetailsDrawer, {
@@ -120314,6 +120421,7 @@ exports.EvaluationDetailsDrawer = EvaluationDetailsDrawer;
120314
120421
  exports.EvaluationsCompareDrawer = EvaluationsCompareDrawer;
120315
120422
  exports.EvaluationsComparePage = EvaluationsComparePage;
120316
120423
  exports.EvaluationsCompareView = EvaluationsCompareView;
120424
+ exports.EvaluationsErrorCard = EvaluationsErrorCard;
120317
120425
  exports.EvaluationsTable = EvaluationsTable;
120318
120426
  exports.EvaluatorResult = EvaluatorResult;
120319
120427
  exports.GlobalStyles = GlobalStyles;
package/dist/esm/index.js CHANGED
@@ -114682,27 +114682,58 @@ const EvaluationDetailsDrawer = ({ evaluation, open, onClose, getEvaluatorResult
114682
114682
  })))));
114683
114683
  };
114684
114684
 
114685
- const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefresh, onRowClick, onCompare, compareIdsFromUrl, onCompareUrlChange, showFilters = true, showCompare = true, emptyMessage, title })=>{
114685
+ const GITHUB_URL = "https://github.com/RailtownAI/railtracks/";
114686
+ const EvaluationsErrorCard = ({ error, onRetry })=>/*#__PURE__*/ React__default.createElement(Alert, {
114687
+ type: "error",
114688
+ title: "Error loading evaluations",
114689
+ description: /*#__PURE__*/ React__default.createElement("div", {
114690
+ style: {
114691
+ display: "flex",
114692
+ flexDirection: "column",
114693
+ gap: "8px"
114694
+ }
114695
+ }, /*#__PURE__*/ React__default.createElement("span", null, error), /*#__PURE__*/ React__default.createElement(Typography.Text, {
114696
+ type: "secondary",
114697
+ style: {
114698
+ fontSize: "13px"
114699
+ }
114700
+ }, "Need help?", " ", /*#__PURE__*/ React__default.createElement(Typography.Link, {
114701
+ href: GITHUB_URL,
114702
+ target: "_blank",
114703
+ rel: "noopener noreferrer"
114704
+ }, "GitHub"), " · ", /*#__PURE__*/ React__default.createElement(Typography.Link, {
114705
+ href: `${GITHUB_URL}discussions`,
114706
+ target: "_blank",
114707
+ rel: "noopener noreferrer"
114708
+ }, "Discussions"), " · ", /*#__PURE__*/ React__default.createElement(Typography.Link, {
114709
+ href: `${GITHUB_URL}issues`,
114710
+ target: "_blank",
114711
+ rel: "noopener noreferrer"
114712
+ }, "Report issue"))),
114713
+ action: onRetry ? /*#__PURE__*/ React__default.createElement(Button$1, {
114714
+ size: "small",
114715
+ danger: true,
114716
+ onClick: onRetry,
114717
+ icon: /*#__PURE__*/ React__default.createElement(RefreshCw, {
114718
+ size: 14
114719
+ })
114720
+ }, "Retry") : undefined,
114721
+ showIcon: true
114722
+ });
114723
+
114724
+ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefresh, onRowClick, onCompare, compareIdsFromUrl, onCompareUrlChange, showFilters = true, showCompare = true, emptyMessage, title, pagination: serverPagination, onFiltersChange, onFetchEvaluationsByIds, errorRender })=>{
114686
114725
  const { theme } = useTheme$1();
114687
114726
  const [selectedAgents, setSelectedAgents] = useState([]);
114688
114727
  const [selectedRowKeys, setSelectedRowKeys] = useState([]);
114689
114728
  const [compareDrawerOpen, setCompareDrawerOpen] = useState(false);
114690
114729
  const [evaluationId1, setEvaluationId1] = useState(null);
114691
114730
  const [evaluationId2, setEvaluationId2] = useState(null);
114692
- // Sync drawer when compare param comes from URL
114693
- useEffect(()=>{
114694
- if (compareIdsFromUrl) {
114695
- setEvaluationId1(compareIdsFromUrl[0]);
114696
- setEvaluationId2(compareIdsFromUrl[1]);
114697
- setCompareDrawerOpen(true);
114698
- }
114699
- }, [
114700
- compareIdsFromUrl
114701
- ]);
114702
114731
  const [selectedEvaluation, setSelectedEvaluation] = useState(null);
114703
114732
  const [detailsDrawerOpen, setDetailsDrawerOpen] = useState(false);
114704
114733
  const [pageSize, setPageSize] = useState(50);
114705
114734
  const [selectedMetricFilter, setSelectedMetricFilter] = useState(null);
114735
+ const [drawerEvaluations, setDrawerEvaluations] = useState([]);
114736
+ const isServerPagination = !!serverPagination;
114706
114737
  const normalized = useMemo(()=>evaluations.map((e)=>isEvaluationDto(e) ? transformEvaluation(e) : e), [
114707
114738
  evaluations
114708
114739
  ]);
@@ -114751,6 +114782,63 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114751
114782
  selectedAgents,
114752
114783
  selectedMetricFilter
114753
114784
  ]);
114785
+ const tableDataSource = filteredEvaluations;
114786
+ const compareDrawerEvaluations = useMemo(()=>{
114787
+ if (drawerEvaluations.length === 0) return normalized;
114788
+ const byId = new Map(normalized.map((e)=>[
114789
+ e.evaluation_id,
114790
+ e
114791
+ ]));
114792
+ for (const e of drawerEvaluations){
114793
+ const id = e.evaluation_id ?? e.evaluation_id;
114794
+ if (id && !byId.has(id)) byId.set(id, e);
114795
+ }
114796
+ return Array.from(byId.values());
114797
+ }, [
114798
+ normalized,
114799
+ drawerEvaluations
114800
+ ]);
114801
+ // Sync drawer when compare param comes from URL
114802
+ useEffect(()=>{
114803
+ if (compareIdsFromUrl) {
114804
+ setEvaluationId1(compareIdsFromUrl[0]);
114805
+ setEvaluationId2(compareIdsFromUrl[1]);
114806
+ setCompareDrawerOpen(true);
114807
+ }
114808
+ }, [
114809
+ compareIdsFromUrl
114810
+ ]);
114811
+ // Fetch evaluations by ID for compare drawer when opened from URL (server pagination)
114812
+ useEffect(()=>{
114813
+ if (!compareDrawerOpen || !onFetchEvaluationsByIds || !evaluationId1 || !evaluationId2) {
114814
+ setDrawerEvaluations([]);
114815
+ return;
114816
+ }
114817
+ const ids = [
114818
+ evaluationId1,
114819
+ evaluationId2
114820
+ ];
114821
+ const inNormalized = ids.every((id)=>normalized.some((e)=>e.evaluation_id === id));
114822
+ if (inNormalized) {
114823
+ setDrawerEvaluations([]);
114824
+ return;
114825
+ }
114826
+ let cancelled = false;
114827
+ onFetchEvaluationsByIds(ids).then((fetched)=>{
114828
+ if (!cancelled) {
114829
+ setDrawerEvaluations(fetched);
114830
+ }
114831
+ });
114832
+ return ()=>{
114833
+ cancelled = true;
114834
+ };
114835
+ }, [
114836
+ compareDrawerOpen,
114837
+ evaluationId1,
114838
+ evaluationId2,
114839
+ normalized,
114840
+ onFetchEvaluationsByIds
114841
+ ]);
114754
114842
  // Handle row selection - limit to 2 rows
114755
114843
  const handleRowSelectionChange = (selectedKeys)=>{
114756
114844
  if (selectedKeys.length <= 2) {
@@ -114795,21 +114883,16 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114795
114883
  setSelectedEvaluation(null);
114796
114884
  };
114797
114885
  if (error) {
114798
- return /*#__PURE__*/ React__default.createElement("div", {
114799
- style: {
114800
- padding: "24px",
114801
- textAlign: "center"
114802
- }
114803
- }, /*#__PURE__*/ React__default.createElement("p", {
114804
- style: {
114805
- color: theme.colors.destructive
114806
- }
114807
- }, "Error loading evaluations: ", error), onRefresh && /*#__PURE__*/ React__default.createElement(Button$1, {
114808
- onClick: onRefresh,
114809
- icon: /*#__PURE__*/ React__default.createElement(RefreshCw, {
114810
- size: 14
114811
- })
114812
- }, "Retry"));
114886
+ if (errorRender) {
114887
+ return /*#__PURE__*/ React__default.createElement(React__default.Fragment, null, errorRender({
114888
+ error,
114889
+ onRetry: onRefresh ?? undefined
114890
+ }));
114891
+ }
114892
+ return /*#__PURE__*/ React__default.createElement(EvaluationsErrorCard, {
114893
+ error: error,
114894
+ onRetry: onRefresh ?? undefined
114895
+ });
114813
114896
  }
114814
114897
  const columns = [
114815
114898
  {
@@ -114902,7 +114985,12 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114902
114985
  placeholder: "Filter by Agent",
114903
114986
  allowClear: true,
114904
114987
  value: selectedAgents,
114905
- onChange: setSelectedAgents,
114988
+ onChange: (v)=>{
114989
+ setSelectedAgents(v);
114990
+ if (isServerPagination && onFiltersChange) {
114991
+ onFiltersChange(v, selectedMetricFilter);
114992
+ }
114993
+ },
114906
114994
  style: {
114907
114995
  width: 200
114908
114996
  },
@@ -114914,7 +115002,13 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114914
115002
  placeholder: "Filter by Evaluator / Metric",
114915
115003
  allowClear: true,
114916
115004
  value: selectedMetricFilter ?? undefined,
114917
- onChange: (v)=>setSelectedMetricFilter(v ?? null),
115005
+ onChange: (v)=>{
115006
+ const next = v ?? null;
115007
+ setSelectedMetricFilter(next);
115008
+ if (isServerPagination && onFiltersChange) {
115009
+ onFiltersChange(selectedAgents, next);
115010
+ }
115011
+ },
114918
115012
  style: {
114919
115013
  width: 240
114920
115014
  },
@@ -114937,7 +115031,7 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114937
115031
  }
114938
115032
  }, emptyMessage ?? defaultEmptyMessage) : /*#__PURE__*/ React__default.createElement(ForwardTable, {
114939
115033
  columns: columns,
114940
- dataSource: filteredEvaluations,
115034
+ dataSource: tableDataSource,
114941
115035
  loading: loading,
114942
115036
  rowKey: "evaluation_id",
114943
115037
  rowSelection: showCompare ? {
@@ -114948,7 +115042,20 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114948
115042
  disabled: selectedRowKeys.length >= 2 && !selectedRowKeys.includes(record.evaluation_id)
114949
115043
  })
114950
115044
  } : undefined,
114951
- pagination: filteredEvaluations.length <= pageSize ? false : {
115045
+ pagination: isServerPagination && serverPagination ? {
115046
+ total: serverPagination.total,
115047
+ current: serverPagination.current,
115048
+ pageSize: serverPagination.pageSize,
115049
+ showSizeChanger: true,
115050
+ showTotal: (total)=>`Total ${total} evaluations`,
115051
+ pageSizeOptions: [
115052
+ "10",
115053
+ "20",
115054
+ "50",
115055
+ "100"
115056
+ ],
115057
+ onChange: (page, size)=>serverPagination.onPageChange(page, size ?? serverPagination.pageSize)
115058
+ } : tableDataSource.length <= pageSize ? false : {
114952
115059
  pageSize,
114953
115060
  showSizeChanger: true,
114954
115061
  showTotal: (total)=>`Total ${total} evaluations`,
@@ -114984,7 +115091,7 @@ const EvaluationsTable = ({ evaluations, loading = false, error = null, onRefres
114984
115091
  onClose: handleDrawerClose,
114985
115092
  evaluationId1: evaluationId1,
114986
115093
  evaluationId2: evaluationId2,
114987
- evaluations: normalized,
115094
+ evaluations: compareDrawerEvaluations,
114988
115095
  onEvaluationId1Change: onCompareUrlChange ? handleEvaluationId1Change : setEvaluationId1,
114989
115096
  onEvaluationId2Change: onCompareUrlChange ? handleEvaluationId2Change : setEvaluationId2
114990
115097
  }), !onRowClick && /*#__PURE__*/ React__default.createElement(EvaluationDetailsDrawer, {
@@ -120284,4 +120391,4 @@ const GlobalStyles = ()=>{
120284
120391
  return getSafeColor(props.theme, path, fallback);
120285
120392
  };
120286
120393
 
120287
- export { AgenticFlowVisualizer, AnthropicIcon, AppleIcon, Badge, Drawer, Edge, EvaluationDetailsDrawer, EvaluationsCompareDrawer, EvaluationsComparePage, EvaluationsCompareView, EvaluationsTable, EvaluatorResult, GlobalStyles, GoogleIcon, JsonTreeViewer, Node$1 as Node, OllamaIcon, OpenAIIcon, SafeThemeProvider, SessionDetails, Sheet, ThemeProvider, Timeline, Visualizer, calculateAutoLayout, cn, conditionalStyle, createSafeTheme, darkTheme, defaultTheme$1 as defaultTheme, detectContentType, evaluationsHaveSameMetrics, formatCurrency, formatDateFriendly, formatDateRelative, formatDateShort, formatDuration, formatLatency, formatMetricValue$1 as formatMetricValue, formatNumberWithCommas, formatToolCalls, getColor, getSafeColor, getSafeSpacing, getSafeThemeValue, getSpacing, getStatusColor, isEvaluationDto, lightTheme, safeStyled, safeThemeColor, safeThemeSpacing, safeThemeValue, toTitleCase, transformEvaluation, truncateText, useComponentTheme, useSafeTheme, useTheme$1 as useTheme, useThemeValue };
120394
+ export { AgenticFlowVisualizer, AnthropicIcon, AppleIcon, Badge, Drawer, Edge, EvaluationDetailsDrawer, EvaluationsCompareDrawer, EvaluationsComparePage, EvaluationsCompareView, EvaluationsErrorCard, EvaluationsTable, EvaluatorResult, GlobalStyles, GoogleIcon, JsonTreeViewer, Node$1 as Node, OllamaIcon, OpenAIIcon, SafeThemeProvider, SessionDetails, Sheet, ThemeProvider, Timeline, Visualizer, calculateAutoLayout, cn, conditionalStyle, createSafeTheme, darkTheme, defaultTheme$1 as defaultTheme, detectContentType, evaluationsHaveSameMetrics, formatCurrency, formatDateFriendly, formatDateRelative, formatDateShort, formatDuration, formatLatency, formatMetricValue$1 as formatMetricValue, formatNumberWithCommas, formatToolCalls, getColor, getSafeColor, getSafeSpacing, getSafeThemeValue, getSpacing, getStatusColor, isEvaluationDto, lightTheme, safeStyled, safeThemeColor, safeThemeSpacing, safeThemeValue, toTitleCase, transformEvaluation, truncateText, useComponentTheme, useSafeTheme, useTheme$1 as useTheme, useThemeValue };
@@ -14,6 +14,13 @@
14
14
  import React from "react";
15
15
  import type { Evaluation } from "../pages/evaluations.types";
16
16
  import type { Evaluation as EvaluationDto } from "../../dto/Evaluation";
17
+ /** Server-side pagination config. When provided, table uses server pagination instead of client. */
18
+ export interface EvaluationsTablePagination {
19
+ total: number;
20
+ current: number;
21
+ pageSize: number;
22
+ onPageChange: (page: number, pageSize: number) => void;
23
+ }
17
24
  export interface EvaluationsTableProps {
18
25
  /** Evaluation DTOs from your API. Pre-transformed data is also accepted. */
19
26
  evaluations: (Evaluation | EvaluationDto)[];
@@ -31,5 +38,16 @@ export interface EvaluationsTableProps {
31
38
  emptyMessage?: React.ReactNode;
32
39
  /** Optional title rendered to the left of the toolbar (e.g. "Evaluations") */
33
40
  title?: React.ReactNode;
41
+ /** Server-side pagination. When provided, table uses server pagination instead of client. */
42
+ pagination?: EvaluationsTablePagination;
43
+ /** When server pagination, filter changes are passed up for platform to refetch. */
44
+ onFiltersChange?: (agents: string[], metricFilter: string | null) => void;
45
+ /** When server pagination, fetch evaluations by ID for compare drawer (e.g. from URL). */
46
+ onFetchEvaluationsByIds?: (ids: string[]) => Promise<(Evaluation | EvaluationDto)[]>;
47
+ /** Custom error UI. When provided, overrides the default EvaluationsErrorCard. */
48
+ errorRender?: (props: {
49
+ error: string;
50
+ onRetry?: () => void;
51
+ }) => React.ReactNode;
34
52
  }
35
53
  export declare const EvaluationsTable: React.FC<EvaluationsTableProps>;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ /** Default error card shown when evaluations fail to load and no errorRender is provided. */
3
+ export interface EvaluationsErrorCardProps {
4
+ error: string;
5
+ onRetry?: () => void;
6
+ }
7
+ export declare const EvaluationsErrorCard: React.FC<EvaluationsErrorCardProps>;
@@ -2,6 +2,9 @@ export { default as AgenticFlowVisualizer } from "./components/AgenticFlowVisual
2
2
  export { default as Visualizer } from "./components/Visualizer";
3
3
  export { SessionDetails } from "./agenthub/pages/session-details";
4
4
  export { EvaluationsTable } from "./agenthub/components/EvaluationsTable";
5
+ export type { EvaluationsTableProps, EvaluationsTablePagination } from "./agenthub/components/EvaluationsTable";
6
+ export { EvaluationsErrorCard } from "./agenthub/components/EvaluationsTableErrorCard";
7
+ export type { EvaluationsErrorCardProps } from "./agenthub/components/EvaluationsTableErrorCard";
5
8
  export { EvaluationsCompareView } from "./agenthub/components/EvaluationsCompareView";
6
9
  export type { EvaluationsCompareViewProps } from "./agenthub/components/EvaluationsCompareView";
7
10
  export { EvaluationsCompareDrawer } from "./agenthub/pages/evaluations-compare-drawer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railtownai/railtracks-visualizer",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "license": "MIT",
5
5
  "author": "Railtown AI",
6
6
  "description": "A visualizer for Railtracks agentic flows",