Polish diagnostics animations and device alias sizing
Build and Deploy Gateway / build-and-push (push) Successful in 15s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-08-07 22:19:06 +03:00
parent e9433e754f
commit 2151ff51f0
6 changed files with 106 additions and 29 deletions
+3 -5
View File
@@ -211,7 +211,6 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
const movementAnimations = useRef(new Map());
const previousTraffic = useRef(new Map());
const aliasBaseline = useRef({ id: '', value: '' });
const aliasWidth = useRef('1px');
const copyTimer = useRef(null);
const trafficDeltaTimer = useRef(null);
const trafficOrder = useRef({ direction: sortDirection, ids: [] });
@@ -411,10 +410,9 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
copyTimer.current = setTimeout(() => setCopyFeedback(null), COPY_FEEDBACK_MS);
}
function startEditing(device, width = 1) {
function startEditing(device) {
const value = device.alias || device.hostname || '';
aliasBaseline.current = { id: device.id, value };
aliasWidth.current = `${width}px`;
setEditingId(device.id);
setAlias(value);
}
@@ -584,7 +582,7 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
<input
className="client-device-alias-input"
value={alias}
style={{ '--alias-width': aliasWidth.current }}
style={{ '--alias-width': `${Math.max(1, alias.length)}ch` }}
maxLength="64"
autoFocus
aria-label="Название устройства"
@@ -600,7 +598,7 @@ export function DevicesPanel({ open, panelRef, closeRef, onClose }) {
className="client-device-alias-trigger"
type="button"
aria-label={`Изменить название ${title}`}
onClick={(event) => startEditing(device, event.currentTarget.getBoundingClientRect().width)}
onClick={() => startEditing(device)}
>{title}</button>}
{(hasName || (editing && Boolean(alias))) && device.ip && <span className="client-device-name-separator" aria-hidden="true">·</span>}
{device.ip ? <button