Compare commits

..

2 Commits

Author SHA1 Message Date
Laan Tungir
360a4d83db Add debug logging for notification menu items 2026-07-01 16:54:24 -04:00
Laan Tungir
9400508f3e Fix notifications: keep interaction bar detached so only dropdown menu shows 2026-07-01 16:50:21 -04:00
2 changed files with 24 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
{
"VERSION": "v0.7.88",
"VERSION_NUMBER": "0.7.88",
"BUILD_DATE": "2026-07-01T19:56:16.258Z"
"VERSION": "v0.7.90",
"VERSION_NUMBER": "0.7.90",
"BUILD_DATE": "2026-07-01T20:54:24.423Z"
}

View File

@@ -457,6 +457,7 @@ import { createProfileCache } from './js/profile-cache.mjs';
const timeElements = new Map();
const postImageCache = new Map();
const targetEventCache = new Map();
const detachedInteractionBars = new Map();
let interactions = null;
let notifInteractionsSubId = null;
let visibleNotificationsCount = NOTIFICATIONS_PAGE_SIZE;
@@ -1104,21 +1105,28 @@ import { createProfileCache } from './js/profile-cache.mjs';
// Add interaction menu items (Like, Comment, Quote, Zap, Nutzap) when
// the notification references a target post. The actual interaction
// logic (publishing, zap dialogs, balance checks) is handled by the
// post-interactions module via a hidden interaction bar appended to
// the row. Menu items trigger clicks on the corresponding buttons
// in that hidden bar.
// post-interactions module via a detached interaction bar (kept out of
// the DOM so it never shows up in the row). Menu items trigger clicks
// on the corresponding buttons in that detached bar.
console.log('[notifications] buildNotificationRow menu check', {
notifId: item.id,
kind: item.kind,
targetEventId: item.targetEventId,
hasInteractions: !!interactions
});
if (item.targetEventId && interactions) {
const targetPubkey = item.targetPubkey || currentPubkey;
const targetEventData = { id: item.targetEventId, pubkey: targetPubkey };
const hiddenBar = interactions.renderInteractionBar(
item.targetEventId,
targetEventData,
{ currentPubkey }
);
hiddenBar.style.display = 'none';
hiddenBar.dataset.notifHiddenBar = item.targetEventId;
row.appendChild(hiddenBar);
let hiddenBar = detachedInteractionBars.get(item.id);
if (!hiddenBar) {
hiddenBar = interactions.renderInteractionBar(
item.targetEventId,
targetEventData,
{ currentPubkey }
);
detachedInteractionBars.set(item.id, hiddenBar);
}
const addMenuBtn = (label, selector) => {
const btn = document.createElement('button');
@@ -1206,6 +1214,7 @@ import { createProfileCache } from './js/profile-cache.mjs';
divNotifications.innerHTML = '';
timeElements.clear();
detachedInteractionBars.clear();
for (const item of visibleItems) {
const row = buildNotificationRow(item);
@@ -1502,6 +1511,7 @@ import { createProfileCache } from './js/profile-cache.mjs';
notificationsReadAt = readAt;
notificationsById.clear();
unreadNotificationsById.clear();
detachedInteractionBars.clear();
visibleNotificationsCount = NOTIFICATIONS_PAGE_SIZE;
renderNotifications();