diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 02222dbed..2e7e1cc71 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -240,14 +240,6 @@ watch( { immediate: true }, ); -watch( - () => settingsStore.editorSettings.snippets, - (snippets) => { - editSnippets.value = snippets.map((s) => ({ ...s })); - }, - { deep: true }, -); - const shortcutConflicts = computed(() => SHORTCUT_DEFINITIONS.flatMap((definition) => { const conflict = findShortcutConflict(definition.id, editShortcuts.value[definition.id], editShortcuts.value); @@ -1334,9 +1326,15 @@ watch(
| {{ t("settings.snippetsLabel") }} | -{{ t("settings.snippetsPrefix") }} | -{{ t("settings.snippetsBody") }} | ++ {{ t("settings.snippetsLabel") }} + | ++ {{ t("settings.snippetsPrefix") }} + | ++ {{ t("settings.snippetsBody") }} + | {{ snippet.label }} | -{{ snippet.prefix }} | +
+ |
{{ snippet.body }} | diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts index d2600e29d..20e190707 100644 --- a/apps/desktop/src/i18n/locales/en.ts +++ b/apps/desktop/src/i18n/locales/en.ts @@ -1447,6 +1447,8 @@ export default { redisScanPageSizeDescription: "Keys requested per Redis SCAN page when browsing keys.", redisScanPageSizeOption: "{count} keys", shortcutExecuteSql: "Execute SQL", + shortcutFind: "Find", + shortcutReplace: "Replace", shortcutSaveSql: "Save SQL", shortcutAcceptCompletion: "Accept completion", shortcutCopyCurrentRow: "Copy current data row", diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts index b83f21a06..ba0522541 100644 --- a/apps/desktop/src/i18n/locales/es.ts +++ b/apps/desktop/src/i18n/locales/es.ts @@ -1342,6 +1342,8 @@ export default { redisScanPageSizeDescription: "Claves solicitadas por página SCAN al explorar claves Redis.", redisScanPageSizeOption: "{count} claves", shortcutExecuteSql: "Ejecutar SQL", + shortcutFind: "Buscar", + shortcutReplace: "Reemplazar", shortcutSaveSql: "Guardar SQL", shortcutAcceptCompletion: "Aceptar completado", shortcutCopyCurrentRow: "Copiar fila de datos actual", diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts index 06ce61d70..6adab3a5e 100644 --- a/apps/desktop/src/i18n/locales/zh-CN.ts +++ b/apps/desktop/src/i18n/locales/zh-CN.ts @@ -1413,6 +1413,8 @@ export default { redisScanPageSizeDescription: "浏览 Redis Key 时每次 SCAN 请求的 Key 数量。", redisScanPageSizeOption: "{count} 个 Key", shortcutExecuteSql: "执行 SQL", + shortcutFind: "查找", + shortcutReplace: "替换", shortcutSaveSql: "保存 SQL", shortcutAcceptCompletion: "接受补全", shortcutCopyCurrentRow: "复制当前数据行", diff --git a/apps/desktop/src/lib/editorThemes.ts b/apps/desktop/src/lib/editorThemes.ts index 1d3ea4778..6d3955643 100644 --- a/apps/desktop/src/lib/editorThemes.ts +++ b/apps/desktop/src/lib/editorThemes.ts @@ -26,6 +26,11 @@ const KEYWORD_ICON: LucideIconNode = [ ]; const SNIPPET_ICON: LucideIconNode = [ + ["path", { d: "M8 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h1" }], + ["path", { d: "M16 3h1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-1" }], +]; + +const FUNCTION_ICON: LucideIconNode = [ ["path", { d: "m15 10 5 5-5 5" }], ["path", { d: "M4 4v7a4 4 0 0 0 4 4h12" }], ]; @@ -236,9 +241,13 @@ export function buildSqlCompletionThemeRules(): CodeMirrorStyleSpec { ...lucideCompletionIconMask(KEYWORD_ICON), }, ".cm-completionIcon-snippet": { - color: "color-mix(in oklch, var(--emerald-500, #10b981) 92%, var(--popover-foreground))", + color: "color-mix(in oklch, var(--violet-500, #8b5cf6) 92%, var(--popover-foreground))", ...lucideCompletionIconMask(SNIPPET_ICON), }, + ".cm-completionIcon-function": { + color: "color-mix(in oklch, var(--emerald-500, #10b981) 92%, var(--popover-foreground))", + ...lucideCompletionIconMask(FUNCTION_ICON), + }, ".cm-completionIcon-schema": { color: "color-mix(in oklch, var(--amber-500, #f59e0b) 92%, var(--popover-foreground))", ...lucideCompletionIconMask(SCHEMA_ICON), diff --git a/apps/desktop/src/stores/settingsStore.ts b/apps/desktop/src/stores/settingsStore.ts index 51a581372..9dc5c0259 100644 --- a/apps/desktop/src/stores/settingsStore.ts +++ b/apps/desktop/src/stores/settingsStore.ts @@ -425,20 +425,36 @@ export const useSettingsStore = defineStore("settings", () => { } function updateEditorSettings(partial: Partial
|---|