Skip to content

Commit 2ae487a

Browse files
fix: remove clear on click
1 parent e073a7f commit 2ae487a

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

app/components/Package/ActionBar.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ onKeyStroke(
5353

5454
<LinkBase
5555
:to="{ name: 'compare', query: { packages: selectedPackagesParam } }"
56-
@click="clearSelectedPackages"
5756
variant="button-secondary"
5857
classicon="i-lucide:git-compare"
5958
>

app/composables/usePackageSelection.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export const MAX_PACKAGE_SELECTION = 4
22

33
export function usePackageSelection() {
4-
// Use 'push' mode and let router handle scroll behavior naturally
54
const selectedPackagesParam = useRouteQuery<string>('selection', '', { mode: 'push' })
65
const showSelectionViewParam = useRouteQuery<string>('view', '', { mode: 'push' })
76

@@ -23,10 +22,8 @@ export function usePackageSelection() {
2322
},
2423
})
2524

26-
// Check if max selection is reached
2725
const isMaxSelected = computed(() => selectedPackages.value.length >= MAX_PACKAGE_SELECTION)
2826

29-
// Track whether the SelectionView is open/visible
3027
const showSelectionView = computed<boolean>({
3128
get() {
3229
return showSelectionViewParam.value === 'selection'
@@ -36,12 +33,14 @@ export function usePackageSelection() {
3633
},
3734
})
3835

39-
/** Check if a package name is selected */
36+
function closeSelectionView() {
37+
showSelectionView.value = false
38+
}
39+
4040
function isPackageSelected(packageName: string): boolean {
4141
return selectedPackages.value.includes(String(packageName).trim())
4242
}
4343

44-
/** Toggle selection for a package by name */
4544
function togglePackageSelection(packageName: string) {
4645
const safeName = String(packageName).trim()
4746
if (!safeName) return
@@ -56,17 +55,10 @@ export function usePackageSelection() {
5655
selectedPackages.value = pkgs
5756
}
5857

59-
/** Clear all selected packages */
6058
function clearSelectedPackages() {
6159
selectedPackages.value = []
6260
}
6361

64-
/** Close the selection view */
65-
function closeSelectionView() {
66-
showSelectionView.value = false
67-
}
68-
69-
/** Open the selection view */
7062
function openSelectionView() {
7163
showSelectionView.value = true
7264
}

0 commit comments

Comments
 (0)