From 71a9eaf2880aabce3a6e83cbe28b4713baf07c97 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 20:55:29 +0000 Subject: [PATCH] feat: add event details modal with edit history navigation - Added `EventDetailsModal` to display raw JSON and metadata. - Implemented `open-channel` action to navigate to creator profile. - Fixed profile image loading by checking `creatorPicture` and `creator.picture`. - Added `hideModal()` to `Application` class to fix crash in `openCreatorChannel`. - Wired up "Event Details" menu option in video card menu. - Ensured edit history is sorted Newest First for navigation. --- js/app.js | 7 +++++++ js/ui/components/EventDetailsModal.js | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/js/app.js b/js/app.js index a974e8ac..92572df8 100644 --- a/js/app.js +++ b/js/app.js @@ -254,6 +254,13 @@ class Application { } } + hideModal() { + if (this.videoModal) { + this.videoModal.close(); + } + // Also clear the active modal state if tracked elsewhere, though videoModal.close() usually handles it. + } + loadSavedProfilesFromStorage() { const result = this.authService.loadSavedProfilesFromStorage(); this.renderSavedProfiles(); diff --git a/js/ui/components/EventDetailsModal.js b/js/ui/components/EventDetailsModal.js index 6cbcddcf..0515ebe4 100644 --- a/js/ui/components/EventDetailsModal.js +++ b/js/ui/components/EventDetailsModal.js @@ -273,12 +273,12 @@ export class EventDetailsModal { if (authorNameEl) { // If we have profile data attached to the video object (which NostrService usually does) - const name = video.authorName || video.profile?.name || video.profile?.display_name || "Unknown"; + const name = video.authorName || video.profile?.name || video.profile?.display_name || video.creatorName || video.creator?.name || "Unknown"; authorNameEl.textContent = name; } if (authorPicEl) { - const picCandidate = video.authorPicture || video.profile?.picture || ""; + const picCandidate = video.authorPicture || video.profile?.picture || video.creatorPicture || video.creator?.picture || ""; const pic = sanitizeProfileMediaUrl(picCandidate) || DEFAULT_PROFILE_AVATAR; authorPicEl.src = pic; } @@ -340,9 +340,9 @@ export class EventDetailsModal { const enrichedHistory = history.map(h => ({ ...h, profile, - authorName: video.authorName, - authorPicture: video.authorPicture, - authorNpub: video.authorNpub + authorName: video.authorName || video.creatorName, + authorPicture: video.authorPicture || video.creatorPicture, + authorNpub: video.authorNpub || video.creatorNpub })); this.history = enrichedHistory;