Skip to content

Commit 8f84370

Browse files
committed
Implement a toggleable "Quick Actions" panel above the footer, improving its display and interactivity
1 parent 0429b8f commit 8f84370

3 files changed

Lines changed: 44 additions & 56 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
display: flex;
6262
position: absolute;
6363
z-index: 1;
64-
top: 20px;
64+
top: 18px;
6565
right: 0;
6666
padding: var(--padding-1px) var(--padding-3px) var(--padding-6px)
6767
var(--padding-3px);

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,31 @@
5151
color: var(--vscode-quickInput-foreground);
5252
border: 1px solid var(--vscode-widget-border);
5353
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
54+
pointer-events: none;
5455

5556
&--visible {
5657
transform: translateY(0);
5758
opacity: 1;
59+
pointer-events: all;
5860
}
5961
}
6062

6163
.footer {
6264
display: flex;
63-
overflow: hidden;
6465
gap: var(--padding-8px);
6566
padding: var(--padding-8px) var(--padding-12px);
6667
border-top: 1px solid var(--vscode-sideBarSectionHeader-border);
6768

6869
&__button {
6970
display: flex;
7071
align-items: center;
71-
gap: var(--padding-6px);
72+
gap: var(--padding-4px);
7273
height: 24px;
7374
padding: 0 5px;
7475
border-radius: var(--border-radius-4px);
7576
text-decoration: none;
7677
color: var(--vscode-foreground);
78+
white-space: nowrap;
7779

7880
&:hover {
7981
color: var(--vscode-foreground);
@@ -118,6 +120,32 @@
118120
border-color: var(--vscode-focusBorder);
119121
}
120122
}
123+
124+
&--quick-actions {
125+
position: relative;
126+
&::after {
127+
content: '';
128+
position: absolute;
129+
z-index: 2;
130+
top: -19px;
131+
left: 50%;
132+
transform: translateX(-50%);
133+
width: 10px;
134+
height: 10px;
135+
border-bottom: 1px solid var(--vscode-widget-border);
136+
border-right: 1px solid var(--vscode-widget-border);
137+
transform: translateY(5px) rotate(45deg);
138+
background-color: var(--vscode-quickInput-background);
139+
transition: all 0.1s ease-in-out;
140+
opacity: 0;
141+
pointer-events: none;
142+
}
143+
}
144+
145+
&--quick-actions-after-visible::after {
146+
transform: rotate(45deg) translateY(0);
147+
opacity: 1;
148+
}
121149
}
122150
}
123151

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

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -476,67 +476,27 @@ export const HomeView: React.FC<Props> = (props) => {
476476
</a>
477477
<button
478478
className={cn(
479-
'commands',
480479
styles.footer__button,
481480
styles['footer__button--outlined'],
482-
is_showing_commands ? styles['footer__button--outlined-active'] : ''
481+
is_showing_commands
482+
? styles['footer__button--outlined-active']
483+
: '',
484+
styles['footer__button--quick-actions'],
485+
is_showing_commands
486+
? styles['footer__button--quick-actions-after-visible']
487+
: ''
483488
)}
484489
onClick={() => {
485490
set_is_showing_commands(!is_showing_commands)
486491
}}
487492
>
488-
COMMANDS
493+
{is_showing_commands ? (
494+
<span className="codicon codicon-chevron-down" />
495+
) : (
496+
<span className="codicon codicon-chevron-up" />
497+
)}
498+
QUICK ACTIONS
489499
</button>
490-
{/* <div className={styles['footer__commands']}>
491-
<div className={styles['footer__commands__heading']}>
492-
ONE-CLICK ACTIONS
493-
</div>
494-
<div className={styles['footer__commands__inner']}>
495-
<UiQuickAction
496-
title="Apply Chat Response"
497-
description="Integrate copied message or a code block"
498-
on_click={() =>
499-
props.on_quick_action_click('codeWebChat.applyChatResponse')
500-
}
501-
/>
502-
<UiQuickAction
503-
title="Revert Last Changes"
504-
description="Restore saved state of the codebase"
505-
on_click={() => props.on_quick_action_click('codeWebChat.revert')}
506-
/>
507-
<UiQuickAction
508-
title="Commit Changes"
509-
description="Generate a commit message and commit"
510-
on_click={() =>
511-
props.on_quick_action_click('codeWebChat.commitChanges')
512-
}
513-
/>
514-
</div>
515-
</div>
516-
<div className={styles.footer__links}>
517-
<div className={styles.footer__links__left}>
518-
<a href="https://codeweb.chat/">
519-
<span className="codicon codicon-book"></span>{' '}
520-
<span>Documentation</span>
521-
</a>
522-
</div>
523-
<div className={styles.footer__links__right}>
524-
<a
525-
href="#"
526-
onClick={(e) => {
527-
e.preventDefault()
528-
props.on_review_click()
529-
}}
530-
>
531-
<span className="codicon codicon-star-empty"></span>{' '}
532-
<span>Rate</span>
533-
</a>
534-
<a href="https://buymeacoffee.com/robertpiosik">
535-
<span className="codicon codicon-coffee"></span>{' '}
536-
<span>Buy me a coffee</span>
537-
</a>
538-
</div>
539-
</div> */}
540500
</div>
541501
</div>
542502
)

0 commit comments

Comments
 (0)