Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(updates): keep toolbar update entry visible when updates exist

zipge1a512fd596a
diff --git a/apps/desktop/src/components/layout/AppToolbar.vue b/apps/desktop/src/components/layout/AppToolbar.vue
index c87b66f589..c830f32138 100644
--- a/apps/desktop/src/components/layout/AppToolbar.vue
+++ b/apps/desktop/src/components/layout/AppToolbar.vue
@@ -78,6 +78,7 @@ const { t } = useI18n();
const { toast } = useToast();
const settingsStore = useSettingsStore();
const toolbarItems = computed(() => settingsStore.editorSettings.toolbarItems);
+const showToolbarUpdateEntry = computed(() => toolbarItems.value.checkUpdates || props.hasUpdateAvailable);
const { isMac, isDesktop, showControls, isMaximized, isFullscreen, minimize, toggleMaximize, close } = useWindowControls();
const updateTooltip = computed(() => {
if (props.hasUpdateAvailable && props.updateReady) return t("updates.restartRequiredTooltip");
@@ -194,7 +195,7 @@ const collapsibleRightItemDefs = computed(() => {
disabled: boolean;
}
const items: ItemDef[] = [];
- if (toolbarItems.value.checkUpdates) {
+ if (showToolbarUpdateEntry.value) {
items.push({
key: "checkUpdates",
label: t("updates.check"),
@@ -620,7 +621,7 @@ const toolbarStyle = computed(() => {
<!-- Right-side items wrapped in overflow-aware container -->
<div ref="rightWrapper" class="flex min-w-0 items-center gap-1 overflow-hidden">
- <template v-if="toolbarItems.checkUpdates">
+ <template v-if="showToolbarUpdateEntry">
<Tooltip>
<TooltipTrigger as-child>
<Button
diff --git a/apps/desktop/src/components/layout/__tests__/ToolbarUpdateIcon.spec.ts b/apps/desktop/src/components/layout/__tests__/ToolbarUpdateIcon.spec.ts
index df03efd711..f9ccc080f3 100644
--- a/apps/desktop/src/components/layout/__tests__/ToolbarUpdateIcon.spec.ts
+++ b/apps/desktop/src/components/layout/__tests__/ToolbarUpdateIcon.spec.ts
@@ -22,6 +22,15 @@ describe("silent toolbar update icon", () => {
expect(source).toContain('t("updates.updateAction")');
});
+ it("keeps the update entry visible when the appearance setting is off but an update is available", () => {
+ const source = readFileSync(resolve(process.cwd(), "apps/desktop/src/components/layout/AppToolbar.vue"), "utf8");
+
+ expect(source).toContain("const showToolbarUpdateEntry = computed(() => toolbarItems.value.checkUpdates || props.hasUpdateAvailable);");
+ expect(source).toContain("if (showToolbarUpdateEntry.value) {");
+ expect(source).toContain('<template v-if="showToolbarUpdateEntry">');
+ expect(source).not.toContain('<template v-if="toolbarItems.checkUpdates">');
+ });
+
it("passes only opt-out component badges to their separate toolbar entries", () => {
const source = readFileSync(resolve(process.cwd(), "apps/desktop/src/App.vue"), "utf8");