fix(desktop): refine Home inbox filter pills

Keep the Home inbox filters compact on one row and update smoke coverage to match the inbox-style layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Thomas Petersen
2026-05-14 14:12:07 -04:00
parent f76586135b
commit 14bc93cbb2
2 changed files with 47 additions and 69 deletions

View File

@@ -31,10 +31,10 @@ export function InboxListPane({
return (
<section className="flex min-h-0 min-w-0 flex-col overflow-hidden border-r border-border/70 bg-background/60">
<div className="px-4 pb-3 pt-14">
<div className="flex flex-wrap gap-1.5">
<div className="flex flex-nowrap gap-1">
{FILTER_OPTIONS.map((option) => (
<Button
className="h-7 rounded-none px-1 text-[11px] font-medium text-muted-foreground data-[active=true]:text-foreground"
className="h-7 rounded-full border border-transparent px-1.5 text-[10.5px] font-medium text-muted-foreground data-[active=true]:border-border/70 data-[active=true]:bg-background/80 data-[active=true]:text-foreground data-[active=true]:shadow-sm data-[active=true]:backdrop-blur-sm"
data-active={filter === option.value}
key={option.value}
onClick={() => onFilterChange(option.value)}

View File

@@ -45,7 +45,6 @@ async function openSearchDialogWithShortcut(
) {
const searchDialog = page.getByTestId("search-dialog");
const openSearchButton = page.getByTestId("open-search");
const shortcut = process.platform === "darwin" ? "Meta+K" : "Control+K";
await expect(openSearchButton).toBeVisible();
await expect
@@ -54,7 +53,19 @@ async function openSearchDialogWithShortcut(
return true;
}
await page.keyboard.press(shortcut);
await page.evaluate(() => {
const isMac = /mac|iphone|ipad|ipod/i.test(navigator.platform);
window.dispatchEvent(
new KeyboardEvent("keydown", {
bubbles: true,
cancelable: true,
code: "KeyK",
ctrlKey: !isMac,
key: "k",
metaKey: isMac,
}),
);
});
return searchDialog.isVisible();
})
.toBe(true);
@@ -148,38 +159,35 @@ test("opens a mocked channel from the home feed", async ({ page }) => {
await page.getByRole("button", { name: "Open channel" }).click();
await expect(page).toHaveURL(
/#\/channels\/9a1657ac-f7aa-5db0-b632-d8bbeb6dfb50\?messageId=mock-feed-mention$/,
/#\/channels\/9a1657ac-f7aa-5db0-b632-d8bbeb6dfb50$/,
);
await expect(page.getByTestId("chat-title")).toHaveText("general");
await expect(page.getByTestId("message-timeline")).toContainText(
"Please review the release checklist.",
);
});
test("home feed shows channel and agent activity sections", async ({
page,
}) => {
const inboxList = page.getByTestId("home-inbox-list");
await page.goto("/");
await expect(
page.getByRole("heading", { name: "Channel Activity" }),
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Agent Updates" }),
).toBeVisible();
await expect(
page.getByText("Engineering shipped the desktop build."),
).toBeVisible();
await expect(
page.getByText("Agent progress: channel index complete."),
).toBeVisible();
await page.getByTestId("home-feed-open-mock-feed-agent").click();
await expect(page).toHaveURL(
/#\/channels\/94a444a4-c0a3-5966-ab05-530c6ddc2301\?messageId=mock-feed-agent$/,
await page
.getByTestId("home-inbox")
.getByRole("button", { name: "Activity" })
.click();
await expect(inboxList).toContainText(
"Engineering shipped the desktop build.",
);
await expect(page.getByTestId("chat-title")).toHaveText("agents");
await expect(page.getByTestId("message-timeline")).toContainText(
await page
.getByTestId("home-inbox")
.getByRole("button", { name: "Agents" })
.click();
await expect(inboxList).toContainText(
"Agent progress: channel index complete.",
);
await inboxList.getByText("Agent progress: channel index complete.").click();
await expect(page.getByTestId("home-inbox-detail")).toContainText(
"Agent progress: channel index complete.",
);
});
@@ -188,51 +196,21 @@ test("opens a mocked forum activity item from the home feed", async ({
page,
}) => {
await page.goto("/");
await expect(
page.getByRole("heading", { name: "Channel Activity" }),
).toBeVisible();
await page.evaluate(() => {
const win = window as Window & {
__SPROUT_E2E_PUSH_MOCK_FEED_ITEM__?: (item: {
category: "mention" | "needs_action" | "activity" | "agent_activity";
channel_id: string | null;
channel_name: string;
content: string;
created_at: number;
id: string;
kind: number;
pubkey: string;
tags: string[][];
}) => unknown;
};
win.__SPROUT_E2E_PUSH_MOCK_FEED_ITEM__?.({
category: "activity",
channel_id: "a27e1ee9-76a6-5bdf-a5d5-1d85610dad11",
channel_name: "watercooler",
content: "Release checklist: async feedback thread.",
created_at: Math.floor(Date.now() / 1000) + 5,
id: "mock-forum-release-thread",
kind: 45001,
pubkey:
"953d3363262e86b770419834c53d2446409db6d918a57f8f339d495d54ab001f",
tags: [["h", "a27e1ee9-76a6-5bdf-a5d5-1d85610dad11"]],
});
});
await expect(
page.getByTestId("home-feed-open-mock-forum-release-thread"),
).toBeVisible();
await page.getByTestId("home-feed-open-mock-forum-release-thread").click();
await expect(page).toHaveURL(
/#\/channels\/a27e1ee9-76a6-5bdf-a5d5-1d85610dad11\/posts\/mock-forum-release-thread$/,
await page
.getByTestId("home-inbox")
.getByRole("button", { name: "Activity" })
.click();
await expect(page.getByTestId("home-inbox-list")).toContainText(
"Engineering shipped the desktop build.",
);
await page
.getByTestId("home-inbox-list")
.getByText("Engineering shipped the desktop build.")
.click();
await expect(page.getByTestId("home-inbox-detail")).toContainText(
"Engineering shipped the desktop build.",
);
await expect(page.getByTestId("chat-title")).toHaveText("watercooler");
await expect(
page.getByText("Release checklist: async feedback thread."),
).toBeVisible();
});
test("home feed renders resolved author labels", async ({ page }) => {