mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-20 00:17:44 +00:00
fix(updates): keep toolbar update entry visible when updates exist
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user