mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): let the glass background show through the community rail
The glass treatment (#5478) clears the background on every navigation surface — app sidebar, settings sidebar, pinned header, footer — so the native vibrancy shows through, but the community rail's opaque `bg-sidebar` paint was left out of the `:root[data-glass-background]` transparency list. With multiple communities the rail rendered as a solid column while the sidebar next to it frosted, splitting the nav into two visibly different panes. The Buzz-theme gradient rule already includes the rail selector; the glass rule simply forgot it. Add the rail to the glass transparency list and a Playwright regression spec that fails on the unpatched build: with glass enabled and two communities seeded, the rail's computed background must be transparent. Co-authored-by: Thomas Petersen <thomasp@squareup.com> Signed-off-by: Thomas Petersen <thomasp@squareup.com>
This commit is contained in:
co-authored by
Thomas Petersen
parent
78cbffeb64
commit
75ea2472ac
@@ -19,6 +19,7 @@ export default defineConfig({
|
||||
{
|
||||
name: "smoke",
|
||||
testMatch: [
|
||||
"**/glass-rail.spec.ts",
|
||||
"**/smoke.spec.ts",
|
||||
"**/sidebar-offcanvas-rail.spec.ts",
|
||||
"**/search-scope-screenshots.spec.ts",
|
||||
|
||||
@@ -832,6 +832,7 @@
|
||||
:root[data-glass-background] .group\/sidebar-wrapper,
|
||||
:root[data-glass-background] [data-testid="app-sidebar"],
|
||||
:root[data-glass-background] [data-testid="settings-sidebar"],
|
||||
:root[data-glass-background] [data-testid="community-rail"].bg-sidebar,
|
||||
:root[data-glass-background] [data-buzz-glass-inset],
|
||||
:root[data-glass-background] [data-buzz-glass-footer-wrap],
|
||||
:root[data-glass-background]
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
|
||||
import { installMockBridge } from "../helpers/bridge";
|
||||
|
||||
/**
|
||||
* Glass background must clear the community rail's opaque `bg-sidebar` paint
|
||||
* so the native vibrancy shows through the whole navigation column, not just
|
||||
* the channel sidebar. Regression test for the rail being left out of the
|
||||
* `:root[data-glass-background]` transparency list (theme.css).
|
||||
*/
|
||||
async function seedGlassOnMac(page: Page) {
|
||||
await page.addInitScript(() => {
|
||||
window.localStorage.setItem("buzz-theme", "github-light");
|
||||
window.localStorage.setItem("buzz-glass-background", "true");
|
||||
(window as typeof window & { isTauri?: boolean }).isTauri = true;
|
||||
Object.defineProperty(navigator, "platform", {
|
||||
configurable: true,
|
||||
get: () => "MacIntel",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** Registered AFTER the bridge so it can append to the seeded community list. */
|
||||
async function appendSecondCommunity(page: Page) {
|
||||
await page.addInitScript(() => {
|
||||
const raw = window.localStorage.getItem("buzz-communities");
|
||||
const list = raw ? (JSON.parse(raw) as Array<unknown>) : [];
|
||||
list.push({
|
||||
id: "ws-b",
|
||||
name: "Bravo",
|
||||
relayUrl: "ws://localhost:3001",
|
||||
addedAt: "2026-01-02T00:00:00.000Z",
|
||||
});
|
||||
window.localStorage.setItem("buzz-communities", JSON.stringify(list));
|
||||
});
|
||||
}
|
||||
|
||||
test("glass background clears the community rail surface", async ({ page }) => {
|
||||
await seedGlassOnMac(page);
|
||||
await installMockBridge(page);
|
||||
await appendSecondCommunity(page);
|
||||
await page.goto("/", { waitUntil: "domcontentloaded" });
|
||||
|
||||
await expect(page.locator("html")).toHaveAttribute(
|
||||
"data-glass-background",
|
||||
"",
|
||||
);
|
||||
|
||||
const rail = page.getByTestId("community-rail");
|
||||
await expect(rail).toBeVisible();
|
||||
await expect(rail).toHaveCSS("background-color", "rgba(0, 0, 0, 0)");
|
||||
});
|
||||
Reference in New Issue
Block a user