Skip to content

Commit bb205c0

Browse files
committed
Refactor the prompt field component to correctly use and display the last_choice_button_title prop
1 parent 1ec57b6 commit bb205c0

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ Unlike coding agents that require detailed instructions to understand your inten
4242
> [!TIP]
4343
> LLMs are pattern matchers—they love examples! Include some you believe will help the model understand the goal better.
4444
45-
Meet the CWC's non-agentic workflow—select folders and files, enter instructions, and send message via...
45+
Meet the CWC's non-agentic workflow—select folders and files, enter instructions, and send message in a new web chat or with an API provider of choice.
4646

47-
- new chat—to continue in the connected browser
48-
- API call—to use a model provider of choice
49-
50-
Constructed message looks like the following example:
47+
Constructed message is simple and focuses the model's whole attention on the task:
5148

5249
```
5350
Implement a subtract function.
@@ -70,7 +67,7 @@ Whenever proposing a new or updated file use the Markdown Code Block syntax. Eac
7067
> [!NOTE]
7168
> The prompt and edit format instructions are repeated after the context [for better accuracy](https://cookbook.openai.com/examples/gpt4-1_prompting_guide#:~:text=If%20you%20have%20long%20context%20in%20your%20prompt%2C%20ideally%20place%20your%20instructions%20at%20both%20the%20beginning%20and%20end%20of%20the%20provided%20context%2C%20as%20we%20found%20this%20to%20perform%20better%20than%20only%20above%20or%20below.).
7269
73-
Once the response is generated, CWC's built-in parser extracts code blocks with suggested edits for one-click multi-file changes integration.
70+
Once the response is generated, sophisticated parser extracts code blocks with suggested edits for one-click multi-file changes integration.
7471

7572
## Chatbot initialization
7673

packages/ui/src/components/editor/panel/Dropdown/Dropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const Dropdown = <T extends string>(props: Dropdown.Props<T>) => {
2929
)
3030

3131
const handle_toggle = () => {
32-
set_is_open(true)
33-
set_just_opened(true)
32+
set_is_open(!is_open)
33+
set_just_opened(!is_open)
3434
}
3535

3636
const handle_select = (value: T) => {

packages/ui/src/components/editor/panel/PromptField/PromptField.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export type PromptFieldProps = {
6464
on_caret_position_set?: () => void
6565
focus_key?: number
6666
focus_and_select_key?: number
67-
use_last_choice_button_title?: string
67+
last_choice_button_title?: string
6868
show_edit_format_selector?: boolean
6969
edit_format?: EditFormat
7070
on_edit_format_change?: (format: EditFormat) => void
@@ -519,9 +519,9 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
519519
is_warning
520520
/>
521521
)}
522-
{props.use_last_choice_button_title && show_submit_tooltip && (
522+
{props.last_choice_button_title && show_submit_tooltip && (
523523
<Tooltip
524-
message={props.use_last_choice_button_title}
524+
message={props.last_choice_button_title}
525525
offset={28}
526526
align="right"
527527
/>

packages/vscode/src/views/panel/frontend/Main/MainView/MainView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export const MainView: React.FC<Props> = (props) => {
218218
on_caret_position_set={props.on_caret_position_set}
219219
focus_and_select_key={props.chat_input_focus_and_select_key}
220220
focus_key={props.chat_input_focus_key}
221-
use_last_choice_button_title={last_choice_button_title}
221+
last_choice_button_title={last_choice_button_title}
222222
show_edit_format_selector={show_edit_format_selector}
223223
edit_format={
224224
props.main_view_type == MAIN_VIEW_TYPES.WEB

0 commit comments

Comments
 (0)