From c738ab3ef7a0a16256a99bfb5e4ee1c092ad6cac Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Sun, 28 Dec 2025 16:34:02 -0700 Subject: [PATCH] Refactor Media Manager UI and Fix Infinite Loop - **UI Refactor**: - Split Media Manager header into two distinct cards: 'Product Info' and 'Upload Options'. - 'Product Info' now displays the Product Title and SKU. - Renamed upload buttons to 'Google Drive', 'Google Photos', and 'Your Computer' for clarity. - Added global drag-and-drop support with overlay. - Replaced full-screen 'Connecting' overlay with an inline spinner for better UX and log visibility. - **Backend**: - Renamed getSelectedSku to getSelectedProductInfo in mediaHandlers.ts to fetch and return both SKU and Title. - Updated global.ts exports and mediaHandlers.test.ts to support the new signature. - **Fixes**: - Resolved an infinite loop issue in loadMedia caused by incorrect SKU state handling. --- src/MediaManager.html | 127 ++++++++++++++++++++++++++------------ src/global.ts | 4 +- src/mediaHandlers.test.ts | 14 +++-- src/mediaHandlers.ts | 6 +- 4 files changed, 102 insertions(+), 49 deletions(-) diff --git a/src/MediaManager.html b/src/MediaManager.html index 39d6da8..12009ee 100644 --- a/src/MediaManager.html +++ b/src/MediaManager.html @@ -302,29 +302,39 @@