diff --git a/VERSION.properties b/VERSION.properties index e6ee987b..14758c08 100644 --- a/VERSION.properties +++ b/VERSION.properties @@ -1,2 +1,2 @@ -client.version=1.20.28 +client.version=1.20.29 server.version=1.16.19 diff --git a/shine-UI/js/pages/network-explorer/graph-model.js b/shine-UI/js/pages/network-explorer/graph-model.js index 6dd269e5..840398c6 100644 --- a/shine-UI/js/pages/network-explorer/graph-model.js +++ b/shine-UI/js/pages/network-explorer/graph-model.js @@ -55,7 +55,8 @@ export function createExplorerGraph() { // Если граф обновился, старые исходящие рёбра этого владельца больше не действуют. for (const edgeKey of edges.keys()) if (edgeKey.startsWith(`${owner}\u0000`)) edges.delete(edgeKey); const close = new Set((graph?.outCloseFriends || []).map(keyOf)); - const inbound = new Set([...(graph?.inFriends || []), ...(graph?.inCloseFriends || [])].map(keyOf)); + const inboundClose = new Set((graph?.inCloseFriends || []).map(keyOf)); + const inbound = new Set([...(graph?.inFriends || []), ...inboundClose].map(keyOf)); // Сохраняем оригинальный регистр логина для серверного API (ключи графа // нормализуем независимо, только для сопоставления вершин). const friendNames = new Map(); @@ -68,6 +69,7 @@ export function createExplorerGraph() { remember({ login: friendNames.get(id) }, id); edges.set(`${owner}\u0000${id}`, { from: owner, to: id, type: close.has(id) ? 'close_friend' : 'friend', + reverseType: inboundClose.has(id) ? 'close_friend' : (inbound.has(id) ? 'friend' : null), mutual: inbound.has(id), }); } @@ -162,7 +164,8 @@ export function createExplorerGraph() { if (!isExpanded(edge.from) && !isExpanded(edge.to)) continue; const detail = { id: parent, - relationType: edge.type === 'close_friend' || reverse?.type === 'close_friend' ? 'close_friend' : 'friend', + relationType: edge.type, + reverseRelationType: reverse?.type || edge.reverseType || null, mutual: Boolean(edge.mutual || reverse), strength: edge.type === 'close_friend' ? 0.9 : 0.55, }; diff --git a/shine-UI/js/pages/network-legacy/force-graph.js b/shine-UI/js/pages/network-legacy/force-graph.js index fce99f70..ffd8aedd 100644 --- a/shine-UI/js/pages/network-legacy/force-graph.js +++ b/shine-UI/js/pages/network-legacy/force-graph.js @@ -89,7 +89,7 @@ const DOUBLE_TAP_MS = 320; // окно двойного тапа по фо const RELATION_COLORS = { family: 'rgba(255, 159, 94, 0.92)', friend: 'rgba(120, 179, 255, 0.9)', - close_friend: 'rgba(120, 179, 255, 0.98)', + close_friend: 'rgba(255, 76, 92, 0.98)', business: 'rgba(190, 150, 255, 0.9)', contact: 'rgba(170, 190, 220, 0.7)', }; @@ -110,7 +110,7 @@ function easeOutCubic(t) { const RELATION_COLORS_LIGHT = { family: 'rgba(184, 92, 20, 0.9)', friend: 'rgba(38, 96, 196, 0.9)', - close_friend: 'rgba(38, 96, 196, 0.98)', + close_friend: 'rgba(214, 38, 55, 0.98)', business: 'rgba(108, 62, 200, 0.9)', contact: 'rgba(92, 98, 121, 0.75)', }; @@ -971,6 +971,8 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL function renderHistoryEdges() { const Z = zoom; const parts = []; + const defs = []; + let gradientIndex = 0; const tx = (n) => centerX + camX + n.x * Z; const ty = (n) => centerY + camY + n.y * Z; @@ -1014,6 +1016,7 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL const cpx = 2 * desX - mx; const cpy = 2 * desY - my; const relationType = String(ref?.relationType || n.relationType || 'contact'); + const reverseRelationType = String(ref?.reverseRelationType || ''); const strength = Math.max(0, Math.min(1, Number(ref?.strength) || Number(n.strength) || 0.5)); const opacity = Math.min(childOpacity, parentOpacity); const shine = Boolean(parent.shining && n.shining) && !n.hidden; @@ -1022,6 +1025,12 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL parts.push(...directedFriendEdgePaths(x1, y1, cpx, cpy, x2, y2, relationColor(relationType), opacity * 0.82)); continue; } + let edgeStroke = relationColor(relationType); + if (reverseRelationType && reverseRelationType !== relationType) { + const gradientId = `fg-relation-gradient-${gradientIndex++}`; + defs.push(``); + edgeStroke = `url(#${gradientId})`; + } if (shine) { const pnx = -uy; const pny = ux; @@ -1038,14 +1047,14 @@ export function createForceGraph({ stage, model, onCenterTap, onNodeTap, onNodeL parts.push(``); } else { const d = `M${x1.toFixed(1)} ${y1.toFixed(1)} Q${cpx.toFixed(1)} ${cpy.toFixed(1)} ${x2.toFixed(1)} ${y2.toFixed(1)}`; - const col = relationColor(relationType); + const col = edgeStroke; const haloWidth = (2.6 + strength * 1.4).toFixed(2); parts.push(``); parts.push(``); } } } - edgesSvg.innerHTML = parts.join(''); + edgesSvg.innerHTML = `${defs.join('')}${parts.join('')}`; } function renderEdges() { diff --git a/shine-UI/styles/network-legacy.css b/shine-UI/styles/network-legacy.css index 58b39e82..f5958500 100644 --- a/shine-UI/styles/network-legacy.css +++ b/shine-UI/styles/network-legacy.css @@ -421,6 +421,12 @@ pointer-events: none; } +.fg-filter-bar > button { + pointer-events: auto; + position: relative; + z-index: 1; +} + /* Стеклянные табы — тонкие пластины матового стекла (frosted glass) */ diff --git a/shine-UI/tests/network-explorer-v3.test.mjs b/shine-UI/tests/network-explorer-v3.test.mjs index 7eb6f396..d594d6a7 100644 --- a/shine-UI/tests/network-explorer-v3.test.mjs +++ b/shine-UI/tests/network-explorer-v3.test.mjs @@ -111,3 +111,13 @@ test('V3: регистр логина для запросов, обновлен assert.equal(g.snapshot('Alice').nodes.find((n) => n.id === 'bobuser').shining, false); assert.equal(g.snapshot('Alice').nodes.some((n) => n.id === 'carol'), false); }); + +test('V3: взаимная связь сохраняет оба типа для красно-синего перехода', () => { + const g = createExplorerGraph(); + g.add(friends('a', ['b'])); + g.add(friends('b', [], ['a'])); + const edge = find(g.snapshot('a', { depth: 0 }), 'b').edgeParents[0]; + assert.equal(edge.relationType, 'friend'); + assert.equal(edge.reverseRelationType, 'close_friend'); + assert.equal(edge.mutual, true); +});