Skip to content

Commit a2efd3c

Browse files
committed
Remove configuration collapse state and remove unused state keys
- make configurations non-collapsible - replace 'list header' with a separator line and remove this component - remove unused state keys ├── apps │ └── editor │ └── src │ ├── commands │ │ ├── apply-response-command │ │ │ ├── apply-response-command.ts │ │ │ └── utils │ │ │ └── state-manager.ts │ │ ├── code-at-cursor-command │ │ │ └── utils │ │ │ └── get-code-at-cursor-config.ts │ │ ├── copy-paths-command.ts │ │ ├── duplicate-workspace-command.ts │ │ ├── generate-commit-message-commands │ │ │ ├── actions │ │ │ │ ├── get-prompt-data.ts │ │ │ │ └── run-generate-action.ts │ │ │ └── utils │ │ │ └── get-commit-message-config.ts │ │ ├── history-command │ │ │ ├── actions │ │ │ │ ├── clear-all-checkpoints.ts │ │ │ │ ├── delete-checkpoint-with-undo.ts │ │ │ │ ├── restore-checkpoint.ts │ │ │ │ ├── toggle-checkpoint-pin.ts │ │ │ │ └── update-checkpoint-description.ts │ │ │ └── history-command.ts │ │ └── set-ranges-command.ts │ ├── constants │ │ └── state-keys.ts │ ├── context │ │ ├── context-initialization.ts │ │ └── providers │ │ └── workspace │ │ └── workspace-provider.ts │ ├── features │ │ ├── checkpoints │ │ │ └── actions │ │ │ ├── create-checkpoint.ts │ │ │ ├── delete-checkpoint.ts │ │ │ └── get-checkpoints.ts │ │ ├── context-restoration │ │ │ └── utils │ │ │ └── source-selector.ts │ │ └── search-files │ │ ├── search-files.ts │ │ ├── search-modes │ │ │ ├── perform-intelligent-search-mode.ts │ │ │ ├── perform-keywords-search-mode.ts │ │ │ └── perform-phrase-search-mode.ts │ │ └── utils │ │ └── prompt-for-config.ts │ ├── services │ │ └── websocket-manager.ts │ └── views │ ├── chats │ │ └── backend │ │ ├── chats-view-provider.ts │ │ └── message-handlers │ │ └── handle-delete-chat.ts │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ ├── handle-autofill.ts │ │ │ ├── handle-fix-all-failed-files.ts │ │ │ ├── handle-get-history.ts │ │ │ ├── handle-hash-sign-quick-pick │ │ │ │ ├── handle-hash-sign-quick-pick.ts │ │ │ │ └── symbols │ │ │ │ ├── commit-symbol.ts │ │ │ │ └── saved-context-symbol.ts │ │ │ ├── handle-intelligent-update-file-in-preview.ts │ │ │ ├── handle-make-api-call.ts │ │ │ ├── handle-request-can-undo.ts │ │ │ ├── handle-save-edit-format.ts │ │ │ ├── handle-save-history.ts │ │ │ ├── handle-save-instructions.ts │ │ │ ├── handle-select-edit-format.ts │ │ │ ├── handle-template-quick-pick.ts │ │ │ ├── handle-undo.ts │ │ │ ├── handle-update-last-used-web-configuration.ts │ │ │ ├── handle-voice-input.ts │ │ │ ├── index.ts │ │ │ └── utils │ │ │ └── intelligent-update-utils.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ ├── Main │ │ │ ├── Main.tsx │ │ │ ├── MainView │ │ │ │ ├── MainView.tsx │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── Prompt.tsx │ │ └── hooks │ │ └── use-prompt │ │ ├── index.ts │ │ └── use-prompt.ts │ └── types │ └── messages.ts └── packages └── ui └── src └── components └── editor └── prompt ├── Configurations │ ├── Configurations.module.scss │ ├── Configurations.stories.tsx │ ├── Configurations.tsx │ └── index.ts └── ListHeader ├── ListHeader.module.scss ├── ListHeader.tsx └── index.ts
1 parent 8d9ac62 commit a2efd3c

21 files changed

Lines changed: 65 additions & 351 deletions

File tree

