Skip to content

Commit 8659f74

Browse files
committed
Refactor progress visibility and dropdown info display for improved UI consistency
1 parent d684d72 commit 8659f74

6 files changed

Lines changed: 14 additions & 15 deletions

File tree

‎apps/editor/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const apply_chat_response_command = (params: {
144144
params.panel_provider.send_message({
145145
command: 'SHOW_PROGRESS',
146146
title: 'Preparing response preview...',
147-
delay_visibility: file_count < 5
147+
delay_visibility: file_count == 1
148148
})
149149
}
150150

‎apps/editor/src/views/panel/frontend/Main/MainView/components/Header/Header.tsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type Props = {
2929
export const Header: React.FC<Props> = (props) => {
3030
const { t } = use_translation()
3131
const header_ref = useRef<HTMLDivElement>(null)
32-
const is_narrow_viewport = use_is_narrow_viewport(330)
32+
const is_narrow_viewport = use_is_narrow_viewport(290)
3333
const is_mac = use_is_mac()
3434
const header_left_ref = useRef<HTMLDivElement>(null)
3535
const dropdown_container_ref = useRef<HTMLDivElement>(null)
@@ -85,9 +85,7 @@ export const Header: React.FC<Props> = (props) => {
8585
selected_value={props.web_prompt_type}
8686
on_change={props.on_web_prompt_type_change}
8787
menu_max_width="calc(100vw - 52px)"
88-
info={
89-
is_narrow_viewport ? undefined : t('panel.header.prompt-type')
90-
}
88+
info={t('panel.header.prompt-type')}
9189
title={
9290
is_mac
9391
? 'Change prompt type (⇧⌥)'

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
}
1818
}
1919

20+
.header {
21+
padding: 0 6px 4px 6px;
22+
font-size: 12px;
23+
color: var(--cwc-text-color-dimmed);
24+
border-bottom: 1px solid var(--cwc-border-color-dimmed);
25+
margin-bottom: 4px;
26+
}
27+
2028
.item {
2129
display: flex;
2230
justify-content: space-between;

‎packages/ui/src/components/editor/common/DropdownMenu/DropdownMenu.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export namespace DropdownMenu {
1414
items: Item[]
1515
underline_non_selected_items?: boolean
1616
max_width?: number | string
17+
info?: string
1718
}
1819
}
1920

@@ -26,6 +27,7 @@ export const DropdownMenu: React.FC<DropdownMenu.Props> = (props) => {
2627
return (
2728
<div className={styles.menu} style={{ maxWidth: props.max_width }}>
2829
<div className={styles.menu__inner}>
30+
{props.info && <div className={styles.header}>{props.info}</div>}
2931
{props.items.map((item, index) => {
3032
const is_selected = item.is_selected && is_preselection_respected
3133
const should_underline =

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
text-align: left;
3333
}
3434

35-
&__info {
36-
font-size: 11px;
37-
color: var(--cwc-text-color-dimmed);
38-
white-space: nowrap;
39-
padding-left: 3px;
40-
}
41-
4235
&__icon {
4336
color: var(--vscode-icon-foreground);
4437
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ export const Dropdown = <T extends string>(props: Dropdown.Props<T>) => {
143143
<span className={styles.button__label}>
144144
{selected_option ? selected_option.label : 'Select an option'}
145145
</span>
146-
{props.info && (
147-
<span className={styles.button__info}>{props.info}</span>
148-
)}
149146
{is_open ? (
150147
<span
151148
className={cn('codicon', 'codicon-chevron-up', styles.button__icon)}
@@ -171,6 +168,7 @@ export const Dropdown = <T extends string>(props: Dropdown.Props<T>) => {
171168
}))}
172169
underline_non_selected_items={opened_by_shortcut.current}
173170
max_width={props.menu_max_width}
171+
info={props.info}
174172
/>
175173
)}
176174
</div>

0 commit comments

Comments
 (0)