Skip to content

Commit 733db19

Browse files
committed
Merge branch 'dev'
2 parents 21ee864 + fbe97fd commit 733db19

21 files changed

Lines changed: 440 additions & 313 deletions

File tree

‎README.md‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
<a href="https://marketplace.visualstudio.com/items?itemName=robertpiosik.gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-VS_Code_Marketplace-blue" alt="Get from Visual Studio Code Marketplace" /></a> <a href="https://open-vsx.org/extension/robertpiosik/gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-Open_VSX_Registry-a60ee5" alt="Get from Open VSX Registry" /></a> <a href="https://github.com/robertpiosik/CodeWebChat/blob/dev/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-GPL--3.0-green.svg" alt="GPL-3.0 license" /></a>
44

5-
Blazing fast AI pair programming for production-grade code. Select context as you go for pro accuracy and game-changing speed.
5+
Blazing fast AI pair programming for production-grade code. Select context as you go for game-changing accuracy and speed.
66

7-
Works with **VS Code**, and forks like **Cursor**, **Windsurf**, **VSCodium**, etc.
7+
Works with **VS Code** and forks like **Cursor**, **Windsurf**, **VSCodium**, etc.
88

9-
✅ **Sends prompts everywhere**
9+
✅ **Send prompts anywhere**
1010

1111
- Chatbots—_ChatGPT, Claude, Gemini, AI Studio, Qwen, etc._
1212
- Model providers—_Gemini API, OpenRouter, local Ollama, etc._
1313

