From ec68ba6a7bb5f16d3943366843c9d5f1b3ce94b2 Mon Sep 17 00:00:00 2001 From: Dmitriy Petrov Date: Mon, 10 Aug 2026 00:17:13 +0300 Subject: [PATCH] Refine device traffic chart collapse animation --- src/shared/versions.ts | 4 +- src/web/features/devices/DevicesPanel.tsx | 7 +- src/web/features/devices/TrafficChart.tsx | 2 +- src/web/styles/features/devices.css | 85 +++++++++++++++------- src/web/styles/themes.css | 4 + test/web/device-inventory-contract.test.js | 12 ++- test/web/style-boundaries.test.js | 24 +++--- 7 files changed, 89 insertions(+), 49 deletions(-) diff --git a/src/shared/versions.ts b/src/shared/versions.ts index 1818129..b966e0f 100644 --- a/src/shared/versions.ts +++ b/src/shared/versions.ts @@ -1,6 +1,6 @@ export const HARBOR_VERSIONS = Object.freeze({ - macClient: '0.21.7', - gatewayClient: '0.22.2', + macClient: '0.21.8', + gatewayClient: '0.22.3', gatewayBackend: '0.22.5', }); diff --git a/src/web/features/devices/DevicesPanel.tsx b/src/web/features/devices/DevicesPanel.tsx index e99e04e..16884ff 100644 --- a/src/web/features/devices/DevicesPanel.tsx +++ b/src/web/features/devices/DevicesPanel.tsx @@ -367,7 +367,8 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) {
{devices.map((device) => { const collapsing = Boolean(pinCollapses[device.id]); - const displayPinned = device.pinned || collapsing; + const expanded = device.pinned && !collapsing; + const showDetails = device.pinned || collapsing; const hasName = Boolean(device.alias || device.hostname); const title = device.alias || device.hostname || device.ip || 'Неизвестное устройство'; const editing = editingId === device.id; @@ -409,7 +410,7 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) { if (node) deviceNodes.current.set(device.id, node); else deviceNodes.current.delete(device.id); }} - className={`client-device is-${device.status}${displayPinned ? ' is-pinned' : ''}${collapsing ? ' is-collapsing' : ''}`} + className={`client-device is-${device.status}${expanded ? ' is-pinned' : ''}${collapsing ? ' is-collapsing' : ''}`} key={device.id} > @@ -528,7 +529,7 @@ export function DevicesPanel({ feature }: { feature: DevicesFeature }) { scale={trafficScale} capacity={snapshot?.trafficHistoryCapacity || device.trafficHistory?.length || 1} routeLabel={device.appliedPolicy === 'direct' ? 'Напрямую' : 'Gateway'} - pinned={displayPinned} + pinned={showDetails} collapsing={collapsing} onCollapseEnd={() => finishPinCollapse(device.id)} /> diff --git a/src/web/features/devices/TrafficChart.tsx b/src/web/features/devices/TrafficChart.tsx index ff47361..db160d6 100644 --- a/src/web/features/devices/TrafficChart.tsx +++ b/src/web/features/devices/TrafficChart.tsx @@ -200,7 +200,7 @@ export function TrafficChart({ '--traffic-chart-mid': `${(100 + TRAFFIC_CHART_HEADROOM) / 2}%`, } as CSSProperties} onAnimationEnd={(event: AnimationEvent) => { - if (collapsing && event.animationName === 'client-device-chart-collapse') onCollapseEnd?.(); + if (collapsing && event.animationName === 'client-device-traffic-plot-collapse') onCollapseEnd?.(); }} > {pinned && max > 0n &&