@@ -5,16 +5,18 @@ import type { NotificationList } from '../types'
55import { formatReason , isRepository , isThread , notificationSubjectIcon } from ' ../utils/notification'
66import Separator from ' ./Separator.vue'
77
8- interface Emits {
9- (e : ' click:notification' , notification : Thread ): void
10- (e : ' click:repo' , repoFullName : string ): void
11- (e : ' update:checked' , value : boolean ): void
12- }
13-
148interface Props {
159 value: NotificationList [number ]
1610 checked? : boolean
1711 checkable? : boolean
12+ checkboxVisible? : boolean
13+ }
14+
15+ interface Emits {
16+ (e : ' click:notification' , notification : Thread ): void
17+ (e : ' click:repo' , repoFullName : string ): void
18+ (e : ' update:checked' , value : boolean ): void
19+ (e : ' contextmenu' , value : Thread , event : MouseEvent ): void
1820}
1921
2022const props = withDefaults (defineProps <Props >(), {
@@ -62,6 +64,7 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
6264 @click =" (event) => isRepository(value) && handleRepoClick(value, event)"
6365 >
6466 <img
67+ draggable =" false"
6568 class =" notification-title-icon"
6669 :src =" value.owner.avatar_url"
6770 alt =" repo logo"
@@ -75,7 +78,7 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
7578 class =" notification-checkbox-wrapper"
7679 >
7780 <span
78- :class =" { 'notification-checkbox-checked': checked }"
81+ :class =" { 'notification-checkbox-checked': checked, 'notification-checkbox-visible': checkboxVisible }"
7982 role =" checkbox"
8083 tabindex =" 0"
8184 aria-checked =" true"
@@ -94,6 +97,7 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
9497 v-else
9598 class =" notification-item"
9699 :class =" { 'notification-item-read': !value.unread }"
100+ @contextmenu =" (event) => emit('contextmenu', value as Thread, event)"
97101 @click =" (event) => isThread(value) && handleThreadClick(value, event)"
98102 >
99103 <Component
@@ -118,7 +122,7 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
118122 class =" notification-checkbox-wrapper"
119123 >
120124 <span
121- :class =" { 'notification-checkbox-checked': checked }"
125+ :class =" { 'notification-checkbox-checked': checked, 'notification-checkbox-visible': checkboxVisible }"
122126 role =" checkbox"
123127 tabindex =" 0"
124128 aria-checked =" true"
@@ -150,6 +154,10 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
150154 border : 1px solid transparent ;
151155 line-height : inherit ;
152156
157+ & :hover .notification-checkbox {
158+ opacity : 1 ;
159+ }
160+
153161 & :hover ,
154162 & :active {
155163 background-color : var (--item-hover-bg );
@@ -167,7 +175,7 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
167175 font-weight : bold ;
168176 font-size : 14px ;
169177 display : inline-block ;
170- color : white ;
178+ color : var ( -- white) ;
171179 white-space : nowrap ;
172180 overflow : hidden ;
173181 text-overflow : ellipsis ;
@@ -192,6 +200,10 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
192200 @include focus-visible ;
193201 margin-top : 5px ;
194202
203+ & :hover .notification-checkbox {
204+ opacity : 1 ;
205+ }
206+
195207 & -read {
196208 color : var (--white-faded ) !important ;
197209 }
@@ -235,24 +247,31 @@ function handleRepoClick(repo: MinimalRepository, event: MouseEvent | KeyboardEv
235247 @include focus-visible ;
236248 width : 16px ;
237249 height : 16px ;
238- border-radius : 50 % ;
239- border : 1px solid rgb ( 101 , 101 , 101 );
250+ border-radius : 6 px ;
251+ border : 1px solid var ( --white-faded );
240252 flex-shrink : 0 ;
241253 padding : 3px ;
242254 display : inline-flex ;
255+ opacity : 0 ;
256+ transition-duration : .2s ;
257+ transition-property : opacity ;
258+
259+ & -visible {
260+ opacity : 1 ;
261+ }
243262
244263 & -checked {
245- border-color : var (--white );
264+ border-color : var (--accent-color );
246265
247266 .notification-checkbox-dot {
248- background-color : var (--white );
267+ background-color : var (--accent-color );
249268 }
250269 }
251270
252271 & -dot {
253272 width : 100% ;
254273 height : 100% ;
255- border-radius : 50 % ;
274+ border-radius : 3 px ;
256275 }
257276
258277 & -wrapper {
0 commit comments