Skip to content

Commit 5b03a7e

Browse files
committed
Update UI styling and progress display for dropdowns, tooltips, and intelligent update components
1 parent 1551b66 commit 5b03a7e

8 files changed

Lines changed: 47 additions & 37 deletions

File tree

‎packages/ui/src/components/editor/common/DropdownMenu/DropdownMenu.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
&__inner {
1212
background-color: var(--vscode-quickInput-background);
1313
border-radius: 8px;
14-
border: 1px solid var(--vscode-widget-border);
14+
border: 1px solid var(--cwc-border-color-dimmed);
1515
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
1616
padding: 4px;
1717
}

‎packages/ui/src/components/editor/panel/PromptField/components/Tooltip.module.scss‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
padding: 3px 6px;
1313
border-radius: 6px;
1414
background-color: var(--vscode-quickInput-background);
15-
border: 1px solid var(--vscode-widget-border);
16-
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
15+
border: 1px solid var(--cwc-border-color-dimmed);
16+
box-shadow: 0 0 10px var(--vscode-widget-shadow);
1717
pointer-events: none;
1818

1919
&--warning {
@@ -31,7 +31,7 @@
3131
border-left: 5px solid transparent;
3232
border-right: 5px solid transparent;
3333
border-top: 5px solid var(--vscode-quickInput-background);
34-
filter: drop-shadow(0 1px 0.5px var(--vscode-widget-border));
34+
filter: drop-shadow(0 1px 0.5px var(--cwc-border-color-dimmed));
3535
}
3636

3737
&--align-left {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
flex-direction: column;
111111
gap: 8px;
112112
margin: 0 12px;
113-
padding: 6px 8px 8px 8px;
113+
padding: 7px 9px 9px 9px;
114114
border-radius: 6px;
115115
background: var(--cwc-bg-tertiary);
116116

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,8 @@ export const ResponsePreview: FC<Props> = (props) => {
128128
if (file.apply_status == 'thinking') return 'Thinking...'
129129
if (file.apply_status == 'retrying') return 'Retrying...'
130130
if (file.apply_status == 'receiving') {
131-
const progress = file.apply_progress ?? 0
132131
const tps = file.apply_tokens_per_second
133-
let text = `${progress}%`
134-
if (tps) text += ` (${tps} tokens/s)`
135-
return text
132+
return tps ? `${tps} tokens/s` : 'Receiving...'
136133
}
137134
if (file.apply_status == 'done') return 'Done'
138135
return ''
@@ -231,6 +228,7 @@ export const ResponsePreview: FC<Props> = (props) => {
231228
file_path: f.file_path,
232229
workspace_name: f.workspace_name
233230
}))
231+
console.log('xxx', files_to_fix)
234232
props.on_fix_all_failed(files_to_fix)
235233
}}
236234
>

