@@ -119,13 +119,15 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
119119 const [ cypherOnly , setCypherOnly ] = useState < boolean > ( false ) ;
120120 const [ udfList , setUdfList ] = useState < UDFEntry [ ] > ( [ ] ) ;
121121 const [ selectedUdf , setSelectedUdf ] = useState < UDFEntryWithCode > ( ) ;
122- const [ columnWidth , setColumnWidth ] = useState < number > ( 25 ) ;
123- const [ rowHeight , setRowHeight ] = useState < number > ( 40 ) ;
124- const [ newColumnWidth , setNewColumnWidth ] = useState < number > ( 25 ) ;
125- const [ newRowHeight , setNewRowHeight ] = useState < number > ( 40 ) ;
126- const [ newRowHeightExpandMultiple , setNewRowHeightExpandMultiple ] = useState < number > ( 3 ) ;
127- const [ rowHeightExpandMultiple , setRowHeightExpandMultiple ] = useState < number > ( 3 ) ;
122+ const [ columnWidth , setColumnWidth ] = useState < number > ( 0 ) ;
123+ const [ rowHeight , setRowHeight ] = useState < number > ( 0 ) ;
124+ const [ newColumnWidth , setNewColumnWidth ] = useState < number > ( 0 ) ;
125+ const [ newRowHeight , setNewRowHeight ] = useState < number > ( 0 ) ;
126+ const [ newRowHeightExpandMultiple , setNewRowHeightExpandMultiple ] = useState < number > ( 0 ) ;
127+ const [ rowHeightExpandMultiple , setRowHeightExpandMultiple ] = useState < number > ( 0 ) ;
128128 const [ showUDF , setShowUDF ] = useState < boolean > ( true ) ;
129+ const [ maxItemsForSearch , setMaxItemsForSearch ] = useState < number > ( 0 ) ;
130+ const [ newMaxItemsForSearch , setNewMaxItemsForSearch ] = useState < number > ( 0 ) ;
129131
130132 const replayTutorial = useCallback ( ( ) => {
131133 router . push ( "/graph" ) ;
@@ -149,7 +151,7 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
149151 captionsKeysSettings : { newCaptionsKeys, setNewCaptionsKeys } ,
150152 showPropertyKeyPrefixSettings : { newShowPropertyKeyPrefix, setNewShowPropertyKeyPrefix } ,
151153 chatSettings : { newSecretKey, setNewSecretKey, newModel, setNewModel, newMaxSavedMessages, setNewMaxSavedMessages, newCypherOnly, setNewCypherOnly } ,
152- graphInfo : { newRefreshInterval, setNewRefreshInterval } ,
154+ graphInfo : { newRefreshInterval, setNewRefreshInterval, newMaxItemsForSearch , setNewMaxItemsForSearch } ,
153155 tableViewSettings : { newColumnWidth, setNewColumnWidth, newRowHeight, setNewRowHeight, newRowHeightExpandMultiple, setNewRowHeightExpandMultiple }
154156 } ,
155157 settings : {
@@ -161,7 +163,7 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
161163 captionsKeysSettings : { captionsKeys, setCaptionsKeys } ,
162164 showPropertyKeyPrefixSettings : { showPropertyKeyPrefix, setShowPropertyKeyPrefix } ,
163165 chatSettings : { secretKey, setSecretKey, model, setModel, maxSavedMessages, setMaxSavedMessages, cypherOnly, setCypherOnly } ,
164- graphInfo : { showMemoryUsage, refreshInterval, setRefreshInterval } ,
166+ graphInfo : { showMemoryUsage, refreshInterval, setRefreshInterval, maxItemsForSearch , setMaxItemsForSearch } ,
165167 tableViewSettings : { columnWidth, setColumnWidth, rowHeight, setRowHeight, rowHeightExpandMultiple, setRowHeightExpandMultiple }
166168 } ,
167169 hasChanges,
@@ -184,6 +186,7 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
184186 localStorage . setItem ( "columnWidth" , newColumnWidth . toString ( ) ) ;
185187 localStorage . setItem ( "rowHeight" , newRowHeight . toString ( ) ) ;
186188 localStorage . setItem ( "rowHeightExpandMultiple" , newRowHeightExpandMultiple . toString ( ) ) ;
189+ localStorage . setItem ( "maxItemsForSearch" , newMaxItemsForSearch . toString ( ) ) ;
187190
188191 // Only encrypt and save secret key if it has changed
189192 if ( newSecretKey !== secretKey ) {
@@ -241,6 +244,7 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
241244 setColumnWidth ( newColumnWidth ) ;
242245 setRowHeight ( newRowHeight ) ;
243246 setRowHeightExpandMultiple ( newRowHeightExpandMultiple ) ;
247+ setMaxItemsForSearch ( newMaxItemsForSearch ) ;
244248 // Reset has changes
245249 setHasChanges ( false ) ;
246250
@@ -266,10 +270,11 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
266270 setNewColumnWidth ( columnWidth ) ;
267271 setNewRowHeight ( rowHeight ) ;
268272 setNewRowHeightExpandMultiple ( rowHeightExpandMultiple ) ;
273+ setNewMaxItemsForSearch ( maxItemsForSearch ) ;
269274 setHasChanges ( false ) ;
270275 }
271276 // eslint-disable-next-line react-hooks/exhaustive-deps
272- } ) , [ contentPersistence , defaultQuery , hasChanges , lastLimit , limit , model , newContentPersistence , newDefaultQuery , newLimit , newModel , newRefreshInterval , newRunDefaultQuery , newSecretKey , newTimeout , refreshInterval , runDefaultQuery , secretKey , timeout , replayTutorial , tutorialOpen , showMemoryUsage , newMaxSavedMessages , maxSavedMessages , newCaptionsKeys , captionsKeys , newShowPropertyKeyPrefix , showPropertyKeyPrefix , newCypherOnly , cypherOnly , newColumnWidth , columnWidth , newRowHeight , rowHeight , newRowHeightExpandMultiple , rowHeightExpandMultiple , toast ] ) ;
277+ } ) , [ contentPersistence , defaultQuery , hasChanges , lastLimit , limit , model , newContentPersistence , newDefaultQuery , newLimit , newModel , newRefreshInterval , newRunDefaultQuery , newSecretKey , newTimeout , refreshInterval , runDefaultQuery , secretKey , timeout , replayTutorial , tutorialOpen , showMemoryUsage , newMaxSavedMessages , maxSavedMessages , newCaptionsKeys , captionsKeys , newShowPropertyKeyPrefix , showPropertyKeyPrefix , newCypherOnly , cypherOnly , newColumnWidth , columnWidth , newRowHeight , rowHeight , newRowHeightExpandMultiple , rowHeightExpandMultiple , newMaxItemsForSearch , maxItemsForSearch , toast ] ) ;
273278
274279 const historyQueryContext = useMemo ( ( ) => ( {
275280 historyQuery,
@@ -629,7 +634,7 @@ function ProvidersWithSession({ children }: { children: React.ReactNode }) {
629634 setColumnWidth ( parseInt ( localStorage . getItem ( "columnWidth" ) || "25" , 10 ) ) ;
630635 setRowHeight ( parseInt ( localStorage . getItem ( "rowHeight" ) || "40" , 10 ) ) ;
631636 setRowHeightExpandMultiple ( parseInt ( localStorage . getItem ( "rowHeightExpandMultiple" ) || "3" , 10 ) ) ;
632-
637+ setMaxItemsForSearch ( parseInt ( localStorage . getItem ( "maxItemsForSearch" ) || "20" , 10 ) ) ;
633638 // Decrypt secret key if encrypted, or migrate plain text keys to encrypted format
634639 const storedSecretKey = localStorage . getItem ( "secretKey" ) || "" ;
635640 if ( storedSecretKey ) {
0 commit comments