Skip to content

Commit aa12a49

Browse files
authored
fix: Links typed in the message editor should not open on click (#675)
- Fixed links typed in the message editor opening on click - Update globals.css to fix select text coloring issue - Fixed Cmd+P to open the file picker, followed by Esc to close it also interrupts the agent
1 parent ebc2fa7 commit aa12a49

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

apps/twig/src/renderer/features/command/components/FilePicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export function FilePicker({
8080
align="center"
8181
sideOffset={0}
8282
onInteractOutside={() => handleOpenChange(false)}
83+
onEscapeKeyDown={(e) => e.stopPropagation()}
8384
>
8485
<Command.Root shouldFilter={false} label="File picker" key={resultsKey}>
8586
<Command.Input

apps/twig/src/renderer/features/message-editor/tiptap/useTiptapEditor.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
101101
autofocus: autoFocus ? "end" : false,
102102
editorProps: {
103103
attributes: { class: EDITOR_CLASS, spellcheck: "false" },
104+
handleDOMEvents: {
105+
click: (_view, event) => {
106+
const target = (event.target as HTMLElement).closest("a");
107+
if (target) {
108+
event.preventDefault();
109+
return true;
110+
}
111+
return false;
112+
},
113+
},
104114
handleKeyDown: (view, event) => {
105115
if (event.key === "Enter") {
106116
const sendMessagesWith =

0 commit comments

Comments
 (0)