Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Fix the full-height layout (#2160)

Olga Bulatbdf9ac32d2f6
diff --git a/frontend/src/components/VErrorSection/VNoResults.vue b/frontend/src/components/VErrorSection/VNoResults.vue
index 90888acf9..8d3e78b05 100644
--- a/frontend/src/components/VErrorSection/VNoResults.vue
+++ b/frontend/src/components/VErrorSection/VNoResults.vue
@@ -28,9 +28,10 @@
</template>
<script lang="ts">
-import { defineComponent, PropType } from "vue"
+import { defineComponent, onMounted, PropType } from "vue"
import { useAnalytics } from "~/composables/use-analytics"
+import { useUiStore } from "~/stores/ui"
import type { ExternalSource } from "~/types/external-source"
@@ -75,6 +76,11 @@ export default defineComponent({
})
}
+ onMounted(() => {
+ const uiStore = useUiStore()
+ uiStore.setFiltersState(false)
+ })
+
return {
handleClick,
}
diff --git a/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue b/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue
index 5f19ac18b..32cff1cbb 100644
--- a/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue
+++ b/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue
@@ -45,7 +45,7 @@
v-show="isRecentVisible"
:selected-idx="selectedIdx"
:entries="entries"
- class="absolute inset-x-0 lg:flex"
+ class="absolute inset-x-0 z-popover lg:flex"
:class="recentClasses"
@select="handleSelect"
@clear="handleClear"
diff --git a/frontend/src/components/VModal/VModalContent.vue b/frontend/src/components/VModal/VModalContent.vue
index bc81c353c..1e98d0d7e 100644
--- a/frontend/src/components/VModal/VModalContent.vue
+++ b/frontend/src/components/VModal/VModalContent.vue
@@ -175,8 +175,7 @@ export default defineComponent({
@apply bg-tx;
}
.modal-backdrop {
- /* linting plugin changes the order if we use non-custom value of h-screen for 100vh */
- @apply h-[100dvh] h-[100vh];
+ @apply h-[100dvh] max-h-[100dvh];
}
.modal-backdrop-fit-content,
.modal-backdrop-two-thirds {
@@ -193,7 +192,7 @@ export default defineComponent({
@apply w-full;
}
.modal-two-thirds {
- @apply mt-auto h-2/3 w-full rounded-se-lg rounded-ss-lg bg-white;
+ @apply mt-auto h-2/3 w-full rounded-se-lg rounded-ss-lg bg-white;
}
.modal-dark {
diff --git a/frontend/src/components/VScrollButton.vue b/frontend/src/components/VScrollButton.vue
index b3ba7bc28..d6290e9be 100644
--- a/frontend/src/components/VScrollButton.vue
+++ b/frontend/src/components/VScrollButton.vue
@@ -1,8 +1,8 @@
<template>
<button
- :aria-label="$t('browse-page.aria.scroll')"
+ :aria-label="$t('browse-page.aria.scroll').toString()"
type="button"
- class="scroll sticky bottom-4 mb-4 ms-auto h-14 w-14 rounded-full bg-pink text-center text-white transition-all duration-100 ease-linear hover:bg-dark-pink hover:shadow-md"
+ class="scroll fixed bottom-4 mb-4 ms-auto h-14 w-14 rounded-full bg-pink text-center text-white transition-all duration-100 ease-linear hover:bg-dark-pink hover:shadow-md"
:class="hClass"
@click="scrollToTop"
@keydown.tab.exact="$emit('tab', $event)"
@@ -25,7 +25,7 @@ import { computed, defineComponent } from "vue"
import { defineEvent } from "~/types/emits"
const positionWithoutSidebar = "ltr:right-4 rtl:left-4"
-const positionWithSidebar = "ltr:right-[21rem] rtl:left-[21rem]"
+const positionWithSidebar = "ltr:right-[22rem] rtl:left-[22rem]"
export default defineComponent({
name: "VScrollButton",
@@ -44,8 +44,10 @@ export default defineComponent({
? positionWithSidebar
: positionWithoutSidebar
)
- const scrollToTop = () => {
- window.scrollTo({ top: 0, left: 0, behavior: "smooth" })
+ const scrollToTop = (e: MouseEvent) => {
+ const element =
+ (e.currentTarget as HTMLElement)?.closest("#main-page") || window
+ element.scrollTo({ top: 0, left: 0, behavior: "smooth" })
}
return { hClass, scrollToTop }
},
diff --git a/frontend/src/layouts/content-layout.vue b/frontend/src/layouts/content-layout.vue
index 64801e53f..15c4f78a6 100644
--- a/frontend/src/layouts/content-layout.vue
+++ b/frontend/src/layouts/content-layout.vue
@@ -1,68 +1,44 @@
<template>
<div
- class="app flex grid min-h-[100dvh] min-h-screen grid-rows-[auto,1fr,auto] bg-white"
- :class="[
- isDesktopLayout ? 'desktop' : 'mobile',
- breakpoint,
- { 'has-sidebar': isSidebarVisible },
- isSidebarVisible
- ? 'grid-cols-[1fr_var(--filter-sidebar-width)]'
- : 'grid-cols-1',
- ]"
+ class="app grid min-h-[100dvh] min-h-screen grid-cols-1 grid-rows-[auto,1fr,auto] bg-white"
+ :class="[isDesktopLayout ? 'desktop' : 'mobile', breakpoint]"
>
<div class="header-el sticky top-0 z-40 block bg-white">
<VTeleportTarget name="skip-to-content" :force-destroy="true" />
<VBanners />
- <template v-if="isSearchHeader">
- <VHeaderDesktop v-if="isDesktopLayout" class="h-20 bg-white" />
- <VHeaderMobile v-else class="h-20 bg-white" />
- </template>
<VHeaderInternal
- v-else
class="h-20 bg-white"
:class="{ 'border-b-dark-charcoal-20': isHeaderScrolled }"
/>
</div>
- <aside
- v-if="isSidebarVisible"
- class="sidebar fixed end-0 z-10 mt-[80px] h-[calc(100dvh-80px)] h-[calc(100vh-80px)] overflow-y-auto border-s border-dark-charcoal-20 bg-dark-charcoal-06"
- >
- <VSearchGridFilter class="px-10 pb-10 pt-8" @close="closeSidebar" />
- </aside>
-
<div class="main-page flex h-full w-full min-w-0 flex-col justify-between">
<Nuxt />
<VFooter
- :mode="isSearchHeader ? 'content' : 'internal'"
+ mode="internal"
class="border-t border-dark-charcoal-20 bg-white"
/>
</div>
<VModalTarget class="modal" />
- <VGlobalAudioSection />
</div>
</template>
<script lang="ts">
import { computed, defineComponent, onMounted, provide, ref, watch } from "vue"
-import { useContext } from "@nuxtjs/composition-api"
import { PortalTarget as VTeleportTarget } from "portal-vue"
import { useWindowScroll } from "~/composables/use-window-scroll"
-import { useMatchSearchRoutes } from "~/composables/use-match-routes"
import { useLayout } from "~/composables/use-layout"
import { useUiStore } from "~/stores/ui"
-import { useSearchStore } from "~/stores/search"
import { useFeatureFlagStore } from "~/stores/feature-flag"
-import { IsHeaderScrolledKey, IsSidebarVisibleKey } from "~/types/provides"
+import { IsHeaderScrolledKey, ShowScrollButtonKey } from "~/types/provides"
import VBanners from "~/components/VBanner/VBanners.vue"
import VFooter from "~/components/VFooter/VFooter.vue"
import VModalTarget from "~/components/VModal/VModalTarget.vue"
-import VGlobalAudioSection from "~/components/VGlobalAudioSection/VGlobalAudioSection.vue"
-import VSearchGridFilter from "~/components/VFilters/VSearchGridFilter.vue"
+import VHeaderInternal from "~/components/VHeader/VHeaderInternal.vue"
/**
* This is the ContentLayout: the search page, the single result page,
@@ -73,20 +49,13 @@ export default defineComponent({
name: "ContentLayout",
components: {
VBanners,
- VHeaderDesktop: () => import("~/components/VHeader/VHeaderDesktop.vue"),
- VHeaderInternal: () => import("~/components/VHeader/VHeaderInternal.vue"),
- VHeaderMobile: () =>
- import("~/components/VHeader/VHeaderMobile/VHeaderMobile.vue"),
+ VHeaderInternal,
VFooter,
VModalTarget,
VTeleportTarget,
- VGlobalAudioSection,
- VSearchGridFilter,
},
setup() {
- const { app } = useContext()
const uiStore = useUiStore()
- const searchStore = useSearchStore()
const featureStore = useFeatureFlagStore()
onMounted(() => {
@@ -104,29 +73,9 @@ export default defineComponent({
updateBreakpoint()
})
- const { matches: isSearchRoute } = useMatchSearchRoutes()
-
- const nuxtError = computed(() => app.nuxt.err)
-
- const isSearchHeader = computed(
- () => !nuxtError.value && isSearchRoute.value
- )
-
const isDesktopLayout = computed(() => uiStore.isDesktopLayout)
const breakpoint = computed(() => uiStore.breakpoint)
- /**
- * Filters sidebar is visible only on desktop layouts
- * on search result pages for supported search types.
- */
- const isSidebarVisible = computed(
- () =>
- isSearchRoute.value &&
- searchStore.searchTypeIsSupported &&
- uiStore.isFilterVisible &&
- isDesktopLayout.value
- )
-
const closeSidebar = () => {
uiStore.setFiltersState(false)
}
@@ -138,16 +87,12 @@ export default defineComponent({
})
const showScrollButton = computed(() => scrollY.value > 70)
- provide("showScrollButton", showScrollButton)
+ provide(ShowScrollButtonKey, showScrollButton)
provide(IsHeaderScrolledKey, isHeaderScrolled)
- provide(IsSidebarVisibleKey, isSidebarVisible)
return {
isHeaderScrolled,
isDesktopLayout,
- isSidebarVisible,
- isSearchRoute,
- isSearchHeader,
breakpoint,
closeSidebar,
@@ -163,9 +108,6 @@ export default defineComponent({
</script>
<style scoped>
-.has-sidebar .sidebar {
- width: var(--filter-sidebar-width);
-}
.app {
grid-template-areas: "header" "main" "global-audio";
}
@@ -175,10 +117,4 @@ export default defineComponent({
.main-page {
grid-area: main;
}
-.sidebar {
- grid-area: sidebar;
-}
-.has-sidebar.app {
- grid-template-areas: "header header" "main sidebar";
-}
</style>
diff --git a/frontend/src/layouts/default.vue b/frontend/src/layouts/default.vue
index 93a1b42a5..3fdbcebde 100644
--- a/frontend/src/layouts/default.vue
+++ b/frontend/src/layouts/default.vue
@@ -1,15 +1,17 @@
<template>
<div
- class="app flex h-[100dvh] h-screen flex-col bg-yellow"
+ class="app grid h-[100dvh] h-screen grid-cols-1 grid-rows-[auto,1fr] flex-col bg-yellow"
:class="[isDesktopLayout ? 'desktop' : 'mobile', breakpoint]"
>
- <div class="sticky top-0 z-40 block">
+ <div class="header-el">
<VTeleportTarget name="skip-to-content" :force-destroy="true" />
<VBanners />
<VHeaderInternal class="bg-yellow" />
</div>
- <Nuxt class="flex-grow" />
- <VFooter mode="search" class="bg-yellow" />
+ <div class="main-content flex flex-grow flex-col overflow-y-scroll">
+ <Nuxt class="flex-grow" />
+ <VFooter mode="internal" class="bg-yellow" />
+ </div>
<VModalTarget class="modal" />
<VGlobalAudioSection />
@@ -78,3 +80,15 @@ export default defineComponent({
},
})
</script>
+
+<style scoped>
+.app {
+ grid-template-areas: "header" "main";
+}
+.header-el {
+ grid-area: header;
+}
+.main-content {
+ grid-area: main;
+}
+</style>
diff --git a/frontend/src/layouts/search-layout.vue b/frontend/src/layouts/search-layout.vue
new file mode 100644
index 000000000..782a6161a
--- /dev/null
+++ b/frontend/src/layouts/search-layout.vue
@@ -0,0 +1,187 @@
+<template>
+ <div
+ class="app grid h-[100dvh] h-[100vh] min-h-[100dvh] min-h-[100vh] grid-rows-[auto,1fr,auto] bg-white"
+ :class="[
+ isDesktopLayout ? 'desktop' : 'mobile',
+ breakpoint,
+ { 'has-sidebar': isSidebarVisible },
+ isSidebarVisible
+ ? 'grid-cols-[1fr_var(--filter-sidebar-width)]'
+ : 'grid-cols-1',
+ ]"
+ >
+ <div class="header-el bg-white">
+ <VTeleportTarget name="skip-to-content" :force-destroy="true" />
+ <VBanners />
+ <VHeaderDesktop v-if="isDesktopLayout" class="h-20 bg-white" />
+ <VHeaderMobile v-else class="h-20 bg-white" />
+ </div>
+
+ <aside
+ v-if="isSidebarVisible"
+ class="sidebar end-0 z-10 h-full overflow-y-auto border-s border-dark-charcoal-20 bg-dark-charcoal-06"
+ >
+ <VSearchGridFilter class="px-10 pb-10 pt-8" @close="closeSidebar" />
+ </aside>
+
+ <div
+ id="main-page"
+ class="main-page flex h-full w-full min-w-0 flex-col justify-between overflow-y-auto"
+ >
+ <Nuxt />
+ <VFooter
+ mode="content"
+ class="border-t border-dark-charcoal-20 bg-white"
+ />
+ </div>
+
+ <VModalTarget class="modal" />
+ <VGlobalAudioSection />
+ </div>
+</template>
+<script lang="ts">
+import { computed, defineComponent, onMounted, provide, ref, watch } from "vue"
+import { useScroll } from "@vueuse/core"
+import { PortalTarget as VTeleportTarget } from "portal-vue"
+
+import { useLayout } from "~/composables/use-layout"
+
+import { useUiStore } from "~/stores/ui"
+import { useSearchStore } from "~/stores/search"
+import { useFeatureFlagStore } from "~/stores/feature-flag"
+
+import {
+ IsHeaderScrolledKey,
+ IsSidebarVisibleKey,
+ ShowScrollButtonKey,
+} from "~/types/provides"
+
+import VBanners from "~/components/VBanner/VBanners.vue"
+import VFooter from "~/components/VFooter/VFooter.vue"
+import VModalTarget from "~/components/VModal/VModalTarget.vue"
+import VGlobalAudioSection from "~/components/VGlobalAudioSection/VGlobalAudioSection.vue"
+import VSearchGridFilter from "~/components/VFilters/VSearchGridFilter.vue"
+
+/**
+ * This is the SearchLayout: the search page that has a sidebar.
+ * It has white background.
+ */
+export default defineComponent({
+ name: "SearchLayout",
+ components: {
+ VBanners,
+ VHeaderDesktop: () => import("~/components/VHeader/VHeaderDesktop.vue"),
+ VHeaderMobile: () =>
+ import("~/components/VHeader/VHeaderMobile/VHeaderMobile.vue"),
+ VFooter,
+ VModalTarget,
+ VTeleportTarget,
+ VGlobalAudioSection,
+ VSearchGridFilter,
+ },
+ setup() {
+ const headerRef = ref<HTMLElement | null>(null)
+ const mainPageRef = ref<HTMLElement | null>(null)
+
+ const uiStore = useUiStore()
+ const searchStore = useSearchStore()
+
+ const featureStore = useFeatureFlagStore()
+ onMounted(() => {
+ featureStore.initFromSession()
+ })
+
+ const { updateBreakpoint } = useLayout()
+
+ /**
+ * Update the breakpoint value in the cookie on mounted.
+ * The Pinia state might become different from the cookie state if, for example, the cookies were saved when the screen was `sm`,
+ * and then a page is opened on SSR on a `lg` screen.
+ */
+ onMounted(() => {
+ updateBreakpoint()
+ })
+
+ const isDesktopLayout = computed(() => uiStore.isDesktopLayout)
+ const breakpoint = computed(() => uiStore.breakpoint)
+
+ /**
+ * Filters sidebar is visible only on desktop layouts
+ * on search result pages for supported search types.
+ */
+ const isSidebarVisible = computed(
+ () =>
+ searchStore.searchTypeIsSupported &&
+ uiStore.isFilterVisible &&
+ isDesktopLayout.value
+ )
+
+ const closeSidebar = () => {
+ uiStore.setFiltersState(false)
+ }
+
+ const isHeaderScrolled = ref(false)
+ const showScrollButton = ref(false)
+
+ /**
+ * Update the `isHeaderScrolled` and `showScrollButton` values on `main-page` scroll.
+ *
+ * Note: template refs do not work in a Nuxt layout, so we get the `main-page` element using `document.getElementById`.
+ */
+ let mainPageElement = ref<HTMLElement | null>(null)
+
+ const { y: mainPageY } = useScroll(mainPageElement)
+ watch(mainPageY, (y) => {
+ isHeaderScrolled.value = y > 0
+ showScrollButton.value = y > 70
+ })
+
+ onMounted(() => {
+ mainPageElement.value = document.getElementById("main-page")
+ })
+
+ provide(ShowScrollButtonKey, showScrollButton)
+ provide(IsHeaderScrolledKey, isHeaderScrolled)
+ provide(IsSidebarVisibleKey, isSidebarVisible)
+
+ return {
+ mainPageRef,
+ headerRef,
+
+ isHeaderScrolled,
+ isDesktopLayout,
+ isSidebarVisible,
+ breakpoint,
+
+ closeSidebar,
+ }
+ },
+ head() {
+ return this.$nuxtI18nHead({
+ addSeoAttributes: true,
+ addDirAttribute: true,
+ })
+ },
+})
+</script>
+
+<style scoped>
+.has-sidebar .sidebar {
+ width: var(--filter-sidebar-width);
+}
+.app {
+ grid-template-areas: "header" "main" "global-audio";
+}
+.header-el {
+ grid-area: header;
+}
+.main-page {
+ grid-area: main;
+}
+.sidebar {
+ grid-area: sidebar;
+}
+.has-sidebar.app {
+ grid-template-areas: "header header" "main sidebar";
+}
+</style>
diff --git a/frontend/src/pages/search.vue b/frontend/src/pages/search.vue
index 93a020e2d..af5cc3d7d 100644
--- a/frontend/src/pages/search.vue
+++ b/frontend/src/pages/search.vue
@@ -37,7 +37,7 @@ import { defineComponent, useMeta } from "@nuxtjs/composition-api"
import { useMediaStore } from "~/stores/media"
import { useSearchStore } from "~/stores/search"
-import { IsSidebarVisibleKey } from "~/types/provides"
+import { IsSidebarVisibleKey, ShowScrollButtonKey } from "~/types/provides"
import VSearchGrid from "~/components/VSearchGrid.vue"
import VSkipToContentContainer from "~/components/VSkipToContentContainer.vue"
@@ -64,7 +64,7 @@ export default defineComponent({
}
next()
},
- layout: "content-layout",
+ layout: "search-layout",
middleware({ route, redirect }) {
/**
* This anonymous middleware redirects any search without a query to the homepage.
@@ -78,7 +78,7 @@ export default defineComponent({
setup() {
const searchGridRef = ref<InstanceType<typeof VSearchGrid> | null>(null)
- const showScrollButton = inject("showScrollButton")
+ const showScrollButton = inject(ShowScrollButtonKey)
const isSidebarVisible = inject(IsSidebarVisibleKey)
const mediaStore = useMediaStore()
const searchStore = useSearchStore()
diff --git a/frontend/src/types/provides.ts b/frontend/src/types/provides.ts
index a57efa6e4..54c664e02 100644
--- a/frontend/src/types/provides.ts
+++ b/frontend/src/types/provides.ts
@@ -2,3 +2,4 @@ import type { InjectionKey, Ref } from "vue"
export const IsHeaderScrolledKey = Symbol() as InjectionKey<Ref<boolean>>
export const IsSidebarVisibleKey = Symbol() as InjectionKey<Ref<boolean>>
+export const ShowScrollButtonKey = Symbol() as InjectionKey<Ref<boolean>>
diff --git a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts
index c9a7cb95c..78a0150ec 100644
--- a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts
+++ b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts
@@ -24,6 +24,10 @@ for (const dir of languageDirections) {
name: t("externalSources.button", dir),
})
+ await page
+ .getByRole("contentinfo")
+ .getByRole("link", { name: "Openverse" })
+ .hover()
await externalSourcesButton.click()
await expectSnapshot(
diff --git a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-audio-sources-popover-ltr-sm-linux.png b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-audio-sources-popover-ltr-sm-linux.png
index 84a7e0e1f..eac7b1921 100644
Binary files a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-audio-sources-popover-ltr-sm-linux.png and b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-audio-sources-popover-ltr-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-sm-linux.png b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-sm-linux.png
index fdf0c954f..f55c4e700 100644
Binary files a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-sm-linux.png and b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-xl-linux.png b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-xl-linux.png
index 88ef96c89..5aa3a2d8f 100644
Binary files a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-xl-linux.png and b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-ltr-xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-sm-linux.png b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-sm-linux.png
index f792bd036..b61b77ee6 100644
Binary files a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-sm-linux.png and b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-xl-linux.png b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-xl-linux.png
index 0a8fd6290..dfdc29de1 100644
Binary files a/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-xl-linux.png and b/frontend/test/playwright/visual-regression/components/external-sources-section.spec.ts-snapshots/external-image-sources-popover-rtl-xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-ltr-png-xs-linux.png b/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-ltr-png-xs-linux.png
index a1cc9f00e..f1e83a954 100644
Binary files a/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-ltr-png-xs-linux.png and b/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-ltr-png-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-rtl-png-xs-linux.png b/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-rtl-png-xs-linux.png
index 93cbc2b14..32271e102 100644
Binary files a/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-rtl-png-xs-linux.png and b/frontend/test/playwright/visual-regression/components/global-audio-player.spec.ts-snapshots/global-audio-player-on-search-rtl-png-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts
index fa070e15a..2b9fe5a91 100644
--- a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts
+++ b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts
@@ -26,9 +26,29 @@ for (const searchType of supportedSearchTypes) {
await goToSearchTerm(page, "querywithnoresults", { dir, searchType })
- await expectSnapshot(`no-results-${searchType}-${dir}`, page, {
- fullPage: true,
+ // Because of the overflow scroll, we cannot use `fullPage` screenshots.
+ // Instead, we set the viewport to the full height of the page content.
+ const viewportHeight = await page.evaluate(() => {
+ const headerElHeight =
+ document.querySelector(".header-el")?.clientHeight ?? 0
+
+ // Get the height of the children of the "#main-page" element
+ const mainPageChildren =
+ document.getElementById("main-page")?.children ?? []
+ const childHeight = Array.from(mainPageChildren).reduce(
+ (acc, child) => acc + child.clientHeight,
+ 0
+ )
+ return childHeight + headerElHeight
+ })
+
+ const viewportWidth = (await page.viewportSize()?.width) ?? 0
+ await page.setViewportSize({
+ width: viewportWidth,
+ height: viewportHeight + 1,
})
+
+ await expectSnapshot(`no-results-${searchType}-${dir}`, page)
})
})
}
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-md-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-md-linux.png
index 0281a3da2..4dd28c23d 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-md-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-md-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-sm-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-sm-linux.png
index fe3bcd089..25c4e324e 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-sm-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xl-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xl-linux.png
index 8bd082a62..d99b7ff0d 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xl-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xs-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xs-linux.png
index abe05afe6..250eb8c22 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xs-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-ltr-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-md-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-md-linux.png
index 6508bd84e..a08a35013 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-md-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-md-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-sm-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-sm-linux.png
index aa47b0e05..42a44162a 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-sm-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xl-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xl-linux.png
index f670bab6f..008610566 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xl-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xs-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xs-linux.png
index aaf0867f8..c2d4527c1 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xs-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-all-rtl-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-lg-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-lg-linux.png
index d3df1d99d..0b4a26bc1 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-lg-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-lg-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-md-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-md-linux.png
index 5fc804838..cf6d5befc 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-md-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-md-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-sm-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-sm-linux.png
index f64d24e7c..f07fcb2b2 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-sm-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-xs-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-xs-linux.png
index db77ab1c8..b811d9a4c 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-xs-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-ltr-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-md-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-md-linux.png
index 4c38a9d0a..73b773e1e 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-md-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-md-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-sm-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-sm-linux.png
index 1080fff31..0520dd320 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-sm-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-xs-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-xs-linux.png
index 02407dbf0..676501082 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-xs-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-audio-rtl-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-md-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-md-linux.png
index 0281a3da2..4dd28c23d 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-md-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-md-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-sm-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-sm-linux.png
index fe3bcd089..25c4e324e 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-sm-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xl-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xl-linux.png
index 447fb3a0a..44aaa429d 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xl-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xs-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xs-linux.png
index abe05afe6..250eb8c22 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xs-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-ltr-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-md-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-md-linux.png
index 6508bd84e..a08a35013 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-md-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-md-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-sm-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-sm-linux.png
index aa47b0e05..42a44162a 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-sm-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-sm-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xl-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xl-linux.png
index 968ba3f72..4612a7e31 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xl-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xs-linux.png b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xs-linux.png
index aaf0867f8..c2d4527c1 100644
Binary files a/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xs-linux.png and b/frontend/test/playwright/visual-regression/pages/no-results.spec.ts-snapshots/no-results-image-rtl-xs-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-2xl-linux.png b/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-2xl-linux.png
index 541a6eaa2..94fef6eb2 100644
Binary files a/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-2xl-linux.png and b/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-2xl-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-lg-linux.png b/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-lg-linux.png
index dcb0a8eb6..b124a573c 100644
Binary files a/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-lg-linux.png and b/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-lg-linux.png differ
diff --git a/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-xl-linux.png b/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-xl-linux.png
index ccf1123da..25f6023a7 100644
Binary files a/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-xl-linux.png and b/frontend/test/playwright/visual-regression/pages/search-with-banners.spec.ts-snapshots/page-with-all-banners-xl-linux.png differ
diff --git a/frontend/test/unit/specs/pages/browse-page.spec.js b/frontend/test/unit/specs/pages/browse-page.spec.js
index 3ab2f217c..4f55a78fb 100644
--- a/frontend/test/unit/specs/pages/browse-page.spec.js
+++ b/frontend/test/unit/specs/pages/browse-page.spec.js
@@ -8,7 +8,11 @@ import { useSearchStore } from "~/stores/search"
import SearchIndex from "~/pages/search.vue"
-import { IsHeaderScrolledKey, IsSidebarVisibleKey } from "~/types/provides"
+import {
+ IsHeaderScrolledKey,
+ IsSidebarVisibleKey,
+ ShowScrollButtonKey,
+} from "~/types/provides"
describe("SearchIndex", () => {
let options
@@ -16,6 +20,7 @@ describe("SearchIndex", () => {
showScrollButton: ref(false),
[IsHeaderScrolledKey]: ref(false),
[IsSidebarVisibleKey]: ref(false),
+ [ShowScrollButtonKey]: ref(false),
}
let searchStore
@@ -47,7 +52,7 @@ describe("SearchIndex", () => {
})
it("shows the scroll button when injected value is true", () => {
- options.provide.showScrollButton.value = true
+ options.provide[ShowScrollButtonKey].value = true
render(SearchIndex, options, (localVue, options) => {
searchStore = useSearchStore(options.pinia)
searchStore.setSearchTerm("cat")
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index d8123cee1..0ad5c0209 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -52,6 +52,7 @@
"src/components/TableSortIcon.vue",
"src/components/VCopyButton.vue",
"src/components/VSketchFabViewer.vue",
+ "src/components/VScrollButton.vue",
"src/components/VAudioThumbnail/**.vue",
"src/components/VAudioTrack/layouts/**.vue",