Skip to content
Merged
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
14 changes: 10 additions & 4 deletions plugins/github-notifications/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ describe("GitHub Activity panel", () => {
expect(updatedTime.className).not.toContain("rounded");
expect(updatedTime.className).not.toContain("bg-muted");
expect(updatedTime.className).toContain("shrink-0");
expect(inlineUpdatedTime.closest("td")?.cellIndex).toBe(2);
expect(inlineUpdatedTime.closest("td")?.cellIndex).toBe(1);
expect(desktopUpdatedTime.closest("td")?.cellIndex).toBe(4);
expect(desktopUpdatedTime.parentElement?.className).toContain(
"justify-between",
);
expect(screen.getAllByText("get-bb/bb")).toHaveLength(2);
expect(screen.getByText("Scannable activity")).toBeDefined();
expect(screen.getByText("#42").parentElement?.className).toContain("mt-0.5");
Expand All @@ -116,7 +119,7 @@ describe("GitHub Activity panel", () => {
const repoHeader = screen.getByRole("columnheader", { name: "Repo" });
const fromHeader = screen.getByRole("columnheader", { name: /From/u });
expect(
[statusHeader, activityHeader, resourceHeader, repoHeader, fromHeader].map(
[statusHeader, resourceHeader, repoHeader, activityHeader, fromHeader].map(
(header) => (header as HTMLTableCellElement).cellIndex,
),
).toEqual([0, 1, 2, 3, 4]);
Expand All @@ -134,8 +137,11 @@ describe("GitHub Activity panel", () => {
expect(screen.getByRole("table").className).not.toContain("min-w-[620px]");
expect(link.closest("tr")?.className).not.toContain("@max-[36rem]:grid");
const row = link.closest("tr")!;
expect(mentionActivity.closest("td")?.cellIndex).toBe(1);
expect(link.closest("td")?.cellIndex).toBe(2);
expect(link.closest("td")?.cellIndex).toBe(1);
expect(mentionActivity.closest("td")?.cellIndex).toBe(3);
expect(mentionActivity.closest("td")?.nextElementSibling).toBe(
desktopUpdatedTime.closest("td"),
);
expect(row.querySelector(".github-activity-repo-cell")?.className).toContain(
"lg:table-cell",
);
Expand Down
22 changes: 11 additions & 11 deletions plugins/github-notifications/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,16 @@ function GitHubActivityPanel() {
<table className="github-activity-table w-full table-fixed border-collapse text-left">
<colgroup className="github-activity-colgroup">
<col className="w-[3.75rem]" />
<col className="w-16" />
<col />
<col className="hidden w-40 lg:table-column" />
<col className="w-16" />
<col className="hidden w-[14rem] xl:table-column" />
</colgroup>
<thead className="border-b border-border bg-muted/35 text-xs">
<tr className="github-activity-header-row">
<th scope="col" className="github-activity-status-header px-3 py-2.5 text-muted-foreground">
Status
</th>
<th scope="col" className="github-activity-update-header px-2 py-2.5 text-center text-muted-foreground">
Activity
</th>
<th scope="col" aria-label="Resource" className="github-activity-resource-header px-3 py-2.5">
<div className="flex items-center justify-between gap-3">
<SortHeader label="Resource" active={sort === "resource"} direction={direction} onSort={() => setSortKey("resource")} />
Expand All @@ -614,6 +611,9 @@ function GitHubActivityPanel() {
<th scope="col" className="github-activity-repo-header hidden px-3 py-2.5 font-medium text-muted-foreground lg:table-cell">
Repo
</th>
<th scope="col" className="github-activity-update-header px-2 py-2.5 text-center text-muted-foreground">
Activity
</th>
<th scope="col" className="github-activity-from-header hidden px-3 py-2.5 xl:table-cell">
<SortHeader
label="From"
Expand All @@ -636,11 +636,11 @@ function GitHubActivityPanel() {
cell === 0
? "github-activity-status-cell"
: cell === 1
? "github-activity-update-cell"
: cell === 2
? "github-activity-resource-cell"
: cell === 2
? "github-activity-repo-cell hidden lg:table-cell"
: cell === 3
? "github-activity-repo-cell hidden lg:table-cell"
? "github-activity-update-cell"
: "github-activity-from-cell hidden xl:table-cell"
}`}
>
Expand All @@ -666,17 +666,17 @@ function GitHubActivityPanel() {
}
/>
</td>
<td className="github-activity-update-cell px-2 py-2.5 text-center">
<TaxonomyIcon {...activityPresentation(item.activityKind)} />
</td>
<td className="github-activity-resource-cell px-3 py-2.5">
<NotificationLink item={item} />
</td>
<td className="github-activity-repo-cell hidden px-3 py-2.5 text-xs text-muted-foreground lg:table-cell">
<span className="block truncate" title={item.repo}>{item.repo}</span>
</td>
<td className="github-activity-update-cell px-2 py-2.5 text-center">
<TaxonomyIcon {...activityPresentation(item.activityKind)} />
</td>
<td className="github-activity-from-cell hidden px-3 py-2.5 xl:table-cell">
<LatestUpdate item={item} />
<LatestUpdate item={item} className="justify-between" />
</td>
</tr>
))}
Expand Down
Loading