Skip to content

Commit 101f6e3

Browse files
committed
Refactor sticky mode layout and update extension description and version
1 parent 2cd1860 commit 101f6e3

4 files changed

Lines changed: 36 additions & 32 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@
4444
display: flex;
4545
justify-content: space-between;
4646
align-items: center;
47-
cursor: grab;
47+
cursor: grab;
4848
margin-bottom: 2px;
4949
}
5050

5151
&__header-left {
5252
display: flex;
5353
align-items: center;
5454
padding-top: 3px;
55-
5655
}
5756

5857
&__time {

‎packages/vscode/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
4-
"description": "CWC, the autofill for chatbots",
5-
"version": "1.713.0",
4+
"description": "CWC—coding prompts for chatbots",
5+
"version": "1.714.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

‎packages/vscode/src/views/panel/frontend/Home/Home.module.scss‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
gap: 24px;
7171
height: 100%;
7272
padding-top: 4px;
73+
74+
&--sticky {
75+
margin-top: 44px;
76+
}
7377
}
7478

7579
.inner {
@@ -81,25 +85,15 @@
8185
margin: 0;
8286
}
8387

84-
&__mode-wrapper {
85-
margin: 0 12px;
86-
z-index: 1;
87-
88-
&--sticky {
89-
position: sticky;
90-
top: 10px;
91-
animation: stickyFadeIn var(--transition-duration-150)
92-
var(--transition-timing-function);
93-
}
94-
}
95-
9688
&__mode {
9789
position: relative;
9890
display: flex;
9991
background-color: var(--vscode-sideBar-background);
10092
border-radius: 10px;
10193
border: 1px solid var(--cwc-border-color);
10294
overflow: hidden;
95+
margin: 0 12px;
96+
z-index: 1;
10397

10498
> button {
10599
flex: 1;
@@ -119,6 +113,10 @@
119113

120114
&--sticky {
121115
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
116+
position: sticky;
117+
top: 10px;
118+
animation: stickyFadeIn var(--transition-duration-150)
119+
var(--transition-timing-function);
122120

123121
&::after {
124122
height: 20px;

‎packages/vscode/src/views/panel/frontend/Home/Home.tsx‎

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,18 @@ export const Home: React.FC<Props> = (props) => {
107107
full_mode_height_ref.current = current_mode_height
108108
}
109109

110-
const height_to_use = is_mode_sticky ? full_mode_height_ref.current : current_mode_height
110+
const height_to_use = is_mode_sticky
111+
? full_mode_height_ref.current
112+
: current_mode_height
111113

112114
set_is_mode_sticky(top > responses_height + height_to_use + 4)
113115
}}
114116
>
115-
<div className={styles.content}>
117+
<div
118+
className={cn(styles.content, {
119+
[styles['content--sticky']]: is_mode_sticky
120+
})}
121+
>
116122
<div className={styles.inner}>
117123
{props.response_history.length > 0 && (
118124
<div className={styles.inner__responses} ref={responses_ref}>
@@ -135,22 +141,23 @@ export const Home: React.FC<Props> = (props) => {
135141
)}
136142

137143
<div
138-
className={cn(styles['inner__mode-wrapper'], {
139-
[styles['inner__mode-wrapper--sticky']]: is_mode_sticky
144+
className={cn(styles.inner__mode, {
145+
[styles['inner__mode--sticky']]: is_mode_sticky
140146
})}
141-
style={{
142-
minHeight: is_mode_sticky ? full_mode_height_ref.current : undefined
143-
}}
147+
ref={mode_ref}
144148
>
145-
<div
146-
className={cn(styles.inner__mode, {
147-
[styles['inner__mode--sticky']]: is_mode_sticky
148-
})}
149-
ref={mode_ref}
150-
>
151-
<ModeButton pre="Autofill" label="Chatbots" on_click={props.on_chatbots_click} is_compact={is_mode_sticky} />
152-
<ModeButton pre="Make" label="API calls" on_click={props.on_api_calls_click} is_compact={is_mode_sticky} />
153-
</div>
149+
<ModeButton
150+
pre="Autofill"
151+
label="Chatbots"
152+
on_click={props.on_chatbots_click}
153+
is_compact={is_mode_sticky}
154+
/>
155+
<ModeButton
156+
pre="Make"
157+
label="API calls"
158+
on_click={props.on_api_calls_click}
159+
is_compact={is_mode_sticky}
160+
/>
154161
</div>
155162

156163
<Separator height={8} />

0 commit comments

Comments
 (0)