-
[OPIK-2647] [FE] Fix truncated export data using non-truncated data fetching (#3614)
发布于
2025-10-10 07:49:40 +00:00 - [OPIK-2647] [FE] Fix truncated export data using disabled hooks with refetch callbacks
- Export and Add to Dataset now fetch full non-truncated data
- Added second disabled useTracesOrSpansList hook with truncate: false
- Refactored ExportToButton to support async data fetching with proper error handling
- Updated TracesActionsPanel and AddToDatasetDialog to use getDataForExport callback
- Properly typed React Query response for type inference
- Preserved original validation UX in AddToDatasetDialog
- Extract and display real server error messages to users
- Revision 2: Apply same pattern to Threads page for non-truncated export data
- Added second disabled useThreadList hook with truncate: false
- Updated ThreadsActionsPanel to use getDataForExport callback
- Updated ThreadsTab to create getDataForExport callback with refetch
- Export UseThreadListResponse type for type inference
- Threads export and annotation queue now fetch full data
- Revision 3: Apply same pattern to Dataset Items page for non-truncated export data
- Added second disabled useDatasetItemsList hook with truncate: false
- Updated DatasetItemsActionsPanel to use getDataForExport callback
- Updated DatasetItemsPage to create getDataForExport callback with refetch
- Dataset items export now fetches full non-truncated data
- Revision 4: Fix getDataForExport to only return selected rows
- Remove fallback to all rows when no selection exists
- Buttons are disabled when nothing is selected anyway
- More consistent and predictable behavior
- Applied to Traces, Threads, and Dataset Items pages
- Revision 5: Apply same pattern to Compare Experiments page for non-truncated export data
- Added second disabled useCompareExperimentsList hook with truncate: false
- Updated CompareExperimentsActionsPanel to use getDataForExport callback
- Updated ExperimentItemsTab to create getDataForExport callback with refetch
- Experiment comparison export now fetches full non-truncated data
- Only selected rows are exported
- Revision 6: Remove redundant comment that states the obvious
- Removed '// Hook for fetching non-truncated data for export' comment
- Code is self-documenting: truncate: false and enabled: false clearly show intent
- Follows clean code guideline: don't comment what the code does
- Revision 7: Add missing truncate: false to threads export in ExportAnnotatedDataButton
- The useThreadsList hook was missing truncate: false parameter
- useTracesList already had it, now both are consistent
- Ensures annotation queue exports fetch full non-truncated thread data
-
Revision 2: Fix TypeScript errors in AddToDropdown usage
-
Revision 3: Use isObjectSpan utility instead of inline type check
下载附件