@@ -9,8 +9,7 @@ import { TextButton as UiTextButton } from '@ui/components/editor/common/TextBut
99import { Textarea as UiTextarea } from '@ui/components/editor/common/Textarea'
1010import {
1111 CHECKPOINT_DEFAULT_LIFESPAN ,
12- DEFAULT_CONTEXT_SIZE_WARNING_THRESHOLD ,
13- LIMIT_SEMANTIC_SEARCH_RESULTS
12+ DEFAULT_CONTEXT_SIZE_WARNING_THRESHOLD
1413} from '@/constants/values'
1514import { use_translation } from '../../i18n/use-translation'
1615import { NavItem } from '../Home'
@@ -21,7 +20,6 @@ type ClearChecksBehavior = 'ignore-open-editors' | 'uncheck-all'
2120
2221type Props = {
2322 context_size_warning_threshold : number
24- limit_semantic_search_results : number
2523 are_automatic_checkpoints_disabled : boolean
2624 synchronize_edit_format_between_modes : boolean
2725 send_with_shift_enter : boolean
@@ -36,7 +34,6 @@ type Props = {
3634 on_context_size_warning_threshold_change : (
3735 threshold : number | undefined
3836 ) => void
39- on_limit_semantic_search_results_change : ( limit : number | undefined ) => void
4037 on_clear_checks_in_workspace_behavior_change : (
4138 value : ClearChecksBehavior
4239 ) => void
@@ -79,18 +76,12 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
7976 const { t } = use_translation ( )
8077 const [ context_size_warning_threshold , set_context_size_warning_threshold ] =
8178 useState < number > ( )
82- const [ limit_semantic_search_results , set_limit_semantic_search_results ] =
83- useState < number > ( )
8479 const [ checkpoint_lifespan , set_checkpoint_lifespan ] = useState < number > ( )
8580
8681 useEffect ( ( ) => {
8782 set_context_size_warning_threshold ( props . context_size_warning_threshold )
8883 } , [ props . context_size_warning_threshold ] )
8984
90- useEffect ( ( ) => {
91- set_limit_semantic_search_results ( props . limit_semantic_search_results )
92- } , [ props . limit_semantic_search_results ] )
93-
9485 useEffect ( ( ) => {
9586 set_checkpoint_lifespan ( props . checkpoint_lifespan )
9687 } , [ props . checkpoint_lifespan ] )
@@ -111,17 +102,6 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
111102 }
112103 }
113104
114- const handle_limit_semantic_search_results_blur = ( ) => {
115- if ( limit_semantic_search_results && limit_semantic_search_results > 0 ) {
116- props . on_limit_semantic_search_results_change (
117- limit_semantic_search_results
118- )
119- } else {
120- props . on_limit_semantic_search_results_change ( undefined )
121- set_limit_semantic_search_results ( LIMIT_SEMANTIC_SEARCH_RESULTS )
122- }
123- }
124-
125105 const handle_checkpoint_lifespan_blur = ( ) => {
126106 if ( checkpoint_lifespan && checkpoint_lifespan > 0 ) {
127107 props . on_checkpoint_lifespan_change ( checkpoint_lifespan )
@@ -254,38 +234,6 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
254234 }
255235 />
256236 </ UiItem >
257- < UiItem
258- title = { t ( 'general.limit-semantic-search-results.title' ) }
259- description = {
260- < >
261- { t ( 'general.limit-semantic-search-results.description' ) } { ' ' }
262- < a
263- href = "#"
264- onClick = { ( e ) => {
265- e . preventDefault ( )
266- props . on_open_external_url (
267- 'https://github.com/MinishLab/semble#cli'
268- )
269- } }
270- >
271- { t ( 'general.limit-semantic-search-results.learn-more' ) }
272- </ a >
273- </ >
274- }
275- slot_right = {
276- < UiInput
277- type = "number"
278- value = { limit_semantic_search_results ?. toString ( ) ?? '' }
279- on_change = { ( val ) =>
280- set_limit_semantic_search_results (
281- val == '' ? undefined : parseInt ( val , 10 )
282- )
283- }
284- on_blur = { handle_limit_semantic_search_results_blur }
285- max_width = { 100 }
286- />
287- }
288- />
289237 </ UiGroup >
290238 </ div >
291239
0 commit comments