Skip to content

Commit 3ec9deb

Browse files
committed
Refactor settings page navigation and layout and bump version to 1.942.0
- move 'reuse last tab' to 'web configurations', immediately above 'gemini user id' - rename 'web configurations' to 'chatbot autofill', place configurations in a 'configurations' subsection. the 'reuse last tab' should remain as a single element above the configurations subsection. - in section 'chatbot autofill' there is 'configurations' subsection. The menu should have submenu item 'Configurations' for it. - rename 'api configurations' to 'api calls'. Place 'model providers' in this section as a subsection. - move 'auto run intelligent update' to 'api calls' section (on its top) - remove notice 'configurations define the provider, model...' - move notice 'credentials are stored securely...' higher, right before section header - rename notice 'web configurations allow you to autofill...' to 'Communication with the browser uses local WebSockets' - rename notice 'web configurations allow you to autofill...' to 'Communication with the browser uses local WebSockets' - rename [Fragment] to sections.chatbots - remove actions from sections - change configurations.subtitle to 'Setup model providers and add configurations' - add missing translations to[Fragment] - shorten [Fragment] to 'Defaults'
1 parent 485a015 commit 3ec9deb

9 files changed

Lines changed: 547 additions & 503 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
44
"description": "Connect VS Code with free chatbots (CWC)",
5-
"version": "1.941.0",
5+
"version": "1.942.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

