Skip to content

Commit 269207c

Browse files
committed
Remove the Quick Actions dropdown and display its commands directly in the footer
1 parent 586fc2a commit 269207c

7 files changed

Lines changed: 40 additions & 178 deletions

File tree

packages/ui/src/components/editor/QuickAction/QuickAction.module.scss

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

packages/ui/src/components/editor/QuickAction/QuickAction.stories.tsx

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

packages/ui/src/components/editor/QuickAction/QuickAction.tsx

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

packages/ui/src/components/editor/QuickAction/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/vscode/src/view/backend/message-handlers/handle-create-preset.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ export const handle_create_preset = async (
1414
[
1515
{
1616
label: 'Preset',
17-
description: '(will appear at the top of the list)',
18-
detail: 'Your favorite chatbot, preconfigured.'
17+
description: 'Placed at the top of the list',
18+
detail:
19+
'Custom chat configuration with model, prompt prefix/suffix and more.'
1920
},
2021
{
2122
label: 'Group',
22-
description: '(will appear at the bottom of the list)',
23-
detail: 'Simultaneous initializations of selected presets.'
23+
description: 'Placed at the bottom of the list',
24+
detail:
25+
'Simultaneous initializations of selected presets, shared preffix/suffix.'
2426
}
2527
],
2628
{

packages/vscode/src/view/frontend/home/HomeView/HomeView.module.scss

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,6 @@
1111
padding: var(--padding-3px) 0 var(--padding-10px) 0;
1212
}
1313

14-
.commands {
15-
position: absolute;
16-
z-index: 1;
17-
bottom: calc(24px + 16px + 1px + 4px);
18-
right: var(--padding-4px);
19-
padding: var(--padding-4px) 0;
20-
width: 65vw;
21-
border-radius: var(--border-radius-4px);
22-
transform: translateY(10px);
23-
transition: transform 0.15s var(--transition-timing-function),
24-
opacity 0.15s var(--transition-timing-function);
25-
opacity: 0;
26-
background-color: var(--vscode-quickInput-background);
27-
color: var(--vscode-quickInput-foreground);
28-
border: 1px solid var(--vscode-focusBorder);
29-
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
30-
pointer-events: none;
31-
32-
&--visible {
33-
transform: translateY(0);
34-
opacity: 1;
35-
pointer-events: all;
36-
}
37-
}
38-
3914
.footer {
4015
position: relative;
4116
display: flex;
@@ -50,6 +25,11 @@
5025
overflow: hidden;
5126
}
5227

28+
&__right {
29+
display: flex;
30+
gap: var(--padding-8px);
31+
}
32+
5333
&__button {
5434
display: flex;
5535
align-items: center;
@@ -99,39 +79,6 @@
9979
border-color: var(--vscode-commandCenter-activeBorder);
10080
}
10181
}
102-
103-
&--outlined-active {
104-
border-color: var(--vscode-focusBorder);
105-
&:hover {
106-
border-color: var(--vscode-focusBorder);
107-
}
108-
}
109-
110-
&--quick-actions {
111-
position: relative;
112-
&::after {
113-
content: '';
114-
position: absolute;
115-
z-index: 2;
116-
top: -19px;
117-
left: 50%;
118-
transform: translateX(-50%);
119-
width: 10px;
120-
height: 10px;
121-
border-bottom: 1px solid var(--vscode-focusBorder);
122-
border-right: 1px solid var(--vscode-focusBorder);
123-
transform: translateY(10px) rotate(45deg);
124-
background-color: var(--vscode-quickInput-background);
125-
transition: all 0.15s var(--transition-timing-function);
126-
opacity: 0;
127-
pointer-events: none;
128-
}
129-
}
130-
131-
&--quick-actions-after-visible::after {
132-
transform: rotate(45deg) translateY(0);
133-
opacity: 1;
134-
}
13582
}
13683

