Skip to content

A self-hosted media server and file management system

fix: file name cannot be selected on hover

aminnausin8bf7a2f83937
diff --git a/resources/js/components/cards/data/VideoCard.vue b/resources/js/components/cards/data/VideoCard.vue
index 24b35a00..8b557df7 100644
--- a/resources/js/components/cards/data/VideoCard.vue
+++ b/resources/js/components/cards/data/VideoCard.vue
@@ -110,12 +110,20 @@ const dateInformation = computed(() => getMediaDateDescription(videoData));
>
<div class="flex flex-1 flex-col justify-between gap-x-8 gap-y-4 p-3 pb-2">
<div class="flex w-full items-center justify-between gap-x-4 gap-y-1 overflow-hidden">
- <h3
- class="line-clamp-1 min-w-8 text-sm break-all sm:text-base"
- :title="`Title: ${videoData.title}${videoData.name !== videoData.title ? `\nFile: ${videoData.name}` : ''}`"
+ <HoverCard
+ :disabled="videoData.name === videoData.title"
+ :content="`File: ${videoData.name}.${videoData.path.split('.').at(-1)}`"
+ :content-title="`${videoData.title}`"
+ :hover-card-delay="400"
+ :hover-card-leave-delay="300"
>
- {{ title }}
- </h3>
+ <template #trigger>
+ <h3 class="line-clamp-1 min-w-8 text-sm break-all sm:text-base" :title="videoData.name === videoData.title ? `Title: ${videoData.title}` : ''">
+ {{ title }}
+ </h3>
+ </template>
+ </HoverCard>
+
<div class="-ms-2 flex flex-1 gap-1">
<HoverCard
class="items-end"
diff --git a/resources/js/components/video/VideoInfoPanel.vue b/resources/js/components/video/VideoInfoPanel.vue
index 2226d108..280f09e6 100755
--- a/resources/js/components/video/VideoInfoPanel.vue
+++ b/resources/js/components/video/VideoInfoPanel.vue
@@ -209,17 +209,25 @@ onMounted(() => {
aria-labelledby="mp4-title"
>
<div id="mp4-header-mobile" aria-labelledby="mp4-title-mobile" class="flex w-full flex-wrap items-center gap-1 gap-x-2 sm:hidden">
- <HoverCard :content="title ?? '[File Not Found]'" class="min-w-10 flex-1">
+ <HoverCard
+ class="min-w-10 flex-1"
+ :disabled="!!title && stateVideo.name === stateVideo.title"
+ :content="!title ? 'No file was found at this location' : `File: ${stateVideo.name}.${stateVideo.path.split('.').at(-1)}`"
+ :content-title="title"
+ :hover-card-delay="400"
+ :hover-card-leave-delay="300"
+ >
<template #trigger>
<h2
id="mp4-title-mobile"
:class="['truncate text-xl capitalize', { 'my-auto h-5 w-full animate-pulse rounded-full bg-neutral-300 dark:bg-neutral-700': !stateVideo.id }]"
- :title="`Title: ${stateVideo.title}${stateVideo.name !== stateVideo.title ? `\nFile: ${stateVideo.name}` : ''}`"
+ :title="stateVideo.name === stateVideo.title && !!title ? `Title: ${stateVideo.title}` : ''"
>
{{ !stateVideo.id ? '' : (title ?? '[File Not Found]') }}
</h2>
</template>
</HoverCard>
+
<BasePopover
class="sm:hidden"
popoverClass="max-w-36 p-1 rounded-md shadow-xs"
@@ -317,14 +325,25 @@ onMounted(() => {
</ButtonIcon>
</div>
<div class="group flex w-full min-w-0 flex-1 flex-col gap-2">
- <header class="hidden justify-between gap-2 sm:flex">
- <h2
- id="mp4-title"
- :class="['flex-1 truncate text-xl capitalize', { 'suspense-rounded h-6': stateVideo.id < 1 }, { 'h-8': stateVideo.id > 1 }]"
- :title="title ? `Title: ${stateVideo.title}${stateVideo.name !== stateVideo.title ? `\nFile: ${stateVideo.name}` : ''}` : 'No file was found at this location'"
+ <header class="hidden w-full justify-between gap-2 sm:flex">
+ <HoverCard
+ :disabled="!!title && stateVideo.name === stateVideo.title"
+ :content="!title ? 'No file was found at this location' : `File: ${stateVideo.name}.${stateVideo.path.split('.').at(-1)}`"
+ :content-title="title"
+ :hover-card-delay="400"
+ :hover-card-leave-delay="300"
+ class="flex-1 overflow-hidden"
>
- {{ stateVideo.id < 1 ? '' : (title ?? '[File Not Found]') }}
- </h2>
+ <template #trigger>
+ <h2
+ id="mp4-title"
+ :class="['truncate text-xl capitalize', { 'suspense-rounded h-6': stateVideo.id < 1 }, { 'h-8': stateVideo.id > 1 }]"
+ :title="stateVideo.name === stateVideo.title && !!title ? `Title: ${stateVideo.title}` : ''"
+ >
+ {{ stateVideo.id < 1 ? '' : (title ?? '[File Not Found]') }}
+ </h2>
+ </template>
+ </HoverCard>
<div class="flex h-8 w-fit justify-end gap-2 select-none *:ring-inset lg:min-w-32">
<ButtonText v-if="isAuthenticated" aria-label="edit details" title="Edit Metadata" @click="handleEdit">
<span class="text-nowrap">Edit Metadata</span>