From d39d2777d13bf65804ddc2a354a7b34983e7741d236d01bae7bfea04de28e4ed Mon Sep 17 00:00:00 2001 From: AidarKC Date: Wed, 11 Nov 2026 01:09:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BA=D1=82=D0=BD=D1=83?= =?UTF-8?q?=D1=8E=20=D0=BF=D0=B5=D1=80=D0=B5=D1=80=D0=B8=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D1=83=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B5=D0=B9=20V3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION.properties | 2 +- shine-UI/js/i18n/locales/en.json | 1 + shine-UI/js/i18n/locales/ru.json | 1 + .../js/pages/network-explorer/network-view.js | 20 +++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/VERSION.properties b/VERSION.properties index 08f229b8..9e505231 100644 --- a/VERSION.properties +++ b/VERSION.properties @@ -1,2 +1,2 @@ -client.version=1.20.32 +client.version=1.20.33 server.version=1.16.19 diff --git a/shine-UI/js/i18n/locales/en.json b/shine-UI/js/i18n/locales/en.json index a84fd824..9b988c87 100644 --- a/shine-UI/js/i18n/locales/en.json +++ b/shine-UI/js/i18n/locales/en.json @@ -4204,6 +4204,7 @@ "menu": "Connections menu", "search": "Find users", "clear_cache": "Clear cache", + "compact": "Compact layout", "loading": "Loading connections…", "progress": "Loading connections: {value1}/{value2}", "partial": "Could not load {value1} branches. The rest of the map is available.", diff --git a/shine-UI/js/i18n/locales/ru.json b/shine-UI/js/i18n/locales/ru.json index 6a715e12..f3976235 100644 --- a/shine-UI/js/i18n/locales/ru.json +++ b/shine-UI/js/i18n/locales/ru.json @@ -4204,6 +4204,7 @@ "menu": "Меню связей", "search": "Искать пользователей", "clear_cache": "Очистить кэш", + "compact": "Компактнее", "loading": "Загрузка связей…", "progress": "Загрузка связей: {value1}/{value2}", "partial": "Не удалось загрузить {value1} веток. Остальная карта доступна.", diff --git a/shine-UI/js/pages/network-explorer/network-view.js b/shine-UI/js/pages/network-explorer/network-view.js index 09df75da..74be6f29 100644 --- a/shine-UI/js/pages/network-explorer/network-view.js +++ b/shine-UI/js/pages/network-explorer/network-view.js @@ -56,7 +56,7 @@ export function render({ navigate, route, chrome } = {}) { const scope = explorerCacheScope(authService, state.session.login); if (!retained || retained.scope !== scope) retained = { scope, graph: createExplorerGraph(), positions: new Map(), center: '', - depth: EXPLORER_DEFAULT_DEPTH, x2: false, close: false, shining: false, + depth: EXPLORER_DEFAULT_DEPTH, x2: false, close: false, shining: false, compact: false, }; const session = retained; let centerLogin = normalizeLogin(route?.params?.login || session.center || state.session.login); @@ -105,6 +105,8 @@ export function render({ navigate, route, chrome } = {}) { const center = keyOf(centerLogin); if (!session.positions.has(center)) session.positions.set(center, { x: 0, y: 0 }); const pending = nodes.filter((node) => !session.positions.has(node.id)).sort((a, b) => a.distance - b.distance); + const spacing = session.compact ? 62 : 84; + const minNodeGap = session.compact ? 48 : 66; for (const node of pending) { const connected = (adjacency.get(node.id) || []).filter((id) => session.positions.has(id)); const nearest = connected.sort((a, b) => (byId.get(a)?.distance ?? 99) - (byId.get(b)?.distance ?? 99))[0]; @@ -115,9 +117,9 @@ export function render({ navigate, route, chrome } = {}) { const count = Math.max(8, Math.round(6 * ring)); for (let i = 0; i < count; i += 1) { const angle = phase + Math.PI * 2 * i / count; - const x = base.x + Math.cos(angle) * ring * 84; - const y = base.y + Math.sin(angle) * ring * 84; - if (occupied.every((p) => Math.hypot(x - p.x, y - p.y) >= 66)) { point = { x, y }; break; } + const x = base.x + Math.cos(angle) * ring * spacing; + const y = base.y + Math.sin(angle) * ring * spacing; + if (occupied.every((p) => Math.hypot(x - p.x, y - p.y) >= minNodeGap)) { point = { x, y }; break; } } } point ||= { x: base.x + 300, y: base.y + 300 }; @@ -258,6 +260,16 @@ export function render({ navigate, route, chrome } = {}) { session.depth = (session.depth + 1) % (EXPLORER_MAX_DEPTH + 1); syncDepth(); draw(); }); + const compactChip = chip(t('screens.network_explorer.compact'), () => { + if (session.compact) return; + session.compact = true; + for (const [id, point] of session.positions) { + session.positions.set(id, { x: point.x * 0.72, y: point.y * 0.72 }); + } + compactChip.classList.add('is-active'); + compactChip.setAttribute('aria-pressed', 'true'); + draw(); + }, session.compact); function syncDepth() { depthChip.textContent = t('screens.network_explorer.depth', { value1: session.depth }); depthChip.title = t('screens.network_explorer.depth_hint', { value1: session.depth + (session.x2 ? 2 : 1) });