‎apps/editor/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 37 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { useState, useRef, useEffect, useCallback } from 'react'
22
import { Layout as UiLayout } from '@ui/components/editor/settings/Layout'
33
import { NavigationItem as UiNavigationItem } from '@ui/components/editor/settings/NavigationItem'
4-
import { ModelProvidersSection } from './sections/ModelProvidersSection'
54
import { ApiConfigurationsSection } from './sections/ApiConfigurationsSection'
65
import { Item as UiItem } from '@ui/components/editor/settings/Item'
76
import { Group as UiGroup } from '@ui/components/editor/settings/Group/Group'
87
import { Section as UiSection } from '@ui/components/editor/settings/Section'
9-
import { Toggler as UiToggler } from '@ui/components/editor/common/Toggler'
108
import { Button as UiButton } from '@ui/components/editor/common/Button'
119
import { Notice as UiNotice } from '@ui/components/editor/settings/Notice'
1210
import {
@@ -36,7 +34,9 @@ export type NavItem =
3634
| 'edit-format'
3735
| 'model-providers'
3836
| 'api-configurations'
37+
| 'api-configurations-list'
3938
| 'web-configurations'
39+
| 'web-configurations-list'
4040
| 'default-configurations'
4141
| 'instructions'
4242

@@ -64,16 +64,27 @@ const NAV_ITEMS_CONFIG: NavConfigItem[] = [
6464
},
6565
{
6666
id: 'web-configurations',
67-
label: 'sections.web-configurations' as any
67+
label: 'sections.chatbots'
6868
},
6969
{
70-
id: 'model-providers',
71-
label: 'sections.model-providers'
70+
id: 'web-configurations-list',
71+
label: 'web-configurations.configurations.title',
72+
is_nested: true
7273
},
7374
{
7475
id: 'api-configurations',
7576
label: 'sections.api-configurations'
7677
},
78+
{
79+
id: 'model-providers',
80+
label: 'sections.model-providers',
81+
is_nested: true
82+
},
83+
{
84+
id: 'api-configurations-list',
85+
label: 'web-configurations.configurations.title',
86+
is_nested: true
87+
},
7788
{
7889
id: 'default-configurations',
7990
label: 'configurations.default-configurations.title',
@@ -181,7 +192,9 @@ export const Home: React.FC<Props> = (props) => {
181192
'edit-format': null,
182193
'model-providers': null,
183194
'api-configurations': null,
195+
'api-configurations-list': null,
184196
'web-configurations': null,
197+
'web-configurations-list': null,
185198
'default-configurations': null,
186199
instructions: null
187200
})
@@ -333,8 +346,6 @@ export const Home: React.FC<Props> = (props) => {
333346
}
334347
check_new_files={props.check_new_files}
335348
on_check_new_files_change={props.on_check_new_files_change}
336-
reuse_last_tab={props.reuse_last_tab}
337-
on_reuse_last_tab_change={props.on_reuse_last_tab_change}
338349
clear_checks_in_workspace_behavior={
339350
props.clear_checks_in_workspace_behavior
340351
}
@@ -361,10 +372,6 @@ export const Home: React.FC<Props> = (props) => {
361372
props.on_open_allow_patterns_settings
362373
}
363374
on_open_keybindings={props.on_open_keybindings}
364-
auto_run_intelligent_update={props.auto_run_intelligent_update}
365-
on_auto_run_intelligent_update_change={
366-
props.on_auto_run_intelligent_update_change
367-
}
368375
include_prompts_in_commit_messages={
369376
props.include_prompts_in_commit_messages
370377
}
@@ -387,97 +394,34 @@ export const Home: React.FC<Props> = (props) => {
387394
on_duplicate_web_configuration={props.on_duplicate_web_configuration}
388395
on_edit_web_configuration={props.on_edit_web_configuration}
389396
on_delete_web_configuration={props.on_delete_web_configuration}
397+
reuse_last_tab={props.reuse_last_tab}
398+
on_reuse_last_tab_change={props.on_reuse_last_tab_change}
390399
gemini_user_id={props.gemini_user_id}
391400
ai_studio_user_id={props.ai_studio_user_id}
392401
on_gemini_user_id_change={props.on_gemini_user_id_change}
393402
on_ai_studio_user_id_change={props.on_ai_studio_user_id_change}
394403
/>
395404

396-
<UiSection
397-
ref={(el) => set_section_ref('model-providers', el)}
398-
title={t('sections.model-providers')}
399-
subtitle={t('model-providers.subtitle')}
400-
actions={
401-
<UiButton on_click={() => props.on_add_provider()}>
402-
{t('action.add-new')}
403-
</UiButton>
404-
}
405-
>
406-
<UiNotice type="info">
407-
<Translation
408-
id="model-providers.notice.credentials"
409-
components={{
410-
link: (
411-
<a
412-
href="#"
413-
onClick={(e) => {
414-
e.preventDefault()
415-
props.on_open_external_url(
416-
'https://code.visualstudio.com/api/references/vscode-api#SecretStorage'
417-
)
418-
}}
419-
>
420-
SecretStorage
421-
</a>
422-
)
423-
}}
424-
/>
425-
</UiNotice>
426-
{props.providers.length == 0 && (
427-
<UiNotice type="warning">
428-
{t('model-providers.notice.missing')}
429-
</UiNotice>
430-
)}
431-
<UiGroup>
432-
<ModelProvidersSection
433-
providers={props.providers}
434-
on_reorder={(reordered) => {
435-
props.set_providers(reordered)
436-
props.on_reorder_providers(reordered)
437-
}}
438-
on_add_provider={props.on_add_provider}
439-
on_delete_provider={props.on_delete_provider}
440-
on_edit_provider={props.on_edit_provider}
441-
/>
442-
<UiItem
443-
title={t('model-providers.extended-cache.anthropic.title')}
444-
description={
445-
<Translation
446-
id="model-providers.extended-cache.anthropic.description"
447-
components={{
448-
link: (
449-
<a
450-
href="#"
451-
onClick={(e) => {
452-
e.preventDefault()
453-
props.on_open_external_url(
454-
'https://platform.claude.com/docs/en/build-with-claude/prompt-caching'
455-
)
456-
}}
457-
>
458-
{t(
459-
'model-providers.extended-cache.anthropic.learn-more'
460-
)}
461-
</a>
462-
)
463-
}}
464-
/>
465-
}
466-
slot_right={
467-
<UiToggler
468-
is_on={props.extended_cache_duration_for_anthropic}
469-
on_toggle={
470-
props.on_extended_cache_duration_for_anthropic_change
471-
}
472-
/>
473-
}
474-
/>
475-
</UiGroup>
476-
</UiSection>
477-
478405
<ApiConfigurationsSection
479406
ref={(el) => set_section_ref('api-configurations', el)}
480407
set_section_ref={set_section_ref}
408+
providers={props.providers}
409+
set_providers={props.set_providers}
410+
on_add_provider={props.on_add_provider}
411+
on_delete_provider={props.on_delete_provider}
412+
on_edit_provider={props.on_edit_provider}
413+
on_reorder_providers={props.on_reorder_providers}
414+
extended_cache_duration_for_anthropic={
415+
props.extended_cache_duration_for_anthropic
416+
}
417+
on_extended_cache_duration_for_anthropic_change={
418+
props.on_extended_cache_duration_for_anthropic_change
419+
}
420+
auto_run_intelligent_update={props.auto_run_intelligent_update}
421+
on_auto_run_intelligent_update_change={
422+
props.on_auto_run_intelligent_update_change
423+
}
424+
on_open_external_url={props.on_open_external_url}
481425
api_configurations={props.api_configurations}
482426
defaults={props.defaults}
483427
set_api_configurations={props.set_api_configurations}

0 commit comments

Comments
 (0)