14-
✅ **Applies responses**—multi-file changes integration with easy rollback \
15-
🔋 **Batteries included**—code completions, commit messages, checkpoints... \
14+
✅ **Apply responses**—one-click multi-file changes integration with easy rollback \
15+
✅ **Essential tools**—code completions, commit messages, checkpoints... \
16+
👥 **Community driven**—join our [Discord server](https://discord.com/invite/KJySXsrSX5) and get involved! \
1617
❤️ **Free and open-source**—released under the GPL-3.0 license \
1718
🔒️ **Total privacy**—operates 100% on your local machine
1819

@@ -22,6 +23,10 @@ Works with **VS Code**, and forks like **Cursor**, **Windsurf**, **VSCodium**, e
2223

2324
## Introduction
2425

26+
👨‍⚖️ **Respect to chatbots' Terms of Use**
27+
28+
Code Web Chat helps you use your favorite coding web tools like ChatGPT's canvas. The idea to initialize chatbots is borrowed from [Firefox](https://support.mozilla.org/en-US/kb/ai-chatbot) and because there is no further automation once the prompt is sent, by using CWC you're not violating their Terms of Use. Contributors should not submit pull requests implementing further chat automations of any kind, as these will be kindly rejected.
29+
2530
🧑‍💻 **Guide the model with context**
2631

2732
Large language models (LLMs) are trained on vast datasets targeting many use cases. For code generation, a model's training involves analyzing millions of simulated problem-solving flows, such as arriving at the accepted answer from a given StackOverflow question. For the purpose of agentic coding, models are trained on an additional layer of data that simulates gathering context and planning its next steps.
@@ -30,7 +35,7 @@ Because the model is only as smart as examples it has seen in its pre-training s
3035

3136
Therefore, CWC is designed to align with LLMs' true capabilities—that is, code generation in a controlled signal-to-noise ratio environment. Controlled by you, the engineer.
3237

33-
👋 **Meet the non-agentic workflow**
38+
🙋 **Meet the non-agentic workflow**
3439

3540
Select folders and files for context, enter instructions, and send message via...
3641

@@ -95,11 +100,7 @@ Install the [open-source](https://github.com/robertpiosik/CodeWebChat/blob/dev/p
95100
> [!TIP]
96101
> With the browser extension you can include markdown-parsed websites in context. Go to target website, click the extension's icon in the browser's toolbar and click _Enable for context_.
97102
98-
👨‍⚖️ **With respect to Terms of Use**
99-
100-
The automations are limited changing chatbot settings (like the selected model), entering prompt, and optionally submitting. This idea is borrowed from [Firefox](https://support.mozilla.org/en-US/kb/ai-chatbot) and is not against any of the supported chatbots' Terms of Use. Contributors should not submit pull requests implementing further chat automations of any kind, as these will be kindly rejected.
101-
102-
> [!NOTE]
103+
> [!IMPORTANT]
103104
> The _Apply response_ button placed under responses is not a means of automatic output extraction, it's an alias for the original _copy to clipboard_ button. Review the [content script](https://github.com/robertpiosik/CodeWebChat/blob/dev/packages/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts) for implementation details.
104105
105106
## API Tools
Lines changed: 2 additions & 11 deletions
Loading

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,29 @@
7676
}
7777
}
7878

79+
.clear-button {
80+
position: absolute;
81+
top: 0;
82+
right: 0;
83+
z-index: 2;
84+
width: 18px;
85+
height: 18px;
86+
display: flex;
87+
align-items: center;
88+
justify-content: center;
89+
cursor: pointer;
90+
color: var(--vscode-icon-foreground);
91+
opacity: var(--dimmed-opacity);
92+
93+
&::before {
94+
font-size: 13px !important;
95+
}
96+
97+
&:hover {
98+
opacity: 1;
99+
}
100+
}
101+
79102
.highlight-container {
80103
position: absolute;
81104
top: 0;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
4949
handle_select_click
5050
} = use_dropdown(props)
5151
const {
52+
handle_clear,
5253
handle_select,
5354
handle_input_change,
5455
handle_submit,
@@ -173,6 +174,16 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
173174
}}
174175
ref={container_ref}
175176
>
177+
{props.value && (
178+
<button
179+
className={cn(styles['clear-button'], 'codicon', 'codicon-close')}
180+
onClick={() => {
181+
handle_clear()
182+
textarea_ref.current?.focus()
183+
}}
184+
title="Clear"
185+
/>
186+
)}
176187
<div className={styles['highlight-container']} ref={highlight_ref}>
177188
{get_highlighted_text({
178189
text: props.value,

‎packages/ui/src/components/editor/panel/ChatInput/hooks/use-handlers.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export const use_handlers = (props: ChatInputProps) => {
1111
props.on_caret_position_change(caret_position)
1212
}
1313

14+
const handle_clear = () => {
15+
props.on_change('')
16+
set_history_index(-1)
17+
set_is_history_enabled(true)
18+
}
19+
1420
const handle_input_change = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
1521
const new_value = e.target.value
1622
props.on_change(new_value)
@@ -103,6 +109,7 @@ export const use_handlers = (props: ChatInputProps) => {
103109
handle_input_change,
104110
handle_submit,
105111
handle_key_down,
106-
is_history_enabled
112+
is_history_enabled,
113+
handle_clear
107114
}
108115
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@
3232
}
3333
}
3434
}
35+
36+
.footer {
37+
display: flex;
38+
gap: var(--padding-8px);
39+
padding: var(--padding-12px);
40+
border-top: 1px solid var(--vscode-sideBarSectionHeader-border);
41+
42+
> button {
43+
flex: 1;
44+
}
45+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const Primary = () => (
99
title="Lorem ipsum"
1010
on_back_click={() => {}}
1111
header_slot={'header slot'}
12+
footer_slot={'footer slot'}
1213
>
1314
<div style={{ padding: 'var(--padding-12px)' }}>
1415
<p>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Props = {
77
on_back_click?: () => void
88
on_close_click?: () => void
99
header_slot?: React.ReactNode
10+
footer_slot?: React.ReactNode
1011
children: React.ReactNode
1112
}
1213

@@ -38,6 +39,9 @@ export const Page: React.FC<Props> = (props) => {
3839
</div>
3940
</div>
4041
<Scrollable>{props.children}</Scrollable>
42+
{props.footer_slot && (
43+
<div className={styles.footer}>{props.footer_slot}</div>
44+
)}
4145
</div>
4246
)
4347
}

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

Lines changed: 68 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
display: flex;
33
flex-direction: column;
44
padding-top: var(--padding-4px);
5+
gap: var(--padding-8px);
56
}
67

78
.info {
@@ -24,7 +25,7 @@
2425
padding: var(--padding-5px) var(--padding-7px);
2526
color: var(--vscode-descriptionForeground);
2627
border: 1px solid var(--vscode-sideBarSectionHeader-border);
27-
margin: 0 var(--padding-12px) var(--padding-8px) var(--padding-12px);
28+
margin: 0 var(--padding-12px);
2829
border-radius: var(--border-radius-5px);
2930
word-wrap: break-word;
3031
overflow: hidden;
@@ -43,104 +44,94 @@
4344
}
4445
}
4546

