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 @@ -59,7 +59,7 @@ export function AppSidebarPinnedHeader({
suggestionChannels,
}: AppSidebarPinnedHeaderProps) {
return (
<div className="shrink-0 px-2" data-testid="sidebar-pinned-header">
<div className="shrink-0 px-2 pt-3" data-testid="sidebar-pinned-header">
<TopbarSearch
channelLabels={channelLabels}
channels={searchChannels}
Expand Down
6 changes: 0 additions & 6 deletions desktop/src/shared/styles/globals/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@
--buzz-active-foreground: 0 0% 100%;
}

:root[data-buzz-sidebar]
[data-testid="app-sidebar"]
[data-testid="sidebar-pinned-header"] {
padding-top: 0.75rem;
}

:root[data-buzz-sidebar] .group\/sidebar-wrapper,
:root[data-buzz-sidebar] [data-testid="app-sidebar"],
:root[data-buzz-sidebar] [data-buzz-glass-inset],
Expand Down
30 changes: 30 additions & 0 deletions desktop/tests/e2e/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,36 @@ test("fades the pinned sidebar chrome edges", async ({ page }) => {
expect(fadeStyles.channelAfterBackground).toBe("none");
});

test("aligns the sidebar search with the channel title outside the Buzz theme", async ({
page,
}) => {
await page.addInitScript(() => {
window.localStorage.setItem("buzz-theme", "github-light");
});
await page.goto("/");
await page.getByTestId("channel-general").click();

const root = page.locator("html");
const search = page.getByTestId("open-search");
const channelTitle = page.getByTestId("chat-title");
await expect(root).not.toHaveAttribute("data-buzz-sidebar", "");
await expect(search).toBeVisible();
await expect(channelTitle).toHaveText("general");

const [searchBox, channelTitleBox] = await Promise.all([
search.boundingBox(),
channelTitle.boundingBox(),
]);
expect(searchBox).not.toBeNull();
expect(channelTitleBox).not.toBeNull();

if (!searchBox || !channelTitleBox) return;

const searchCenter = searchBox.y + searchBox.height / 2;
const channelTitleCenter = channelTitleBox.y + channelTitleBox.height / 2;
expect(Math.abs(searchCenter - channelTitleCenter)).toBeLessThanOrEqual(2);
});

test("resizes, persists, and snaps to the default sidebar width", async ({
page,
}) => {
Expand Down
Loading