Skip to content

Commit ee40b84

Browse files
committed
Refactor frontend UI components, update README feature descriptions, and enhance UI controls with context-aware disabled states
1 parent bc9d65a commit ee40b84

28 files changed

Lines changed: 238 additions & 228 deletions

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<br/>
44
<h1>Code Web Chat (CWC)</h1>
55
<h4 style="line-height: 1.8">
6-
👉 Copy selected folders and files for web chats or initialize them hands-free!
6+
👉 Select context, type instructions and continue in Chrome or Firefox
77
<br/>
8-
👉 Apply chat responses with truncated, whole or diff markdown code blocks
8+
👉 Apply chat responses in truncated, whole or diff edit formats
99
<br/>
10-
👉 Use the same context for quality code completions and file refactorings
10+
👉 Use SOTA models for quality code completions and file refactorings
1111
<br/>
1212
👉 Generate meaningful commit messages
1313
</h4>
@@ -59,14 +59,14 @@ The result? Unmatched in cost, speed and accuracy AI assistance.
5959
6060
## Web chats
6161

62-
As everyone have their own favorite chatbot, each with unique features and feel, CWC's core feature is their hands-free initialization.
62+
As everyone have their own favorite chatbot, each with unique capabilities, CWC lets you initialize them hands-free!
6363

6464
**The feature has two modes:**
6565

66-
- General - context and your instructions
67-
- Code Completions - context, open editor with marked cursor position
66+
- General - select context and type instructions
67+
- Code Completions - select context and place cursor
6868

69-
Additional texts for model's guidance are fully adjustable in settings.
69+
Generated prompts are simple and adjustable.
7070

7171
**_Apply Chat Response_** is a smart tool that automatically integrates chat responses with the codebase, either refactoring with API ("Truncated" edit format), replacing original files in place ("Whole" edit format) or patching with diffs ("Diff" edit format).
7272

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.header {
2+
display: flex;
3+
flex-direction: column;
4+
overflow: hidden;
5+
6+
&__top {
7+
display: flex;
8+
justify-content: center;
9+
font-size: 13px;
10+
color: var(--vscode-descriptionForeground);
11+
position: relative;
12+
13+
&::before {
14+
content: '';
15+
position: absolute;
16+
width: 100%;
17+
left: 0;
18+
height: 1px;
19+
background-color: var(--vscode-sideBarSectionHeader-border);
20+
top: 50%;
21+
transform: translateY(-50%);
22+
}
23+
24+
> span {
25+
background-color: var(--vscode-sideBar-background);
26+
padding: 0 10px;
27+
z-index: 1;
28+
position: relative;
29+
}
30+
}
31+
32+
&__bottom {
33+
font-size: 16px;
34+
font-weight: bold;
35+
padding: 2px 0 6px 0;
36+
text-align: center;
37+
color: var(--vscode-editor-foreground);
38+
}
39+
40+
&__description {
41+
font-size: 12px;
42+
color: var(--vscode-editor-foreground);
43+
}
44+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { ApiToolHeader } from './ApiToolHeader'
2+
3+
export default {
4+
component: ApiToolHeader,
5+
}
6+
7+
export const Default = () => (
8+
<ApiToolHeader
9+
top_line="API TOOL"
10+
bottom_line="Code Completions"
11+
description="Use any model for accurate code completions. The tool attaches selected context in each request."
12+
/>
13+
)

packages/ui/src/components/editor/ConfigurationHeader/ConfigurationHeader.tsx renamed to packages/ui/src/components/editor/ApiToolHeader/ApiToolHeader.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import React from 'react'
2-
import styles from './ConfigurationHeader.module.scss'
2+
import styles from './ApiToolHeader.module.scss'
33

44
type Props = {
55
top_line: string
66
bottom_line: string
77
description: string
88
}
99

10-
export const ConfigurationHeader: React.FC<Props> = (props) => {
10+
export const ApiToolHeader: React.FC<Props> = (props) => {
1111
return (
1212
<div className={styles.header}>
13-
<div className={styles.header__top}>{props.top_line}</div>
13+
<div className={styles.header__top}>
14+
<span>{props.top_line}</span>
15+
</div>
1416
<div className={styles.header__bottom}>{props.bottom_line}</div>
1517
<div className={styles.header__description}>{props.description}</div>
1618
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './ApiToolHeader'

packages/ui/src/components/editor/ConfigurationHeader/ConfigurationHeader.module.scss

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/ui/src/components/editor/ConfigurationHeader/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/ui/src/components/editor/Header/Header.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
padding: 0 4px;
6868
height: 24px;
6969
border-radius: var(--border-radius-4px);
70-
opacity: 0.3;
70+
opacity: 0.5;
7171

7272
&:focus {
7373
outline: none;

packages/ui/src/components/editor/HorizontalSelector/HorizontalSelector.module.scss

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
.container {
2+
padding: 0 var(--padding-12px);
3+
}
4+
5+
.inner {
26
display: flex;
37
flex-direction: column;
48
gap: var(--padding-4px);
5-
padding: 0 var(--padding-12px);
9+
10+
&--disabled {
11+
pointer-events: none;
12+
opacity: var(--disabled-opacity);
13+
}
614
}
715

816
.heading {
@@ -28,20 +36,15 @@
2836
color: var(--vscode-foreground);
2937
background-color: var(--vscode-list-hoverBackground);
3038

31-
&:disabled {
32-
opacity: var(--disabled-opacity);
33-
cursor: not-allowed;
34-
}
35-
36-
&:hover:enabled {
39+
&:hover {
3740
background-color: var(--vscode-toolbar-hoverBackground);
3841
}
3942

4043
&--selected {
4144
color: var(--vscode-button-foreground);
4245
background-color: var(--vscode-button-background);
4346

44-
&:hover:enabled {
47+
&:hover {
4548
background-color: var(--vscode-button-hoverBackground);
4649
}
4750
}

packages/ui/src/components/editor/HorizontalSelector/HorizontalSelector.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export const EditFormatExample = () => {
3333
options={options}
3434
selected_value={format}
3535
on_select={set_format}
36+
disabled_state_title=""
37+
is_disabled={false}
3638
/>
3739
)
3840
}
@@ -52,6 +54,8 @@ export const GenericExample = () => {
5254
options={options}
5355
selected_value={value}
5456
on_select={set_value}
57+
disabled_state_title=""
58+
is_disabled={false}
5559
/>
5660
)
5761
}

0 commit comments

Comments
 (0)