13784
&__heart {

packages/vscode/src/view/frontend/home/HomeView/HomeView.tsx

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { ApiMode, WebMode } from '@shared/types/modes'
1313
import { Dropdown as UiDropdown } from '@ui/components/editor/Dropdown'
1414
import { Icon } from '@ui/components/editor/Icon'
1515
import cn from 'classnames'
16-
import { QuickAction as UiQuickAction } from '@ui/components/editor/QuickAction'
1716
import { IconButton } from '@ui/components/editor/IconButton/IconButton'
1817
import { Scrollable } from '@ui/components/editor/Scrollable'
1918
import { BrowserExtensionMessage as UiBrowserExtensionMessage } from '@ui/components/editor/BrowserExtensionMessage'
@@ -93,8 +92,6 @@ export const HomeView: React.FC<Props> = (props) => {
9392
const switch_container_ref = useRef<HTMLDivElement>(null)
9493
const [is_buy_me_coffee_hovered, set_is_buy_me_coffee_hovered] =
9594
useState(false)
96-
const [is_showing_pinned_commands, set_is_showing_pinned_commands] =
97-
useState(false)
9895

9996
const calculate_dropdown_max_width = () => {
10097
if (!container_ref.current || !switch_container_ref.current) return
@@ -441,31 +438,6 @@ export const HomeView: React.FC<Props> = (props) => {
441438
)}
442439
</div>
443440
</Scrollable>
444-
<div
445-
className={cn(styles.commands, {
446-
[styles['commands--visible']]: is_showing_pinned_commands
447-
})}
448-
>
449-
<UiQuickAction
450-
title="Apply Chat Response"
451-
description="Integrate copied message or a code block"
452-
on_click={() =>
453-
props.on_quick_action_click('codeWebChat.applyChatResponse')
454-
}
455-
/>
456-
<UiQuickAction
457-
title="Revert Last Changes"
458-
description="Restore saved state of the codebase"
459-
on_click={() => props.on_quick_action_click('codeWebChat.revert')}
460-
/>
461-
<UiQuickAction
462-
title="Commit Changes"
463-
description="Generate a commit message and commit"
464-
on_click={() =>
465-
props.on_quick_action_click('codeWebChat.commitChanges')
466-
}
467-
/>
468-
</div>
469441

470442
<div className={styles.footer}>
471443
<div className={styles.footer__left}>
@@ -501,31 +473,44 @@ export const HomeView: React.FC<Props> = (props) => {
501473
title="Join subreddit"
502474
>
503475
<Icon variant="REDDIT" />
504-
<span style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}>
505-
COMMUNITY
506-
</span>
507476
</a>
508477
</div>
509-
<div>
478+
<div className={styles.footer__right}>
479+
<button
480+
className={cn(
481+
styles.footer__button,
482+
styles['footer__button--outlined']
483+
)}
484+
onClick={() => {
485+
props.on_quick_action_click('codeWebChat.applyChatResponse')
486+
}}
487+
title="Integrate copied message or a code block"
488+
>
489+
APPLY
490+
</button>
491+
<button
492+
className={cn(
493+
styles.footer__button,
494+
styles['footer__button--outlined']
495+
)}
496+
onClick={() => {
497+
props.on_quick_action_click('codeWebChat.revert')
498+
}}
499+
title="Restore saved state of the codebase"
500+
>
501+
REVERT
502+
</button>
510503
<button
511504
className={cn(
512505
styles.footer__button,
513-
styles['footer__button--outlined'],
514-
is_showing_pinned_commands
515-
? styles['footer__button--outlined-active']
516-
: '',
517-
styles['footer__button--quick-actions'],
518-
is_showing_pinned_commands
519-
? styles['footer__button--quick-actions-after-visible']
520-
: ''
506+
styles['footer__button--outlined']
521507
)}
522508
onClick={() => {
523-
set_is_showing_pinned_commands(!is_showing_pinned_commands)
509+
props.on_quick_action_click('codeWebChat.commitChanges')
524510
}}
525-
title="Handy access to selected features"
511+
title="Generate a commit message and commit"
526512
>
527-
<span className="codicon codicon-pinned" />
528-
PINNED COMMANDS
513+
COMMIT
529514
</button>
530515
</div>
531516
{is_buy_me_coffee_hovered &&

0 commit comments

Comments
 (0)