always put left separator on the first tab

This commit is contained in:
Red Adaya 2024-12-10 11:44:32 +08:00
parent 4a366e3fba
commit 6f8f1a836a
2 changed files with 12 additions and 2 deletions

View File

@ -251,8 +251,19 @@ const Tab = memo(
const separator = currentTabElement.querySelector(".separator") as HTMLElement;
if (!leftAdjacentElement.classList.contains("active")) {
console.log("here!!!!!", currentTabElement, draggingId);
separator.style.opacity = "1"; // Reset opacity for the current tab only if not active
}
// If dragging tab is the first tab set opacity to 1
if (draggingId === tabIds[0]) {
const draggingTabElement = document.querySelector(
`[data-tab-id="${draggingId}"]`
) as HTMLElement;
if (!draggingTabElement) return;
const separator = draggingTabElement.querySelector(".separator") as HTMLElement;
separator.style.opacity = "1";
}
}
if (rightAdjacentId) {
@ -264,7 +275,6 @@ const Tab = memo(
const separator = rightAdjacentElement.querySelector(".separator") as HTMLElement;
if (!rightAdjacentElement.classList.contains("active")) {
console.log("here!!!!!");
separator.style.opacity = "1"; // Reset opacity for the right adjacent tab
}
}

View File

@ -659,7 +659,7 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
key={tabId}
ref={tabRefs.current[index]}
id={tabId}
isFirst={index === 0}
isFirst={tabIds[0]}
isPinned={isPinned}
onClick={() => handleSelectTab(tabId)}
isActive={activeTabId === tabId}