Skip to content

Commit 09294bc

Browse files
authored
Merge pull request #1663 from nextcloud/fix/update-notification-design
fix(talk): increase visibility of new update availability in the main menu
2 parents fecd5bd + 2be2ad0 commit 09294bc

File tree

2 files changed

+102
-14
lines changed

2 files changed

+102
-14
lines changed

src/talk/renderer/TitleBar/components/MainMenu.vue

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import IconInformationOutline from 'vue-material-design-icons/InformationOutline
2020
import IconMenu from 'vue-material-design-icons/Menu.vue'
2121
import IconReload from 'vue-material-design-icons/Reload.vue'
2222
import IconWeb from 'vue-material-design-icons/Web.vue'
23+
import UiDotBadge from './UiDotBadge.vue'
2324
import { BUILD_CONFIG } from '../../../../shared/build.config.ts'
2425
import { getCurrentTalkRoutePath } from '../../TalkWrapper/talk.service.ts'
2526
@@ -43,7 +44,6 @@ onBeforeUnmount(() => {
4344
})
4445
4546
window.TALK_DESKTOP.checkForUpdate()
46-
4747
</script>
4848

4949
<template>
@@ -52,7 +52,29 @@ window.TALK_DESKTOP.checkForUpdate()
5252
variant="tertiary-no-background"
5353
container="body">
5454
<template #icon>
55-
<IconMenu :size="20" fill-color="var(--color-background-plain-text)" />
55+
<UiDotBadge inset-inline-end="10%" :enabled="updateAvailable">
56+
<IconMenu :size="20" fill-color="var(--color-background-plain-text)" />
57+
</UiDotBadge>
58+
</template>
59+
60+
<template v-if="updateAvailable">
61+
<NcActionLink
62+
href="https://github.com/nextcloud/talk-desktop/releases/latest"
63+
target="_blank"
64+
close-after-click>
65+
<template #icon>
66+
<UiDotBadge
67+
inset-block-start="32%"
68+
inset-inline-end="22%"
69+
enabled
70+
no-outline>
71+
<IconCloudDownloadOutline :size="20" />
72+
</UiDotBadge>
73+
</template>
74+
{{ t('talk_desktop', 'Update') }}
75+
</NcActionLink>
76+
77+
<NcActionSeparator />
5678
</template>
5779

5880
<template v-if="isTalkInitialized">
@@ -62,26 +84,16 @@ window.TALK_DESKTOP.checkForUpdate()
6284
</template>
6385
{{ t('talk_desktop', 'Open in web browser') }}
6486
</NcActionButton>
65-
</template>
6687

67-
<NcActionSeparator />
88+
<NcActionSeparator />
89+
</template>
6890

6991
<NcActionButton @click="reload">
7092
<template #icon>
7193
<IconReload :size="20" />
7294
</template>
7395
{{ t('talk_desktop', 'Force reload') }}
7496
</NcActionButton>
75-
<NcActionLink
76-
v-if="updateAvailable"
77-
href="https://github.com/nextcloud/talk-desktop/releases/latest"
78-
target="_blank"
79-
close-after-click>
80-
<template #icon>
81-
<IconCloudDownloadOutline :size="20" />
82-
</template>
83-
{{ t('talk_desktop', 'Update') }}
84-
</NcActionLink>
8597
<NcActionLink
8698
v-if="!BUILD_CONFIG.isBranded"
8799
:href="packageInfo.bugs.create || packageInfo.bugs.url"
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!--
2+
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
6+
<script setup lang="ts">
7+
const {
8+
enabled = false,
9+
size = '6px',
10+
insetBlockStart = '20%',
11+
insetInlineEnd = '20%',
12+
noOutline = false,
13+
} = defineProps<{
14+
/**
15+
* Whether to show the dot
16+
*/
17+
enabled?: boolean
18+
/**
19+
* CSS size of the dot, e.g. '6px'. With the gap around it will be twice bigger.
20+
*/
21+
size?: string
22+
/**
23+
* Position of the dot's center from the block start.
24+
* Default is 20%, but due to different icon's shape the perfect position might vary.
25+
*/
26+
insetBlockStart?: string
27+
/**
28+
* Position of the dot's center from the inline end.
29+
* Default is 20%, but due to different icon's shape the perfect position might vary.
30+
*/
31+
insetInlineEnd?: string
32+
/**
33+
* Whether to remove the transparent outline around the dot icon.
34+
* The outline helps to separate the dot from the icon, but may look bad when the dote does not overlap with the icon at all.
35+
*/
36+
noOutline?: boolean
37+
}>()
38+
</script>
39+
40+
<template>
41+
<span :class="$style.dotBadge">
42+
<span :class="{ [$style.dotBadge__iconWithDotHole]: enabled && !noOutline }">
43+
<slot />
44+
</span>
45+
<sup v-if="enabled" :class="[$style.dotBadge__dot]" />
46+
</span>
47+
</template>
48+
49+
<style module>
50+
.dotBadge {
51+
position: relative;
52+
}
53+
54+
/* Adding a mask to create a gap between the the dot and the icon (like a hole), so they do not touch */
55+
.dotBadge__iconWithDotHole {
56+
/* radial-gradient circle is defined by radius, not diameter size. */
57+
/* Using diameter size as the radius here is intentional to make the hole twice bigger than the dot. */
58+
mask: radial-gradient(circle v-bind(size) at top v-bind(insetBlockStart) right v-bind(insetInlineEnd), transparent 100%, white 100%);
59+
60+
/* radial-gradient does not support logical properties */
61+
&:dir(rtl) {
62+
mask: radial-gradient(circle v-bind(size) at top v-bind(insetBlockStart) left v-bind(insetInlineEnd), transparent 100%, white 100%);
63+
}
64+
}
65+
66+
.dotBadge__dot {
67+
display: inline-block;
68+
border-radius: 50%;
69+
width: v-bind(size);
70+
height: v-bind(size);
71+
background-color: var(--color-text-error);
72+
position: absolute;
73+
inset-block-start: calc(v-bind(insetBlockStart) - v-bind(size) / 2);
74+
inset-inline-end: calc(v-bind(insetInlineEnd) - v-bind(size) / 2);
75+
}
76+
</style>

0 commit comments

Comments
 (0)