46-
.textItem {
47-
padding: var(--padding-5px) var(--padding-12px);
48-
margin: 0 var(--padding-12px) var(--padding-8px) var(--padding-12px);
49-
color: var(--vscode-descriptionForeground);
50-
white-space: pre-wrap;
51-
word-wrap: break-word;
52-
border: 1px solid var(--vscode-sideBarSectionHeader-border);
53-
border-radius: var(--border-radius-5px);
54-
}
55-
5647
.list {
57-
padding: 0 var(--spacing-s);
58-
}
59-
60-
.item {
61-
display: flex;
62-
align-items: center;
63-
justify-content: space-between;
64-
gap: var(--padding-8px);
65-
padding: 0 var(--padding-12px);
66-
height: var(--list-item-height);
67-
&:hover {
68-
background-color: var(--vscode-list-hoverBackground);
48+
display: block;
6949

70-
.item__actions {
71-
display: flex;
72-
}
50+
&__text {
51+
font-size: var(--font-size-12px);
52+
margin: var(--padding-6px) var(--padding-12px);
7353
}
7454

75-
&--selected {
76-
background-color: var(--vscode-list-inactiveSelectionBackground);
55+
> div:first-child {
56+
margin-top: 0;
57+
}
7758

78-
&:hover {
79-
background-color: var(--vscode-list-inactiveSelectionBackground);
80-
}
59+
> div:last-child {
60+
margin-bottom: 0;
8161
}
8262

83-
&__left {
63+
&__file {
8464
display: flex;
8565
align-items: center;
66+
justify-content: space-between;
8667
gap: var(--padding-8px);
87-
overflow: hidden;
88-
89-
&__label {
90-
flex: 1;
91-
text-overflow: ellipsis;
92-
overflow: hidden;
93-
white-space: nowrap;
68+
padding: 0 var(--padding-12px);
69+
height: var(--list-item-height);
70+
&:hover {
71+
background-color: var(--vscode-list-hoverBackground);
9472

95-
> span:last-child {
96-
opacity: 0.7;
97-
margin-left: 0.5em;
98-
font-size: 0.9em;
73+
.list__file__actions {
74+
display: flex;
9975
}
76+
}
10077

101-
&--new {
102-
color: var(--vscode-gitDecoration-untrackedResourceForeground);
103-
}
78+
&--selected {
79+
background-color: var(--vscode-list-inactiveSelectionBackground);
10480

105-
&--deleted {
106-
text-decoration: line-through;
107-
color: var(--vscode-gitDecoration-deletedResourceForeground);
81+
&:hover {
82+
background-color: var(--vscode-list-inactiveSelectionBackground);
10883
}
10984
}
110-
}
11185

112-
&__right {
113-
display: flex;
114-
align-items: center;
115-
gap: var(--padding-8px);
116-
}
117-
118-
&__actions {
119-
display: none;
120-
}
86+
&__left {
87+
display: flex;
88+
align-items: center;
89+
gap: var(--padding-8px);
90+
overflow: hidden;
12191

122-
&__line-numbers {
123-
display: flex;
124-
gap: 0.3em;
92+
&__label {
93+
flex: 1;
94+
text-overflow: ellipsis;
95+
overflow: hidden;
96+
white-space: nowrap;
97+
98+
> span:last-child {
99+
opacity: 0.7;
100+
margin-left: 0.5em;
101+
font-size: 0.9em;
102+
}
103+
104+
&--new {
105+
color: var(--vscode-gitDecoration-untrackedResourceForeground);
106+
}
107+
108+
&--deleted {
109+
text-decoration: line-through;
110+
color: var(--vscode-gitDecoration-deletedResourceForeground);
111+
}
112+
}
113+
}
125114

126-
&__added {
127-
color: var(--vscode-gitDecoration-addedResourceForeground);
115+
&__right {
116+
display: flex;
117+
align-items: center;
118+
gap: var(--padding-8px);
128119
}
129-
&__removed {
130-
color: var(--vscode-gitDecoration-deletedResourceForeground);
120+
121+
&__actions {
122+
display: none;
131123
}
132-
}
133-
}
134124

135-
.footer {
136-
position: sticky;
137-
bottom: 0;
138-
background: var(--vscode-sideBar-background);
139-
display: flex;
140-
gap: var(--padding-8px);
141-
padding: var(--padding-12px);
125+
&__line-numbers {
126+
display: flex;
127+
gap: 0.3em;
142128

143-
> button {
144-
flex: 1;
129+
&__added {
130+
color: var(--vscode-gitDecoration-addedResourceForeground);
131+
}
132+
&__removed {
133+
color: var(--vscode-gitDecoration-deletedResourceForeground);
134+
}
135+
}
145136
}
146137
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ const InteractiveResponsePreview = (props: any) => {
9292
{...props}
9393
items={items}
9494
on_toggle_file={handle_toggle_file}
95-
on_discard={log_action('on_undo')}
96-
on_approve={log_action('on_keep')}
9795
on_focus_file={log_action('on_focus_file')}
9896
on_go_to_file={log_action('on_go_to_file')}
9997
on_intelligent_update={log_action('on_intelligent_update')}

0 commit comments

Comments
 (0)