Добавить Canvas v4 для исследования связей

This commit is contained in:
AidarKC
2026-11-19 21:13:24 +03:00
parent 8f3b81c368
commit 859dbee1f1
19 changed files with 993 additions and 41 deletions
+21 -9
View File
@@ -39,6 +39,7 @@ import {
softHaptic,
} from '../services/channels-ux.js';
import { renderAvatar, renderUserAvatar } from '../components/avatar-image.js';
import { createDropdownMenu } from '../components/dropdown-menu.js';
import { avatarReferenceToRenderModel, parseAvatarReference } from '../services/avatar-reference.js';
import { openChannelEditor } from '../components/channel-editor.js';
import { markArweaveAttachmentPlaced, openArweaveAttachmentManager } from '../components/arweave-attachment-manager.js';
@@ -50,7 +51,7 @@ import {
MAX_MESSAGE_ATTACHMENTS,
parseMessageAttachments,
} from '../services/attachment-format.js';
import { loadProfileSnapshot } from '../services/user-profile-params.js';
import { loadProfileSnapshot, profileDisplayName } from '../services/user-profile-params.js';
import {
extractLoginFromBlockchainName,
makeProfileRoute,
@@ -1849,17 +1850,16 @@ function renderPostCard(post, {
const title = document.createElement('div');
title.className = 'channel-message-title author-line';
const displayNameEl = document.createElement('span');
displayNameEl.className = 'author-line-name';
displayNameEl.textContent = post.authorLogin;
const titleMain = document.createElement('div');
titleMain.className = 'author-line-main';
const loginEl = document.createElement('span');
loginEl.className = 'author-line-login';
loginEl.textContent = post.authorLogin;
const numberEl = document.createElement('span');
numberEl.className = 'author-line-num';
numberEl.textContent = `· #${post.localNumber}`;
titleMain.append(loginEl, numberEl);
title.append(titleMain);
loginEl.textContent = `@${String(post.authorLogin || '').replace(/^@/, '')}`;
titleMain.append(loginEl);
title.append(displayNameEl, titleMain);
const timestamp = document.createElement('div');
timestamp.className = 'channel-message-time';
@@ -1912,7 +1912,19 @@ function renderPostCard(post, {
event.stopPropagation();
const cleanLogin = String(post.authorLogin || '').trim();
if (!cleanLogin) return;
navigate(makeProfileRoute(cleanLogin));
profileMenu.toggle();
});
const profileMenu = createDropdownMenu({
anchorEl: authorTile,
minWidth: 190,
dimBackground: false,
items: [{ label: t('screens.chat_view.text_004'), iconHtml: iconHtml('profile'), action: () => navigate(makeProfileRoute(String(post.authorLogin || '').trim())) }],
});
const existingCleanup = card.cleanup;
card.cleanup = () => { existingCleanup?.(); profileMenu.destroy(); };
void loadMessageAvatarSnapshot(post.authorLogin).then((snapshot) => {
if (!authorTile.isConnected) return;
displayNameEl.textContent = profileDisplayName(snapshot, post.authorLogin);
});
const isOwnerPost = !!selector