Skip to content

Commit 7699225

Browse files
committed
fix: Reset hover state after deselect all action
- Clear isHoveringSelectionCount when deselecting all assets - Prevents 'Deselect all' text from staying visible after clearing selection - Improves UX by returning to normal selection count display
1 parent d293028 commit 7699225

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/sidebar/tabs/AssetsSidebarTab.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
v-if="isHoveringSelectionCount"
9696
:label="$t('mediaAsset.selection.deselectAll')"
9797
type="transparent"
98-
@click="clearSelection"
98+
@click="handleDeselectAll"
9999
@mouseleave="isHoveringSelectionCount = false"
100100
/>
101101
<span
@@ -105,8 +105,8 @@
105105
:aria-label="$t('mediaAsset.selection.deselectAll')"
106106
class="cursor-pointer px-3 text-sm focus:ring-2 focus:ring-primary focus:outline-none"
107107
@mouseenter="isHoveringSelectionCount = true"
108-
@keydown.enter="clearSelection"
109-
@keydown.space.prevent="clearSelection"
108+
@keydown.enter="handleDeselectAll"
109+
@keydown.space.prevent="handleDeselectAll"
110110
>
111111
{{
112112
$t('mediaAsset.selection.selectedCount', { count: selectedCount })
@@ -352,6 +352,11 @@ onUnmounted(() => {
352352
resetSelection()
353353
})
354354
355+
const handleDeselectAll = () => {
356+
clearSelection()
357+
isHoveringSelectionCount.value = false
358+
}
359+
355360
const copyJobId = async () => {
356361
if (folderPromptId.value) {
357362
try {

src/locales/en/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@
17891789
"error": "Error"
17901790
},
17911791
"selection": {
1792-
"selectedCount": "{count} selected",
1792+
"selectedCount": "Assets Selected: {count}",
17931793
"deselectAll": "Deselect all",
17941794
"downloadSelected": "Download",
17951795
"deleteSelected": "Delete",

0 commit comments

Comments
 (0)