Skip to content

Commit 0181625

Browse files
committed
Refactor the UI and command palette by renaming the "Apply" button to "Apply clipboard" and removing redundant "Apply Chat Response" and "Undo Last Changes" commands from the README
1 parent f803c6a commit 0181625

4 files changed

Lines changed: 24 additions & 32 deletions

File tree

‎README.md‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ Generate meaningful summaries of changes adhering to your style.
127127
- `Code Web Chat: Code Completion with Instructions` - ...with instructions.
128128
- `Code Web Chat: Code Completion with Instructions using...` - ...with instructions and configuration selection.
129129

130-
### Chat responses
131-
132-
- `Code Web Chat: Apply Chat Response` - Integrate with the codebase a copied to clipboard overall chat response or a single code block.
133-
- `Code Web Chat: Undo Last Changes` - Revert applied edits.
134-
135130
### Checkpoints
136131

137132
- `Code Web Chat: Checkpoints` - Restore the overall workspace state to the saved checkpoint.

‎packages/vscode/package.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,14 @@
281281
],
282282
"menus": {
283283
"commandPalette": [
284+
{
285+
"command": "codeWebChat.applyChatResponse",
286+
"when": "false"
287+
},
288+
{
289+
"command": "codeWebChat.undo",
290+
"when": "false"
291+
},
284292
{
285293
"command": "codeWebChat.clearChecks",
286294
"when": "false"

‎packages/vscode/src/views/panel/frontend/Main/MainView/MainView.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
border-radius: var(--border-radius-4px);
4747
text-decoration: none;
4848
color: var(--vscode-foreground);
49-
white-space: nowrap;
49+
letter-spacing: -0.5px;
5050

5151
&:disabled {
5252
opacity: var(--disabled-opacity);

‎packages/vscode/src/views/panel/frontend/Main/MainView/MainView.tsx‎

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export const MainView: React.FC<Props> = (props) => {
112112
useState(false)
113113
const [is_apply_disabled_temporarily, set_is_apply_disabled_temporarily] =
114114
useState(false)
115-
const [is_undo_disabled_temporarily, set_is_undo_disabled_temporarily] =
116-
useState(false)
117115

118116
const calculate_dropdown_max_width = () => {
119117
if (!container_ref.current || !top_left_ref.current) return
@@ -160,7 +158,6 @@ export const MainView: React.FC<Props> = (props) => {
160158
if (props.home_view_type == HOME_VIEW_TYPES.WEB) {
161159
props.initialize_chats({})
162160
} else {
163-
set_is_undo_disabled_temporarily(false)
164161
if (is_in_code_completions_mode) {
165162
props.on_code_completion_click()
166163
} else {
@@ -173,7 +170,6 @@ export const MainView: React.FC<Props> = (props) => {
173170
if (props.home_view_type == HOME_VIEW_TYPES.WEB) {
174171
props.initialize_chats({ show_quick_pick: true })
175172
} else {
176-
set_is_undo_disabled_temporarily(false)
177173
if (is_in_code_completions_mode) {
178174
props.on_code_completion_with_quick_pick_click()
179175
} else {
@@ -198,12 +194,7 @@ export const MainView: React.FC<Props> = (props) => {
198194
}, [props.can_undo])
199195

200196
const handle_undo_click = () => {
201-
if (!props.can_undo) return
202-
203-
set_is_undo_disabled_temporarily(true)
204197
props.on_quick_action_click('codeWebChat.undo')
205-
206-
setTimeout(() => set_is_undo_disabled_temporarily(false), 10000)
207198
}
208199

209200
const handle_commit_click = () => {
@@ -434,6 +425,19 @@ export const MainView: React.FC<Props> = (props) => {
434425
</a>
435426
</div>
436427
<div className={styles.footer__right}>
428+
<button
429+
className={cn(
430+
styles.footer__button,
431+
styles['footer__button--outlined']
432+
)}
433+
onClick={handle_undo_click}
434+
title={
435+
'Restore saved state of the codebase after chat/API response integration'
436+
}
437+
disabled={!props.can_undo}
438+
>
439+
Undo
440+
</button>
437441
{props.home_view_type == HOME_VIEW_TYPES.WEB && (
438442
<button
439443
className={cn(
@@ -444,24 +448,9 @@ export const MainView: React.FC<Props> = (props) => {
444448
title={'Integrate copied message or a code block'}
445449
disabled={is_apply_disabled_temporarily}
446450
>
447-
APPLY
451+
Apply clipboard
448452
</button>
449453
)}
450-
<button
451-
className={cn(
452-
styles.footer__button,
453-
styles['footer__button--outlined']
454-
)}
455-
onClick={handle_undo_click}
456-
title={
457-
props.can_undo
458-
? 'Restore saved state of the codebase after chat/API response integration'
459-
: 'Nothing to undo'
460-
}
461-
disabled={!props.can_undo || is_undo_disabled_temporarily}
462-
>
463-
UNDO
464-
</button>
465454
<button
466455
className={cn(
467456
styles.footer__button,
@@ -477,7 +466,7 @@ export const MainView: React.FC<Props> = (props) => {
477466
!props.has_changes_to_commit || is_commit_disabled_temporarily
478467
}
479468
>
480-
COMMIT
469+
Commit changes
481470
</button>
482471
</div>
483472
</div>

0 commit comments

Comments
 (0)