Skip to content

Commit 92a2eea

Browse files
committed
Merge branch 'dev'
2 parents b9317e2 + 629d0db commit 92a2eea

13 files changed

Lines changed: 85 additions & 43 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.input {
2-
border: 1px solid var(--cwc-stroke-primary);
2+
border: 1px solid var(--cwc-border-color);
33
background: var(--vscode-input-background);
44
color: var(--vscode-input-foreground);
55
padding: var(--padding-4px) var(--padding-8px);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
gap: var(--padding-4px);
99
padding: 0 var(--padding-5px) 0 var(--padding-7px);
1010
height: 24px;
11-
border: 1px solid var(--vscode-dropdown-border);
11+
border: 1px solid var(--cwc-border-color-dimmed);
1212
border-radius: var(--border-radius-4px);
1313
cursor: pointer;
1414
color: var(--vscode-foreground);
1515
width: 100%;
1616

1717
&:hover {
18-
border-color: var(--vscode-commandCenter-activeBorder);
18+
border-color: var(--cwc-border-color);
1919
}
2020

2121
&--open {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
.footer {
2929
gap: var(--padding-8px);
3030
padding: var(--padding-12px);
31-
border-top: 1px solid var(--vscode-sideBarSectionHeader-border);
31+
border-top: 1px solid var(--cwc-border-color-dimmed);
3232
}

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,33 @@
2222

2323
.instructions {
2424
position: relative;
25-
padding: var(--padding-5px) 15px var(--padding-5px) var(--padding-7px);
26-
border: 1px solid var(--vscode-sideBarSectionHeader-border);
2725
margin: 0 var(--padding-12px);
28-
border-radius: var(--border-radius-10px);
2926
word-wrap: break-word;
30-
overflow: hidden;
3127
display: -webkit-box;
3228
-webkit-line-clamp: 3;
3329
-webkit-box-orient: vertical;
30+
overflow: hidden;
31+
font-size: 14px;
32+
line-height: 1.3;
33+
font-weight: 600;
3434

35-
&::after {
36-
position: absolute;
37-
content: '';
38-
width: 100%;
39-
height: 4px;
40-
bottom: 0;
41-
left: 0;
42-
background: var(--vscode-sideBar-background);
35+
&--large {
36+
font-size: 16px;
4337
}
38+
39+
&--small {
40+
font-size: 13px;
41+
}
42+
43+
// &::after {
44+
// position: absolute;
45+
// content: '';
46+
// width: 100%;
47+
// height: 4px;
48+
// bottom: 0;
49+
// left: 0;
50+
// background: var(--vscode-sideBar-background);
51+
// }
4452
}
4553

4654
.list {

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,24 @@ export const WithText = () => (
145145
]}
146146
/>
147147
)
148+
149+
export const WithShortInstructions = () => (
150+
<InteractiveResponsePreview
151+
items={base_files}
152+
raw_instructions="This is a short instruction."
153+
/>
154+
)
155+
156+
export const WithMediumInstructions = () => (
157+
<InteractiveResponsePreview
158+
items={base_files}
159+
raw_instructions="This is a medium length instruction, it should have the default font size and it's here to demonstrate the behavior."
160+
/>
161+
)
162+
163+
export const WithLongInstructions = () => (
164+
<InteractiveResponsePreview
165+
items={base_files}
166+
raw_instructions="This is a very long instruction, it is designed to be very long to test the small font size. It should wrap and clamp to three lines. We need to make sure this text is long enough to trigger the smaller font size. This should be more than 160 characters for sure."
167+
/>
168+
)

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ export const ResponsePreview: FC<Props> = (props) => {
7272
) as FileInPreview[]
7373
const fallback_count = files_in_preview.filter((f) => f.is_fallback).length
7474

75+
const get_instructions_font_size_class = (text: string): string => {
76+
const length = text.length
77+
if (length < 80) {
78+
return styles['instructions--large']
79+
} else if (length > 160) {
80+
return styles['instructions--small']
81+
}
82+
return ''
83+
}
84+
7585
return (
7686
<Scrollable
7787
ref={scrollable_ref}
@@ -85,7 +95,13 @@ export const ResponsePreview: FC<Props> = (props) => {
8595
>
8696
<div className={styles.container}>
8797
{props.raw_instructions && (
88-
<div className={styles.instructions} title={props.raw_instructions}>
98+
<div
99+
className={cn(
100+
styles.instructions,
101+
get_instructions_font_size_class(props.raw_instructions)
102+
)}
103+
title={props.raw_instructions}
104+
>
89105
{props.raw_instructions}
90106
</div>
91107
)}
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
.text {
2-
color: var(--vscode-descriptionForeground);
3-
42
margin: var(--padding-6px) var(--padding-12px);
5-
background: var(--vscode-list-hoverBackground);
6-
padding: var(--padding-5px) var(--padding-7px);
7-
border-radius: var(--border-radius-8px);
83
word-wrap: break-word;
94

105
> * {
116
margin: 0;
127
font-size: var(--font-size-13px);
138
}
9+
1410
> * + * {
1511
margin-top: 0.5em;
1612
}
13+
1714
ul,
1815
ol {
1916
padding-left: 20px;
2017
}
18+
2119
code {
2220
font-size: var(--font-size-11px);
2321
background-color: var(--vscode-textCodeBlock-background);
@@ -29,17 +27,13 @@
2927
max-height: 50px;
3028
overflow: hidden;
3129
position: relative;
30+
color: var(--vscode-descriptionForeground);
3231

33-
> * {
34-
margin: 0;
35-
font-size: var(--font-size-12px);
32+
&:hover {
33+
color: inherit;
3634
}
3735
}
3836

39-
&--expandable {
40-
cursor: pointer;
41-
}
42-
4337
&--overflowing::after {
4438
content: '';
4539
position: absolute;
@@ -50,7 +44,7 @@
5044
background: linear-gradient(
5145
to bottom,
5246
transparent,
53-
var(--vscode-list-hoverBackground)
47+
var(--vscode-sideBar-background)
5448
);
5549
}
5650
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const TextItem: FC<Props> = ({ content, is_expanded, on_toggle }) => {
2525
<div
2626
ref={ref}
2727
className={cn(styles.text, {
28-
[styles['text--expandable']]: is_expanded || is_overflowing,
2928
[styles['text--collapsed']]: !is_expanded,
3029
[styles['text--overflowing']]: !is_expanded && is_overflowing
3130
})}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
.textarea {
22
display: flex;
33
width: 100%;
4-
background-color: var(--vscode-input-background);
5-
color: var(--vscode-input-foreground);
6-
border: 1px solid var(--vscode-input-border);
74
border-radius: var(--border-radius-5px);
85
padding: var(--padding-5px) var(--padding-6px);
96
resize: none;
107
font-family: var(--vscode-font-family);
118
font-size: var(--vscode-font-size);
129
overflow: hidden;
10+
border: 1px solid var(--cwc-border-color);
11+
background: var(--vscode-input-background);
12+
color: var(--vscode-input-foreground);
1313

1414
&:focus {
1515
outline: 1px solid var(--vscode-focusBorder);

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,24 @@
4949
display: flex;
5050
gap: var(--padding-8px);
5151
padding: var(--padding-12px);
52-
border-top: 1px solid var(--cwc-border-color);
52+
border-top: 1px solid var(--cwc-border-color-dimmed);
5353

5454
> button {
5555
flex: 1;
5656
}
5757
}
5858

5959
.container {
60+
display: flex;
61+
flex-direction: column;
6062
position: relative;
6163
z-index: 1;
6264
border-radius: var(--border-radius-12px);
63-
border: 1px solid var(--cwc-border-color);
65+
border: 1px solid var(--cwc-border-color-dimmed);
6466
width: 100%;
6567
max-width: 320px;
6668
background-color: var(--vscode-quickInput-background);
6769
color: var(--vscode-quickInput-foreground);
68-
border: 1px solid var(--vscode-widget-border);
69-
display: flex;
70-
flex-direction: column;
7170

7271
&--full-width {
7372
max-width: none;

0 commit comments

Comments
 (0)