‎apps/editor/src/constants/state-keys.ts‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,11 @@ export const LAST_APPLIED_CHANGES_EDITOR_STATE_STATE_KEY =
33
'last-applied-changes-editor-state'
44
export const LAST_APPLIED_CLIPBOARD_CONTENT_STATE_KEY =
55
'last-applied-clipboard-content'
6-
export const QUICK_SAVES_STATE_KEY = 'quick-saves'
7-
export const LAST_CONTEXT_SAVE_LOCATION_STATE_KEY = 'last-save-location'
86
export const RANGES_STATE_KEY = 'ranges'
97
export const LAST_RANGES_SAVE_LOCATION_STATE_KEY = 'last-ranges-save-location'
108
export const LAST_APPLY_CONTEXT_OPTION_STATE_KEY = 'last-apply-context-option'
119
export const CONTEXT_CHECKED_PATHS_STATE_KEY = 'context-checked-paths'
1210
export const CONTEXT_CHECKED_TIMESTAMPS_STATE_KEY = 'context-checked-timestamps'
13-
export const LAST_APPLY_CONTEXT_MERGE_REPLACE_OPTION_STATE_KEY =
14-
'last-apply-context-merge-replace-option'
15-
export const LAST_SEARCH_FILES_MERGE_REPLACE_OPTION_STATE_KEY =
16-
'last-search-files-merge-replace-option'
17-
export const LAST_REFACTOR_INSTRUCTION_SOURCE_STATE_KEY =
18-
'last-refactor-instruction-source'
19-
export const LAST_REFACTOR_INSTRUCTION_STATE_KEY = 'last-refactor-instruction'
2011
export const LAST_SELECTED_SYMBOL_STATE_KEY = 'last-selected-symbol'
2112
export const LAST_SELECTED_CONTEXT_SOURCE_IN_SYMBOLS_QUICK_PICK_STATE_KEY =
2213
'last-selected-context-source-in-symbols-quick-pick'
@@ -43,18 +34,10 @@ export const PROMPT_VIEW_MODE_STATE_KEY = 'prompt-view-mode'
4334

4435
export const INSTRUCTIONS_EDIT_FILES_STATE_KEY = 'instructions-edit-files'
4536
export const INSTRUCTIONS_ASK_STATE_KEY = 'instructions-ask'
46-
export const INSTRUCTIONS_CODE_AT_CURSOR_STATE_KEY =
47-
'instructions-code-at-cursor'
48-
49-
export const ARE_TASKS_COLLAPSED_STATE_KEY = 'are-tasks-collapsed'
50-
export const ARE_CHECKPOINTS_COLLAPSED_STATE_KEY = 'are-checkpoints-collapsed'
5137

5238
export const HISTORY_ASK_ABOUT_FILES_STATE_KEY = 'history-ask-about-files'
5339
export const HISTORY_EDIT_FILES_STATE_KEY = 'history-edit-files'
5440

55-
export const INTELLIGENT_FILE_SEARCH_SHRINK_SOURCE_CODE_STATE_KEY =
56-
'intelligent-file-search-shrink-source-code'
57-
5841
export const LAST_USED_CODE_AT_CURSOR_CONFIG_ID_STATE_KEY =
5942
'last-used-code-at-cursor-config-id'
6043
export const LAST_USED_INTELLIGENT_FILE_SEARCH_CONFIG_ID_STATE_KEY =
@@ -72,11 +55,6 @@ export const LAST_USED_INTELLIGENT_UPDATE_CONFIG_ID_STATE_KEY =
7255
export const LAST_USED_VOICE_INPUT_CONFIG_ID_STATE_KEY =
7356
'last-used-voice-input-config-id'
7457

75-
export const WEB_CONFIGURATIONS_COLLAPSED_STATE_KEY =
76-
'web-configurations-collapsed'
77-
export const API_CONFIGURATIONS_COLLAPSED_STATE_KEY =
78-
'api-configurations-collapsed'
79-
8058
export const get_last_used_web_configuration_key = (web_prompt_type: string) =>
8159
`last-used-web-configuration-${web_prompt_type}`
8260

@@ -93,14 +71,10 @@ export const LAST_SEARCH_FILES_KEYWORDS_MATCH_MODE_STATE_KEY =
9371
'last-search-files-keywords-match-mode'
9472
export const LAST_SEARCH_FILES_KEYWORDS_TARGET_STATE_KEY =
9573
'last-search-files-keywords-target'
96-
export const LAST_SEARCH_FILES_FILENAME_QUERY_STATE_KEY =
97-
'last-search-files-filename-query'
9874
export const LAST_SEARCH_FILES_FILENAME_MATCH_MODE_STATE_KEY =
9975
'last-search-files-filename-match-mode'
10076
export const LAST_SEARCH_FILES_INTELLIGENT_QUERY_STATE_KEY =
10177
'last-search-files-intelligent-query'
102-
export const LAST_SEARCH_FILES_SEMANTIC_QUERY_STATE_KEY =
103-
'last-search-files-semantic-query'
10478

