Skip to content

Commit ee56310

Browse files
committed
Show user feedback when no active editor is found and refine prompt template handling logic
1 parent 44df4c6 commit ee56310

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎apps/editor/src/commands/apply-chat-response-command/response-processor.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ export const process_chat_response = async (
468468
}
469469
return null
470470
}
471+
} else {
472+
vscode.window.showInformationMessage(
473+
dictionary.information_message.NO_ACTIVE_EDITOR_FOUND
474+
)
471475
}
472476

473477
return null

‎apps/editor/src/views/panel/backend/message-handlers/handle-show-prompt-template-quick-pick.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ export const handle_show_prompt_template_quick_pick = async (
5555
>()
5656
templates_quick_pick.matchOnDetail = true
5757
templates_quick_pick.title = 'Prompt Templates'
58-
templates_quick_pick.placeholder = 'Manage and use your prompt templates'
58+
templates_quick_pick.placeholder =
59+
'Select a prompt template or create a new one'
5960
templates_quick_pick.buttons = [
6061
{ iconPath: new vscode.ThemeIcon('close'), tooltip: 'Close' }
6162
]

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,14 +776,15 @@ export const use_handlers = (
776776
}
777777

778778
if (char_before_caret == '@') {
779-
const is_at_start = caret_position == 1
780-
let is_after_whitespace = false
779+
let should_trigger = true
781780
if (caret_position > 1) {
782781
const char_before_at = new_display_value.charAt(caret_position - 2)
783-
is_after_whitespace = /\s/.test(char_before_at)
782+
if (char_before_at == '@') {
783+
should_trigger = false
784+
}
784785
}
785786

786-
if (is_at_start || is_after_whitespace) {
787+
if (should_trigger) {
787788
props.on_at_sign_click()
788789
}
789790
} else if (char_before_caret == '#') {

0 commit comments

Comments
 (0)