File tree Expand file tree Collapse file tree 3 files changed +24
-15
lines changed Expand file tree Collapse file tree 3 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @hyperdx/app " : patch
3+ ---
4+
5+ fix: memoize inputs to fix text input performance
Original file line number Diff line number Diff line change @@ -1208,9 +1208,12 @@ function DBSearchPage() {
12081208 ) ;
12091209 // Parse the orderBy string into a SortingState. We need the string
12101210 // version in other places so we keep this parser separate.
1211- const orderByConfig = parseAsSortingStateString . parse (
1212- searchedConfig . orderBy ?? '' ,
1213- ) ;
1211+ const initialSortBy = useMemo ( ( ) => {
1212+ const orderBy = parseAsSortingStateString . parse (
1213+ searchedConfig . orderBy ?? '' ,
1214+ ) ;
1215+ return orderBy ? [ orderBy ] : [ ] ;
1216+ } , [ searchedConfig . orderBy ] ) ;
12141217
12151218 const handleTimeRangeSelect = useCallback (
12161219 ( d1 : Date , d2 : Date ) => {
@@ -1824,7 +1827,7 @@ function DBSearchPage() {
18241827 denoiseResults = { denoiseResults }
18251828 collapseAllRows = { collapseAllRows }
18261829 onSortingChange = { onSortingChange }
1827- initialSortBy = { orderByConfig ? [ orderByConfig ] : [ ] }
1830+ initialSortBy = { initialSortBy }
18281831 />
18291832 ) }
18301833 </ >
Original file line number Diff line number Diff line change @@ -74,6 +74,17 @@ export default function DBSqlRowTableWithSideBar({
7474 setRowId ( null ) ;
7575 setRowSource ( null ) ;
7676 } , [ setRowId , setRowSource ] ) ;
77+ const renderRowDetails = useCallback (
78+ ( r : { [ key : string ] : unknown } ) => {
79+ if ( ! sourceData ) {
80+ return < div className = "p-3 text-muted" > Loading...</ div > ;
81+ }
82+ return (
83+ < RowOverviewPanelWrapper source = { sourceData } rowId = { r . id as string } />
84+ ) ;
85+ } ,
86+ [ sourceData ] ,
87+ ) ;
7788
7889 return (
7990 < RowSidePanelContext . Provider value = { context ?? { } } >
@@ -97,17 +108,7 @@ export default function DBSqlRowTableWithSideBar({
97108 onSortingChange = { onSortingChange }
98109 denoiseResults = { denoiseResults }
99110 initialSortBy = { initialSortBy }
100- renderRowDetails = { r => {
101- if ( ! sourceData ) {
102- return < div className = "p-3 text-muted" > Loading...</ div > ;
103- }
104- return (
105- < RowOverviewPanelWrapper
106- source = { sourceData }
107- rowId = { r . id as string }
108- />
109- ) ;
110- } }
111+ renderRowDetails = { renderRowDetails }
111112 onScroll = { onScroll }
112113 onError = { onError }
113114 onExpandedRowsChange = { onExpandedRowsChange }
You can’t perform that action at this time.
0 commit comments