10579
export const LAST_SEARCH_FILES_FOR_CONTEXT_MODE_STATE_KEY =
10680
'last-search-files-for-context-mode'

‎apps/editor/src/views/prompt/backend/message-handlers/handle-get-collapsed-states.ts‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎apps/editor/src/views/prompt/backend/message-handlers/handle-save-component-collapsed-state.ts‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎apps/editor/src/views/prompt/backend/message-handlers/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ export * from './handle-focus-on-file-in-preview'
4141
export * from './handle-go-to-file'
4242
export * from './handle-toggle-file-in-preview'
4343
export * from './handle-intelligent-update-file-in-preview'
44-
export * from './handle-get-collapsed-states'
4544
export * from './handle-manage-api-configurations'
46-
export * from './handle-save-component-collapsed-state'
4745
export * from './handle-undo'
4846
export * from './handle-show-diff'
4947
export * from './handle-discard-user-changes-in-preview'

‎apps/editor/src/views/prompt/backend/prompt-view-provider.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ import {
5656
handle_discard_user_changes_in_preview,
5757
handle_intelligent_update_file_in_preview,
5858
handle_response_preview,
59-
handle_get_collapsed_states,
6059
handle_manage_api_configurations,
61-
handle_save_component_collapsed_state,
6260
handle_undo,
6361
handle_request_can_undo,
6462
handle_preview_generated_code,
@@ -392,10 +390,6 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
392390
this.send_setup_progress()
393391
}
394392

