Offset timeline padding to avoid floating sidebar overlap

Detect whether the sidebar icon strip is in floating mode and on which
side, then add matching padding so timeline markers aren't hidden
behind it. Connected mode (sidebar pushes canvas) needs no offset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 00:27:38 +01:00
parent 0219d86301
commit 95cbcd4f6c

View File

@@ -1441,6 +1441,16 @@ function buildTimeline() {
bar.appendChild(track);
bar.appendChild(snapBtn);
// Offset timeline to avoid floating sidebar overlap
const leftToolbar = document.querySelector(".comfyui-body-left .side-tool-bar-container");
const rightToolbar = document.querySelector(".comfyui-body-right .side-tool-bar-container");
if (leftToolbar && !leftToolbar.classList.contains("connected-sidebar")) {
bar.style.paddingLeft = "calc(var(--sidebar-width, 48px) + 16px)";
}
if (rightToolbar && !rightToolbar.classList.contains("connected-sidebar")) {
bar.style.paddingRight = "calc(var(--sidebar-width, 48px) + 16px)";
}
canvasParent.appendChild(bar);
timelineEl = bar;