From 6c24bc928c9d45fc89cae674d594df714a6d7f55 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Fri, 27 Feb 2026 18:07:38 +0100 Subject: [PATCH] Refactor: Create reusable PlexLibraryItem component with grid layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create new PlexLibraryItem.vue component - Displays poster with fallback icon - Shows title, year, and rating - Optional extras (artist, episodes, tracks) - Hover effect with translateY animation - Responsive font sizes for mobile - Update PlexLibraryModal to use grid layout - Replace vertical list with CSS Grid - Grid: repeat(auto-fill, minmax(140px, 1fr)) - Mobile: minmax(110px, 1fr) with reduced gap - Much better space utilization - Items flow horizontally then vertically - Remove duplicate styles from modal - Removed 69 lines of item styling - All item display logic in PlexLibraryItem - Cleaner separation of concerns Benefits: - Better visual presentation (grid vs vertical list) - More items visible at once - Reusable component for future Plex features - Reduced modal complexity (284 → 215 lines) --- src/components/plex/PlexLibraryItem.vue | 157 +++++++++++++++++++++++ src/components/plex/PlexLibraryModal.vue | 133 +++---------------- 2 files changed, 173 insertions(+), 117 deletions(-) create mode 100644 src/components/plex/PlexLibraryItem.vue diff --git a/src/components/plex/PlexLibraryItem.vue b/src/components/plex/PlexLibraryItem.vue new file mode 100644 index 0000000..0148472 --- /dev/null +++ b/src/components/plex/PlexLibraryItem.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/src/components/plex/PlexLibraryModal.vue b/src/components/plex/PlexLibraryModal.vue index 07c118d..adf19a7 100644 --- a/src/components/plex/PlexLibraryModal.vue +++ b/src/components/plex/PlexLibraryModal.vue @@ -40,51 +40,13 @@

Recently Added

-
-
+ -
- - - {{ item.fallbackIcon }} - -
-
-
{{ item.title }}
-
- - {{ item.artist }} • - - {{ item.year }} - - • {{ item.episodes }} episodes - - • {{ item.tracks }} tracks -
-
-
- - - - {{ item.rating }} -
-
+ :item="item" + :show-extras="libraryType === 'music' || libraryType === 'shows'" + />
@@ -117,6 +79,7 @@