Skip to content

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

feat: add editor loading spin (#1659)

寻ce0b6331254e
diff --git a/frontend/src/components/MonacoEditor/MonacoEditor.vue b/frontend/src/components/MonacoEditor/MonacoEditor.vue
index 4ce7648f4b..a61b390157 100644
--- a/frontend/src/components/MonacoEditor/MonacoEditor.vue
+++ b/frontend/src/components/MonacoEditor/MonacoEditor.vue
@@ -1,5 +1,9 @@
<template>
<div ref="editorContainerRef"></div>
+ <BBSpin
+ v-if="!isEditorLoaded"
+ class="h-full w-full flex items-center justify-center"
+ />
</template>
<script lang="ts" setup>
@@ -48,6 +52,8 @@ const editorContainerRef = ref<HTMLDivElement>();
// use shallowRef to avoid deep conversion which will cause page crash.
const editorInstanceRef = shallowRef<Editor.IStandaloneCodeEditor>();
+const isEditorLoaded = ref(false);
+
const getEditorInstance = () => {
const { monaco, formatContent, setPositionAtEndOfLine } =
monacoInstanceRef.value;
@@ -156,6 +162,8 @@ onMounted(async () => {
nextTick(() => setPositionAtEndOfLine(editorInstance));
}
+ isEditorLoaded.value = true;
+
nextTick(() => {
emit("ready");
});