Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,33 @@ describe("secondary panel tab-strip edge fades", () => {
expect(SECONDARY_PANEL_TAB_STRIP_FADE_TONE).toBe("sidebar");
});

it("keeps the desktop tab viewport outside the window drag region", () => {
vi.stubGlobal(
"ResizeObserver",
class {
observe() {}
disconnect() {}
},
);
const tabStrip = (usesDesktopChrome: boolean) =>
createElement(SecondaryPanelTabStrip, {
activeTabId: null,
tabs: [],
onReorderTab: vi.fn(),
usesDesktopChrome,
isPanelOpen: true,
});
const view = render(tabStrip(true));
const viewport = view.container.querySelector(".no-scrollbar");
expect(viewport?.className).toContain("[app-region:no-drag]");
expect(viewport?.className).toContain("[-webkit-app-region:no-drag]");

view.rerender(tabStrip(false));
expect(
view.container.querySelector(".no-scrollbar")?.className,
).not.toContain("app-region");
});

it("observes the intrinsic tab row so async title changes refresh overflow", () => {
const observed: Element[] = [];
let resizeCallback: ResizeObserverCallback | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,12 @@ export function SecondaryPanelTabStrip({
// each wheel notch into its own ~150ms animation — the strip advances,
// sits frozen between notches, then jumps. Letting it track 1:1 matches
// native horizontal trackpad scrolling.
className="no-scrollbar min-w-0 overflow-x-auto overflow-y-hidden"
className={cn(
"no-scrollbar min-w-0 overflow-x-auto overflow-y-hidden",
// The desktop header is a window-drag region. Carve out the whole
// viewport so Electron keeps routing wheel events across tab gaps.
usesDesktopChrome && MACOS_APP_REGION_NO_DRAG_CLASS,
)}
>
<div
ref={contentRef}
Expand Down