Skip to content

Commit feddd89

Browse files
Center session header controls on the sidebar toggle row and compact the view tabs
The h-12 header centered its content at 24px while the sidebar toggle overlay (pt-[9px] + size-7) sits at 23px, so the tabs, title, Record/Join button, and overflow menu rendered 1px low. Add pb-0.5 so the 46px content box centers at 23px. Shrink the view-switcher pill from 30px to h-7 (matching the header buttons) and its tabs from 26px to h-6.
1 parent 969ad4b commit feddd89

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

apps/desktop/src/session/components/note-input/header-shared.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function iconHeaderViewClassName(
9595
size: "tray" | "standalone" = "tray",
9696
className?: string,
9797
) {
98-
const heightClassName = size === "tray" ? "h-[26px]" : "h-7";
98+
const heightClassName = size === "tray" ? "h-6" : "h-7";
9999

100100
return cn([
101101
"group/header-view rounded-pill flex shrink-0 items-center justify-center transition-colors select-none [corner-shape:round] [&>svg]:shrink-0",

apps/desktop/src/session/components/note-input/header.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ describe("Header", () => {
391391

392392
expect(summaryTab.getAttribute("data-state")).toBeNull();
393393
expect(viewSwitcher.getAttribute("data-tauri-drag-region")).toBe("false");
394-
expect(viewSwitcher.className).toContain("h-[30px]");
394+
expect(viewSwitcher.className).toContain("h-7");
395395
expect(viewSwitcher.className).toContain("p-[2px]");
396396
expect(viewSwitcher.className).toContain("gap-[2px]");
397397
expect(viewSwitcher.className).toContain("rounded-pill");
@@ -403,7 +403,7 @@ describe("Header", () => {
403403
expect(summaryTab.getAttribute("aria-current")).toBeNull();
404404
expect(memoTab.getAttribute("aria-current")).toBe("page");
405405
expect(memoTab.textContent).toBe("Memos");
406-
expect(memoTab.className).toContain("h-[26px]");
406+
expect(memoTab.className).toContain("h-6");
407407
expect(memoTab.className).not.toContain("-my-px");
408408
expect(memoTab.className).toContain("bg-white");
409409
expect(memoTab.className).toContain("text-foreground");
@@ -415,7 +415,7 @@ describe("Header", () => {
415415
expect(memoTab.querySelector("span")?.className).toContain(
416416
"@max-[480px]:sr-only",
417417
);
418-
expect(summaryTab.className).toContain("h-[26px]");
418+
expect(summaryTab.className).toContain("h-6");
419419
expect(summaryTab.className).toContain("px-2");
420420
expect(summaryTab.className).not.toContain("min-w-10");
421421
expect(summaryTab.className).toContain("dark:hover:bg-accent/80");

apps/desktop/src/session/components/note-input/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function SessionViewSwitcher({
5151
data-tauri-drag-region="false"
5252
className={cn([
5353
"pointer-events-auto relative z-10 w-fit max-w-full shrink-0 overflow-visible",
54-
"bg-foreground/10 dark:bg-accent/55 rounded-pill flex h-[30px] items-center gap-[2px] p-[2px] [corner-shape:round]",
54+
"bg-foreground/10 dark:bg-accent/55 rounded-pill flex h-7 items-center gap-[2px] p-[2px] [corner-shape:round]",
5555
])}
5656
>
5757
{editorTabs.map((view, index) => {

apps/desktop/src/session/components/outer-header/index.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ describe("OuterHeader", () => {
364364
expect(container.firstElementChild?.className).not.toContain("pl-[108px]");
365365
});
366366

367-
it("keeps the session header at 48px tall", () => {
367+
it("keeps the session header at 48px tall and centers controls on the sidebar toggle row", () => {
368368
const { container } = render(
369369
<OuterHeader
370370
sessionId="session-1"
@@ -373,6 +373,7 @@ describe("OuterHeader", () => {
373373
);
374374

375375
expect(container.firstElementChild?.className).toContain("h-12");
376+
expect(container.firstElementChild?.className).toContain("pb-0.5");
376377
});
377378

378379
it("marks the spacer and action strip as draggable", () => {

apps/desktop/src/session/components/outer-header/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export function OuterHeader({
7878
data-tauri-drag-region
7979
className={cn([
8080
"relative flex w-full items-center gap-[2px]",
81-
"h-12",
81+
// 46px content box centers the 28px controls at 23px, matching the
82+
// sidebar toggle row (pt-[9px] + size-7).
83+
"h-12 pb-0.5",
8284
standaloneWindow && (showWindowControlsGutter ? "pl-[76px]" : "pl-2"),
8385
!standaloneWindow && leftsidebar.expanded && "pl-2",
8486
showSidebarTimelineHeaderGutter &&

0 commit comments

Comments
 (0)