‎packages/ui/src/components/editor/panel/ResponsePreview/components/FileItem/FileItem.tsx‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ export const FileItem: FC<Props> = (props) => {
6565
else if (props.file.apply_status == 'thinking') status_text = 'Thinking...'
6666
else if (props.file.apply_status == 'retrying') status_text = 'Retrying...'
6767
else if (props.file.apply_status == 'receiving') {
68-
const progress = props.file.apply_progress ?? 0
6968
const tps = props.file.apply_tokens_per_second
70-
status_text = `${progress}%`
71-
if (tps) status_text += ` (${tps} tokens/s)`
69+
if (tps) status_text = `${tps} tokens/s`
7270
} else if (props.file.apply_status == 'done') status_text = 'Done'
7371

7472
return (
@@ -90,6 +88,17 @@ export const FileItem: FC<Props> = (props) => {
9088
)
9189
}
9290

91+
const progress =
92+
props.file.apply_status == 'receiving'
93+
? (props.file.apply_progress ?? 0)
94+
: 0
95+
const container_style =
96+
props.file.apply_status == 'receiving'
97+
? {
98+
backgroundImage: `linear-gradient(to right, var(--cwc-bg-secondary) ${progress}%, transparent ${progress}%)`
99+
}
100+
: undefined
101+
93102
return (
94103
<div className={styles.container}>
95104
<div
@@ -100,6 +109,7 @@ export const FileItem: FC<Props> = (props) => {
100109
onClick={
101110
props.file.file_state == 'deleted' ? undefined : props.on_click
102111
}
112+
style={container_style}
103113
role="button"
104114
title={props.file.file_path}
105115
>

‎packages/ui/src/components/editor/panel/modals/ActiveEditorIntelligentUpdateModal/ActiveEditorIntelligentUpdateModal.tsx‎

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from 'react'
1+
import { FC } from 'react'
22
import styles from './ActiveEditorIntelligentUpdateModal.module.scss'
33
import { Button } from '../../../common/Button'
44
import { Modal } from '../Modal'
@@ -40,21 +40,7 @@ const get_status_text = (status: FileProgressStatus): string => {
4040
}
4141
}
4242

43-
export const ActiveEditorIntelligentUpdateModal: React.FC<Props> = (props) => {
44-
const [elapsed_time, set_elapsed_time] = useState(0)
45-
46-
useEffect(() => {
47-
set_elapsed_time(0)
48-
const start_time = Date.now()
49-
const elapsed_time_timer = setInterval(() => {
50-
set_elapsed_time((Date.now() - start_time) / 1000)
51-
}, 100)
52-
53-
return () => {
54-
clearInterval(elapsed_time_timer)
55-
}
56-
}, [])
57-
43+
export const ActiveEditorIntelligentUpdateModal: FC<Props> = (props) => {
5844
return (
5945
<div
6046
onKeyDown={(e) => {
@@ -79,18 +65,17 @@ export const ActiveEditorIntelligentUpdateModal: React.FC<Props> = (props) => {
7965
{get_status_text(props.status)}
8066
</div>
8167
<div className={styles['file-item__bottom__right']}>
68+
{props.status == 'receiving' &&
69+
props.progress !== undefined && (
70+
<div>{Math.round(props.progress)}%</div>
71+
)}
8272
{props.status == 'receiving' &&
8373
props.tokens_per_second !== undefined && (
8474
<div>
85-
~{format_tokens(props.tokens_per_second)}{' '}
86-
tokens/s
75+
({format_tokens(props.tokens_per_second)}{' '}
76+
tokens/s)
8777
</div>
8878
)}
89-
{props.status == 'receiving' &&
90-
props.total_tokens !== undefined && (
91-
<div>({format_tokens(props.total_tokens)})</div>
92-
)}
93-
<div>{elapsed_time.toFixed(1)}s</div>
9479
</div>
9580
</div>
9681
<div className={styles.progress}>

‎packages/ui/src/components/editor/panel/modals/ApiManagerModal/ApiManagerModal.module.scss‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
pointer-events: none;
1212
}
1313

14+
@keyframes slideIn {
15+
from {
16+
opacity: 0;
17+
transform: translateY(8px);
18+
}
19+
to {
20+
opacity: 1;
21+
transform: translateY(0);
22+
}
23+
}
24+
1425
.container {
1526
display: flex;
1627
flex-direction: column;
@@ -25,6 +36,8 @@
2536
width: 100%;
2637
max-width: min(260px, 70vw);
2738
overflow: hidden;
39+
animation: slideIn var(--transition-duration-250)
40+
var(--transition-timing-function);
2841
}
2942

3043
.title {
@@ -59,6 +72,10 @@
5972
width: 100%;
6073
position: relative;
6174

75+
&:nth-child(even) {
76+
background-color: var(--cwc-bg-tertiary);
77+
}
78+
6279
&__top {
6380
display: flex;
6481
align-items: center;
@@ -102,7 +119,7 @@
102119
&__right {
103120
display: flex;
104121
align-items: center;
105-
gap: 6px;
122+
gap: 4px;
106123
flex-shrink: 0;
107124
font-variant-numeric: tabular-nums;
108125
}

‎packages/ui/src/components/editor/panel/modals/Modal/Modal.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
display: flex;
6868
gap: 8px;
6969
padding: 12px;
70-
border-top: 1px solid var(--vscode-widget-border);
70+
border-top: 1px solid var(--cwc-border-color-dimmed);
7171

7272
> button {
7373
flex: 1;

0 commit comments

Comments
 (0)