395-
if (event.affectsConfiguration('codeWebChat.areCheckpointsCollapsed')) {
396-
handle_get_collapsed_states(this)
397-
}
398-
399393
if (event.affectsConfiguration('codeWebChat.sendWithShiftEnter')) {
400394
this._send_send_with_shift_enter()
401395
}
@@ -756,10 +750,6 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
756750
})
757751
} else if (message.command == 'MANAGE_API_CONFIGURATIONS') {
758752
await handle_manage_api_configurations()
759-
} else if (message.command == 'GET_COLLAPSED_STATES') {
760-
handle_get_collapsed_states(this)
761-
} else if (message.command == 'SAVE_COMPONENT_COLLAPSED_STATE') {
762-
await handle_save_component_collapsed_state(this, message)
763753
} else if (message.command == 'PREVIEW_SWITCH_CHOICE') {
764754
if (this.preview_switch_choice_resolver) {
765755
this.preview_switch_choice_resolver(message.choice)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const Home: React.FC<Props> = (props) => {
103103
<div className={styles['header__home']}>
104104
<span className="codicon codicon-home" />
105105
</div>
106-
<span className={styles['header__text']}>CODE WEB CHAT</span>
106+
<span className={styles['header__text']}>HOME</span>
107107
</div>
108108
<div className={styles['header__right']}>
109109
<CompactableActionButton

‎apps/editor/src/views/prompt/frontend/Main/Main.tsx‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ type Props = {
4646
chat_input_focus_key: number
4747
context_size_warning_threshold: number
4848
selected_files: string[]
49-
web_configurations_collapsed: boolean
50-
on_web_configurations_collapsed_change: (is_collapsed: boolean) => void
5149
send_with_shift_enter: boolean
52-
api_configurations_collapsed: boolean
53-
on_api_configurations_collapsed_change: (is_collapsed: boolean) => void
5450
currently_open_file_text?: string
5551
on_pasted_lines_click: (path: string, start?: string, end?: string) => void
5652
are_keyboard_shortcuts_disabled: boolean
@@ -533,15 +529,7 @@ export const Main: React.FC<Props> = (props) => {
533529
on_selected_history_item_change={props.on_selected_history_item_change}
534530
on_response_history_item_remove={props.on_response_history_item_remove}
535531
selected_files={props.selected_files}
536-
web_configurations_collapsed={props.web_configurations_collapsed}
537532
send_with_shift_enter={props.send_with_shift_enter}
538-
on_web_configurations_collapsed_change={
539-
props.on_web_configurations_collapsed_change
540-
}
541-
api_configurations_collapsed={props.api_configurations_collapsed}
542-
on_api_configurations_collapsed_change={
543-
props.on_api_configurations_collapsed_change
544-
}
545533
on_go_to_file={handle_go_to_file}
546534
on_pasted_lines_click={props.on_pasted_lines_click}
547535
currently_open_file_text={props.currently_open_file_text}

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ type Props = {
8686
on_selected_history_item_change: (created_at: number) => void
8787
on_response_history_item_remove: (created_at: number) => void
8888
selected_files: string[]
89-
web_configurations_collapsed: boolean
90-
on_web_configurations_collapsed_change: (is_collapsed: boolean) => void
9189
send_with_shift_enter: boolean
92-
api_configurations_collapsed: boolean
93-
on_api_configurations_collapsed_change: (is_collapsed: boolean) => void
9490
currently_open_file_text?: string
9591
on_go_to_file: (file_path: string) => void
9692
on_pasted_lines_click: (path: string, start?: string, end?: string) => void
@@ -426,10 +422,7 @@ export const MainView: React.FC<Props> = (props) => {
426422
props.on_toggle_web_configuration_pinned(id)
427423
}}
428424
selected_configuration_id={props.selected_web_configuration_name}
429-
is_collapsed={props.web_configurations_collapsed}
430-
on_toggle_collapsed={props.on_web_configurations_collapsed_change}
431425
translations={{
432-
title: t('configurations.title'),
433426
empty: t('configurations.empty'),
434427
add_new: t('action.add-new'),
435428
pin: t('action.pin'),
@@ -457,10 +450,7 @@ export const MainView: React.FC<Props> = (props) => {
457450
on_delete={props.on_delete_api_configuration}
458451
selected_configuration_id={props.selected_api_configuration_id}
459452
on_create={props.on_create_api_configuration}
460-
is_collapsed={props.api_configurations_collapsed}
461-
on_toggle_collapsed={props.on_api_configurations_collapsed_change}
462453
translations={{
463-
title: t('configurations.title'),
464454
empty: t('configurations.empty'),
465455
add_new: t('action.add-new'),
466456
pin: t('action.pin'),

‎apps/editor/src/views/prompt/frontend/Main/MainView/components/Header/Header.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ export const Header: React.FC<Props> = (props) => {
100100

101101
<div className={styles.header__right}>
102102
<ModeToggler
103-
mode={props.mode == MODE.WEB ? MODE.WEB : MODE.API}
104-
alt_mode={props.mode == MODE.WEB ? MODE.API : MODE.WEB}
103+
mode={props.mode == MODE.WEB ? 'Chatbots' : 'API calls'}
104+
alt_mode={props.mode == MODE.WEB ? 'API calls' : 'Chatbots'}
105105
title={`${t('header.change-mode')} (${is_mac ? '⌥Esc' : 'Alt+Esc'})`}
106106
is_alt_pressed={is_alt_pressed}
107107
on_toggle={handle_heading_click}

‎apps/editor/src/views/prompt/frontend/Prompt.tsx‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,11 @@ export const Prompt = () => {
5555
chat_input_focus_and_select_key,
5656
context_size_warning_threshold,
5757
can_undo,
58-
web_configurations_collapsed,
5958
send_with_shift_enter,
60-
api_configurations_collapsed,
6159
handle_instructions_change,
6260
handle_web_prompt_type_change,
6361
handle_api_prompt_type_change,
6462
handle_mode_change,
65-
handle_web_configurations_collapsed_change,
66-
handle_api_configurations_collapsed_change,
6763
handle_paste_image,
6864
handle_open_image,
6965
handle_paste_long_text,
@@ -355,15 +351,7 @@ export const Prompt = () => {
355351
chat_input_focus_key={chat_input_focus_key}
356352
context_size_warning_threshold={context_size_warning_threshold}
357353
selected_files={selected_files}
358-
web_configurations_collapsed={web_configurations_collapsed}
359354
send_with_shift_enter={send_with_shift_enter}
360-
on_web_configurations_collapsed_change={
361-
handle_web_configurations_collapsed_change
362-
}
363-
api_configurations_collapsed={api_configurations_collapsed}
364-
on_api_configurations_collapsed_change={
365-
handle_api_configurations_collapsed_change
366-
}
367355
on_pasted_lines_click={handle_pasted_lines_click}
368356
currently_open_file_text={currently_open_file_text}
369357
on_open_url={handle_open_url}

0 commit comments

Comments
 (0)