From a880463c2efacececf62d0f3313fe4917eb8913b Mon Sep 17 00:00:00 2001 From: MatteoGabriele Date: Thu, 26 Feb 2026 16:09:24 +0100 Subject: [PATCH 01/11] feat(ui): add action bar --- app/components/BaseCard.vue | 2 + app/components/Package/ActionBar.vue | 82 +++++++++++++++++++ app/components/Package/Card.vue | 66 ++++++++------- app/components/Package/List.vue | 9 +- app/components/Package/ListToolbar.vue | 19 +++++ app/composables/usePackageSelection.ts | 34 ++++++++ app/pages/package-selection.vue | 14 ++++ i18n/locales/en.json | 4 + i18n/schema.json | 12 +++ lunaria/files/en-GB.json | 4 + lunaria/files/en-US.json | 4 + .../middleware/canonical-redirects.global.ts | 1 + 12 files changed, 222 insertions(+), 29 deletions(-) create mode 100644 app/components/Package/ActionBar.vue create mode 100644 app/composables/usePackageSelection.ts create mode 100644 app/pages/package-selection.vue diff --git a/app/components/BaseCard.vue b/app/components/BaseCard.vue index ebe3e4512..2eb7f348b 100644 --- a/app/components/BaseCard.vue +++ b/app/components/BaseCard.vue @@ -2,6 +2,7 @@ defineProps<{ /** Whether this is an exact match for the query */ isExactMatch?: boolean + selected?: boolean }>() @@ -10,6 +11,7 @@ defineProps<{ class="group bg-bg-subtle border border-border rounded-lg p-4 sm:p-6 transition-[border-color,background-color] duration-200 hover:(border-border-hover bg-bg-muted) cursor-pointer relative focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-bg focus-within:ring-offset-2 focus-within:ring-fg/50 focus-within:bg-bg-muted focus-within:border-border-hover" :class="{ 'border-accent/30 contrast-more:border-accent/90 bg-accent/5': isExactMatch, + 'bg-fg-subtle/15!': selected, }" > diff --git a/app/components/Package/ActionBar.vue b/app/components/Package/ActionBar.vue new file mode 100644 index 000000000..fc6002829 --- /dev/null +++ b/app/components/Package/ActionBar.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/app/components/Package/Card.vue b/app/components/Package/Card.vue index 12d25268b..a47830fdd 100644 --- a/app/components/Package/Card.vue +++ b/app/components/Package/Card.vue @@ -14,8 +14,14 @@ const props = defineProps<{ filters?: StructuredFilters /** Search query for highlighting exact matches */ searchQuery?: string + /** Shows checkbox to all cards and the click will work as selection */ + forceSelection?: boolean }>() +const selected = defineModel('selected', { + default: false, +}) + const emit = defineEmits<{ clickKeyword: [keyword: string] }>() @@ -39,13 +45,23 @@ const numberFormatter = useNumberFormatter()