Skip to content

Commit c9403a0

Browse files
committed
Refactor the VS Code panel footer buttons to use shared action button styles and ensure the @ sign warning tooltip hides on mouse leave
1 parent 8eecb16 commit c9403a0

4 files changed

Lines changed: 56 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@
282282
background-color: var(--vscode-quickInput-background);
283283
border: 1px solid var(--vscode-widget-border);
284284
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
285+
pointer-events: none;
285286

286287
&::before {
287288
font-family: 'codicon';

‎packages/ui/src/components/editor/panel/ChatInput/ChatInput.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
459459
props.on_at_sign_click()
460460
}
461461
}}
462+
onMouseLeave={() => set_show_at_sign_tooltip(false)}
462463
className={cn(styles['footer__left__button'])}
463464
title="Reference file"
464465
>

‎packages/vscode/src/views/panel/frontend/components/Footer/Footer.module.scss‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,35 @@
6969
&:disabled {
7070
opacity: var(--disabled-opacity);
7171
}
72+
73+
&__text {
74+
display: inline;
75+
}
76+
77+
&__icon {
78+
display: none !important;
79+
}
80+
81+
@media (max-width: 293px) {
82+
padding: 0;
83+
width: var(--button-size);
84+
justify-content: center;
85+
86+
&__text {
87+
display: none;
88+
}
89+
90+
&__icon {
91+
display: inline !important;
92+
}
93+
}
94+
95+
&--no-shrink {
96+
@media (max-width: 293px) {
97+
padding: 0 var(--padding-7px);
98+
width: auto;
99+
justify-content: initial;
100+
}
101+
}
72102
}
73103
}

‎packages/vscode/src/views/panel/frontend/components/Footer/Footer.tsx‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export const Footer: React.FC = () => {
8585
<div>
8686
{is_apply_visible && (
8787
<button
88-
className={styles['footer__action-button']}
88+
className={cn(
89+
styles['footer__action-button'],
90+
styles['footer__action-button--no-shrink']
91+
)}
8992
onClick={handle_apply_click}
9093
title={'Integrate copied chat response or a single code block'}
9194
disabled={is_apply_disabled_temporarily}
@@ -102,7 +105,16 @@ export const Footer: React.FC = () => {
102105
}
103106
disabled={!can_undo}
104107
>
105-
Undo
108+
<span className={styles['footer__action-button__text']}>
109+
Undo
110+
</span>
111+
<span
112+
className={cn(
113+
styles['footer__action-button__icon'],
114+
'codicon',
115+
'codicon-redo'
116+
)}
117+
/>
106118
</button>
107119
)}
108120
<button
@@ -115,7 +127,16 @@ export const Footer: React.FC = () => {
115127
}
116128
disabled={!has_changes_to_commit || is_commit_disabled_temporarily}
117129
>
118-
Commit
130+
<span className={styles['footer__action-button__text']}>
131+
Commit
132+
</span>
133+
<span
134+
className={cn(
135+
styles['footer__action-button__icon'],
136+
'codicon',
137+
'codicon-git-commit'
138+
)}
139+
/>
119140
</button>
120141
</div>
121142
</div>

0 commit comments

Comments
 (0)