@@ -15,7 +15,9 @@ import { TabHiddenColumns } from "./tab_hidden_columns";
15
15
import { TabSelectedItems } from "./tab_selected_items" ;
16
16
import { History } from '../../utils/history' ;
17
17
import { FF_DEV_1470 , FF_LOPS_12 , isFF } from "../../utils/feature-flags" ;
18
- import { CustomJSON , StringOrNumberID } from "../types" ;
18
+ import { CustomJSON , StringOrNumberID , ThresholdType } from "../types" ;
19
+
20
+ const DEFAULT_THRESHOLD = { min : 0 , max : 1 } ;
19
21
20
22
export const Tab = types
21
23
. model ( "View" , {
@@ -51,6 +53,7 @@ export const Tab = types
51
53
editable : true ,
52
54
deletable : true ,
53
55
semantic_search : types . optional ( types . array ( CustomJSON ) , [ ] ) ,
56
+ threshold : types . optional ( ThresholdType , DEFAULT_THRESHOLD ) ,
54
57
} )
55
58
. volatile ( ( ) => {
56
59
const defaultWidth = getComputedStyle ( document . body ) . getPropertyValue ( "--menu-sidebar-width" ) . replace ( "px" , "" ) . trim ( ) ;
@@ -215,6 +218,7 @@ export const Tab = types
215
218
columnsDisplayType : self . columnsDisplayType . toPOJO ( ) ,
216
219
gridWidth : self . gridWidth ,
217
220
semantic_search : self . semantic_search ?. toJSON ( ) ?? [ ] ,
221
+ threshold : self . threshold ?. toJSON ( ) ?? DEFAULT_THRESHOLD ,
218
222
} ;
219
223
220
224
if ( self . saved || apiVersion === 1 ) {
@@ -305,6 +309,11 @@ export const Tab = types
305
309
self . semantic_search = semanticSearchList ?? [ ] ;
306
310
return self . save ( ) ;
307
311
} ,
312
+
313
+ setSemanticSearchThreshold ( min , max ) {
314
+ self . threshold = { min, max } ;
315
+ return self . save ( ) ;
316
+ } ,
308
317
309
318
selectAll ( ) {
310
319
self . selected . toggleSelectedAll ( ) ;
0 commit comments