feat(sidebar): add setting to disable hover tooltips
This commit is contained in:
1 parent
ee731a3353
commit
e619b70d5d
17 files changed
+57
-6
No files matched your search
@@ -540,6 +540,7 @@ const editSidebarCopyTableNameIncludeSchema = ref(settingsStore.editorSettings.s
|
||||
const editRedisKeyTemplates = ref(normalizeRedisKeyTemplates(settingsStore.editorSettings.redisKeyTemplates).join("\n"));
|
||||
const editSidebarObjectInfoMode = ref<SidebarObjectInfoMode>(settingsStore.editorSettings.sidebarObjectInfoMode);
|
||||
const editSidebarAllowHorizontalScroll = ref(settingsStore.editorSettings.sidebarAllowHorizontalScroll);
|
||||
const editSidebarShowTooltips = ref(settingsStore.editorSettings.sidebarShowTooltips);
|
||||
const editSidebarIndent = ref(settingsStore.editorSettings.sidebarIndent);
|
||||
const editSidebarFontSize = ref(settingsStore.editorSettings.sidebarFontSize);
|
||||
const editExportBatchSize = ref(settingsStore.editorSettings.exportBatchSize);
|
||||
@@ -685,6 +686,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft {
|
||||
updateNotificationsEnabled: editUpdateNotificationsEnabled.value,
|
||||
sidebarObjectInfoMode: editSidebarObjectInfoMode.value,
|
||||
sidebarAllowHorizontalScroll: editSidebarAllowHorizontalScroll.value,
|
||||
sidebarShowTooltips: editSidebarShowTooltips.value,
|
||||
sidebarIndent: editSidebarIndent.value,
|
||||
sidebarFontSize: editSidebarFontSize.value,
|
||||
sidebarHiddenTablePrefixes: normalizeSidebarHiddenTablePrefixes(editSidebarHiddenTablePrefixes.value),
|
||||
@@ -1092,6 +1094,7 @@ function syncEditorSettingsDraftFromStore() {
|
||||
editRedisKeyTemplates.value = normalizeRedisKeyTemplates(settingsStore.editorSettings.redisKeyTemplates).join("\n");
|
||||
editSidebarObjectInfoMode.value = settingsStore.editorSettings.sidebarObjectInfoMode;
|
||||
editSidebarAllowHorizontalScroll.value = settingsStore.editorSettings.sidebarAllowHorizontalScroll;
|
||||
editSidebarShowTooltips.value = settingsStore.editorSettings.sidebarShowTooltips;
|
||||
editSidebarIndent.value = settingsStore.editorSettings.sidebarIndent;
|
||||
editSidebarFontSize.value = settingsStore.editorSettings.sidebarFontSize;
|
||||
editExportBatchSize.value = settingsStore.editorSettings.exportBatchSize;
|
||||
@@ -1355,6 +1358,7 @@ function resetDefaultsForTab(tab: SettingsCategory) {
|
||||
editUpdateNotificationsEnabled.value = DEFAULT_EDITOR_SETTINGS.updateNotificationsEnabled;
|
||||
editSidebarObjectInfoMode.value = DEFAULT_EDITOR_SETTINGS.sidebarObjectInfoMode;
|
||||
editSidebarAllowHorizontalScroll.value = DEFAULT_EDITOR_SETTINGS.sidebarAllowHorizontalScroll;
|
||||
editSidebarShowTooltips.value = DEFAULT_EDITOR_SETTINGS.sidebarShowTooltips;
|
||||
editSidebarIndent.value = DEFAULT_EDITOR_SETTINGS.sidebarIndent;
|
||||
editSidebarFontSize.value = DEFAULT_EDITOR_SETTINGS.sidebarFontSize;
|
||||
editSidebarHiddenTablePrefixes.value = DEFAULT_EDITOR_SETTINGS.sidebarHiddenTablePrefixes.join("\n");
|
||||
@@ -1491,6 +1495,7 @@ function resetAllDefaults() {
|
||||
editUpdateNotificationsEnabled.value = DEFAULT_EDITOR_SETTINGS.updateNotificationsEnabled;
|
||||
editSidebarObjectInfoMode.value = DEFAULT_EDITOR_SETTINGS.sidebarObjectInfoMode;
|
||||
editSidebarAllowHorizontalScroll.value = DEFAULT_EDITOR_SETTINGS.sidebarAllowHorizontalScroll;
|
||||
editSidebarShowTooltips.value = DEFAULT_EDITOR_SETTINGS.sidebarShowTooltips;
|
||||
editSidebarIndent.value = DEFAULT_EDITOR_SETTINGS.sidebarIndent;
|
||||
editSidebarFontSize.value = DEFAULT_EDITOR_SETTINGS.sidebarFontSize;
|
||||
editSidebarHiddenTablePrefixes.value = DEFAULT_EDITOR_SETTINGS.sidebarHiddenTablePrefixes.join("\n");
|
||||
@@ -5762,6 +5767,17 @@ onUnmounted(() => {
|
||||
</div>
|
||||
<Switch id="sidebar-allow-horizontal-scroll" v-model="editSidebarAllowHorizontalScroll" />
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<Label for="sidebar-show-tooltips">
|
||||
{{ t("settings.sidebarShowTooltips") }}
|
||||
</Label>
|
||||
<HelpTooltip :label="t('settings.sidebarShowTooltips')">
|
||||
{{ t("settings.sidebarShowTooltipsDescription") }}
|
||||
</HelpTooltip>
|
||||
</div>
|
||||
<Switch id="sidebar-show-tooltips" v-model="editSidebarShowTooltips" />
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2">
|
||||
<div class="space-y-1">
|
||||
<Label for="sidebar-indent">{{ t("settings.sidebarIndent") }}</Label>
|
||||
|
||||
@@ -581,6 +581,7 @@ const detailTooltip = computed(() => {
|
||||
});
|
||||
|
||||
function isTooltipDisabled(): boolean {
|
||||
if (!settingsStore.editorSettings.sidebarShowTooltips) return true;
|
||||
if (detailTooltip.value?.rows.length) return isRenamingGroup.value;
|
||||
return isRenamingGroup.value || !labelOverflowing.value;
|
||||
}
|
||||
@@ -1033,6 +1034,7 @@ function shouldMeasureLabelOverflow(): boolean {
|
||||
hasDetailTooltip: !!detailTooltip.value?.rows.length,
|
||||
isRenaming: isRenamingGroup.value || isRenamingSavedSql.value || isRenamingConnection.value,
|
||||
usesFullWidthLabel: usesFullWidthLabel.value,
|
||||
tooltipsDisabled: !settingsStore.editorSettings.sidebarShowTooltips,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -69,6 +69,7 @@ vi.mock("@/stores/settingsStore", () => ({
|
||||
sidebarAllowHorizontalScroll: false,
|
||||
sidebarHiddenTablePrefixes: [],
|
||||
sidebarObjectInfoMode: "none",
|
||||
sidebarShowTooltips: true,
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user