-
+
{{ $t("recentSearches.heading") }}
+
{{ entry }}
+
-
+
{{ $t("recentSearches.none") }}
-
+
{{ $t("recentSearches.disclaimer") }}
@@ -62,6 +78,8 @@ import { defineComponent, type PropType } from "vue"
import { defineEvent } from "~/types/emits"
import VButton from "~/components/VButton.vue"
+import VIcon from "~/components/VIcon/VIcon.vue"
+import VIconButton from "~/components/VIconButton/VIconButton.vue"
/**
* List the recent searches of the user allowing them to go back to a previous
@@ -69,7 +87,7 @@ import VButton from "~/components/VButton.vue"
*/
export default defineComponent({
name: "VRecentSearches",
- components: { VButton },
+ components: { VIconButton, VIcon, VButton },
props: {
/**
* the list of saved past searches
@@ -95,6 +113,7 @@ export default defineComponent({
emits: {
select: defineEvent<[number]>(),
clear: defineEvent(),
+ "clear-single": defineEvent<[number]>(),
},
setup(_, { emit }) {
const handleClick = (idx: number) => {
@@ -103,10 +122,14 @@ export default defineComponent({
const handleClear = () => {
emit("clear")
}
+ const handleClearSingle = (idx: number) => {
+ emit("clear-single", idx)
+ }
return {
handleClick,
handleClear,
+ handleClearSingle,
}
},
})
diff --git a/frontend/src/components/VRecentSearches/meta/VRecentSearches.stories.mdx b/frontend/src/components/VRecentSearches/meta/VRecentSearches.stories.mdx
index a5a6c4a10a2..5a6c5d1ef67 100644
--- a/frontend/src/components/VRecentSearches/meta/VRecentSearches.stories.mdx
+++ b/frontend/src/components/VRecentSearches/meta/VRecentSearches.stories.mdx
@@ -18,6 +18,9 @@ import VRecentSearches from "~/components/VRecentSearches/VRecentSearches.vue"
clear: {
action: "clear",
},
+ clearSingle: {
+ action: "clearSingle",
+ },
}}
/>
diff --git a/frontend/src/locales/scripts/en.json5 b/frontend/src/locales/scripts/en.json5
index 9ec5b531504..6a79aaab831 100644
--- a/frontend/src/locales/scripts/en.json5
+++ b/frontend/src/locales/scripts/en.json5
@@ -745,6 +745,9 @@
text: "Clear",
label: "Clear recent searches",
},
+ clearSingle: {
+ label: "Clear recent search '{entry}'",
+ },
none: "No recent searches to show.",
disclaimer: "Openverse does not store your recent searches, this information is kept locally in your browser.",
},
diff --git a/frontend/src/stores/search.ts b/frontend/src/stores/search.ts
index 6e96e30771b..97b2409b020 100644
--- a/frontend/src/stores/search.ts
+++ b/frontend/src/stores/search.ts
@@ -331,6 +331,9 @@ export const useSearchStore = defineStore("search", {
clearRecentSearches() {
this.recentSearches = []
},
+ clearRecentSearch(idx: number) {
+ this.recentSearches.splice(idx, 1)
+ },
/**
* Initial filters do not include the provider filters. We create the provider filters object
* when we fetch the provider data on the Nuxt server initialization.
diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.ts
index ee79136a8ad..8f2e8274ddb 100644
--- a/frontend/tailwind.config.ts
+++ b/frontend/tailwind.config.ts
@@ -212,6 +212,7 @@ export default {
relaxed: "1.8",
large: "1.7",
normal: "1.5",
+ close: "1.4",
snug: "1.3",
tight: "1.2",
none: "1.0",