Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update monaco editor attr (#15978)

boojacka9f6672a4cb4
diff --git a/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue b/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue
index 125e313f37..996da01a66 100644
--- a/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue
+++ b/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue
@@ -228,6 +228,17 @@ onMounted(async () => {
watchEffect(() => {
emit("update:selection", selection.value);
});
+
+ // As the new experimental edit context uses a div instead of a textarea,
+ // we need to set the contenteditable attribute to true to ensure it is not
+ // captured by browser extensions like Vimium.
+ // This is a workaround for the issue that the new edit context is not
+ // editable by default.
+ // https://github.com/microsoft/vscode/blob/main/src/vs/monaco.d.ts#L3824
+ editor
+ .getDomNode()
+ ?.querySelector<HTMLElement>("div.native-edit-context")
+ ?.setAttribute("contenteditable", "true");
} catch (ex) {
console.error("[MonacoEditor] initialize failed", ex);
}
diff --git a/frontend/src/components/MonacoEditor/editor.ts b/frontend/src/components/MonacoEditor/editor.ts
index 1b0d6f203c..9abc8e0d48 100644
--- a/frontend/src/components/MonacoEditor/editor.ts
+++ b/frontend/src/components/MonacoEditor/editor.ts
@@ -35,7 +35,7 @@ export const createMonacoEditor = async (config: {
console.error("[MonacoEditor] Failed to initialize LSP client", err);
}
- // create monaco editor
+ // Create monaco editor.
const editor = monaco.editor.create(config.container, {
...defaultEditorOptions(),
...config.options,
@@ -52,7 +52,7 @@ export const createMonacoDiffEditor = async (config: {
}): Promise<monaco.editor.IStandaloneDiffEditor> => {
await initialize();
- // create monaco editor
+ // Create monaco diff editor.
const editor = monaco.editor.createDiffEditor(config.container, {
...defaultDiffEditorOptions(),
...config.options,
diff --git a/frontend/src/plugins/ai/components/ChatView/Markdown/CodeBlock.vue b/frontend/src/plugins/ai/components/ChatView/Markdown/CodeBlock.vue
index 889217354f..eff2bf585c 100644
--- a/frontend/src/plugins/ai/components/ChatView/Markdown/CodeBlock.vue
+++ b/frontend/src/plugins/ai/components/ChatView/Markdown/CodeBlock.vue
@@ -60,7 +60,6 @@
padding: 2,
}"
:options="{
- automaticLayout: true,
fontSize: 12,
lineHeight: 14,
lineNumbers: 'off',