Skip to content

Commit 99b060d

Browse files
committed
Refine layout and styling across editor panels and modal components to improve UI consistency
- modal's form content should use 'simple bar'. Make it no higher than 80vh - `apps/editor/src/views/shared/components/EditWebConfigurationForm/EditWebConfigurationForm.tsx` already uses 'scrollable' so modal should not use simplebar, but make it work (limit max height appropriately) - the form content can't be scrolled - the modal should stop growing once form's children height is reached. Make sure to not break scrolling once there is not enough space to fit it. - should mount with 'options' collapsed when no option is selected
1 parent 2173302 commit 99b060d

12 files changed

Lines changed: 47 additions & 40 deletions

File tree

‎apps/editor/src/views/panel/frontend/Home/Home.module.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
justify-content: space-between;
4343
gap: 24px;
4444
height: 100%;
45-
padding-top: 4px;
4645

4746
&--sticky {
4847
margin-top: 44px;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ export const MainView: React.FC<Props> = (props) => {
327327
is_setup_complete={props.is_setup_complete}
328328
/>
329329
<UiScrollable scroll_to_top_key={props.scroll_reset_key}>
330-
<UiSeparator height={4} />
331-
332330
{is_in_find_relevant_files_prompt_type && (
333331
<div className={styles['shrink-source-code-checkbox']}>
334332
<UiCheckbox

‎apps/editor/src/views/shared/components/EditWebConfigurationForm/EditWebConfigurationForm.module.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.form {
22
display: flex;
33
flex-direction: column;
4-
gap: 12px;
5-
padding: 4px 12px 12px 12px;
4+
gap: 16px;
5+
padding: 0 12px 12px 12px;
66
}
77

88
.options {

‎apps/editor/src/views/shared/components/EditWebConfigurationForm/EditWebConfigurationForm.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const EditWebConfigurationForm: React.FC<Props> = (props) => {
5050
props.web_configuration.temperature === undefined && props.web_configuration.top_p === undefined
5151
)
5252
const [is_options_collapsed, set_is_options_collapsed] = useState(
53-
!props.web_configuration.options?.length
53+
(props.web_configuration.options || []).length == 0
5454
)
5555

5656
const chatbot_config = chatbot ? CHATBOTS[chatbot] : undefined

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
.fieldset {
22
display: flex;
33
flex-direction: column;
4-
border: 1px solid var(--cwc-border-color-dimmed);
5-
border-radius: 10px;
4+
gap: 8px;
65

76
&__label {
8-
padding: 8px 10px 8px 10px;
97
font-size: 11px;
108
font-weight: 600;
119
color: var(--cwc-text-color-dimmed);
@@ -27,6 +25,5 @@
2725
display: flex;
2826
flex-direction: column;
2927
gap: 8px;
30-
padding: 2px 10px 10px 10px;
3128
}
3229
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
justify-content: space-between;
1313
margin: 6px 12px;
1414
position: relative;
15-
height: 20px;
1615

1716
&__title {
1817
position: absolute;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
overflow: hidden;
33
flex: 1;
44
position: relative;
5+
height: 100%;
56

67
&--shadow::before {
78
content: '';

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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
.container {
2+
display: flex;
3+
flex-direction: column;
4+
position: relative;
5+
z-index: 1;
6+
border-radius: 12px;
7+
width: 100%;
8+
max-width: 320px;
9+
background-color: var(--vscode-sideBar-background);
10+
border: 1px solid var(--cwc-border-color);
11+
12+
&--full-width {
13+
max-width: none;
14+
}
15+
}
16+
117
.overlay {
218
position: absolute;
319
top: 0;
@@ -94,20 +110,3 @@
94110
flex: 1;
95111
}
96112
}
97-
98-
.container {
99-
display: flex;
100-
flex-direction: column;
101-
position: relative;
102-
z-index: 1;
103-
border-radius: 12px;
104-
width: 100%;
105-
max-width: 320px;
106-
color: var(--vscode-quickInput-foreground);
107-
background-color: var(--vscode-quickInput-background);
108-
border: 1px solid var(--cwc-border-color);
109-
110-
&--full-width {
111-
max-width: none;
112-
}
113-
}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
.form {
22
display: flex;
33
flex-direction: column;
4-
padding: 24px;
54
background-color: var(--vscode-editor-background);
65
color: var(--vscode-editor-foreground);
76
border-radius: 8px;
8-
min-width: 300px;
9-
gap: 24px;
10-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
7+
width: 350px;
8+
border: 1px solid var(--cwc-border-color);
119
}
1210

1311
.header {
1412
text-align: center;
1513
font-size: 16px;
1614
font-weight: 600;
1715
margin: 0;
18-
}
19-
20-
.body {
21-
flex: 1;
16+
padding: 12px;
2217
}
2318

2419
.footer {
2520
display: flex;
2621
justify-content: flex-end;
2722
gap: 12px;
23+
padding: 12px;
24+
border-top: 1px solid var(--cwc-border-color-dimmed);
2825
}

‎packages/ui/src/components/editor/settings/Modal/Form/Form.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ export type FormProps = {
1010
save_label?: string
1111
}
1212

13-
export const Form: React.FC<FormProps> = ({ title, children, on_save, on_cancel, save_label = 'Save' }) => {
13+
export const Form: React.FC<FormProps> = ({
14+
title,
15+
children,
16+
on_save,
17+
on_cancel,
18+
save_label = 'Save'
19+
}) => {
1420
return (
1521
<div className={styles.form}>
1622
<div className={styles.header}>{title}</div>
17-
<div className={styles.body}>{children}</div>
23+
{children}
1824
<div className={styles.footer}>
1925
{on_cancel && (
2026
<Button is_secondary on_click={on_cancel}>

0 commit comments

Comments
 (0)