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
16 changes: 9 additions & 7 deletions e2e/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ async function setupAuth(page: Page) {
},
})
);
await page.route("https://api.github.com/search/issues*", (route) =>
route.fulfill({
status: 200,
json: { total_count: 0, incomplete_results: false, items: [] },
})
);
await page.route("https://api.github.com/notifications*", (route) =>
route.fulfill({ status: 200, json: [] })
);
await page.route("https://api.github.com/graphql", (route) =>
route.fulfill({ status: 200, json: { data: {} } })
route.fulfill({
status: 200,
json: {
data: {
search: { issueCount: 0, pageInfo: { hasNextPage: false, endCursor: null }, nodes: [] },
rateLimit: { remaining: 5000, resetAt: new Date(Date.now() + 3600000).toISOString() },
},
},
})
);

await page.addInitScript(() => {
Expand Down
25 changes: 16 additions & 9 deletions e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ async function setupAuth(page: Page) {
},
})
);
await page.route("https://api.github.com/search/issues*", (route) =>
route.fulfill({
status: 200,
json: { total_count: 0, incomplete_results: false, items: [] },
})
);
await page.route(
"https://api.github.com/repos/*/actions/runs*",
(route) =>
Expand All @@ -35,7 +29,15 @@ async function setupAuth(page: Page) {
route.fulfill({ status: 200, json: [] })
);
await page.route("https://api.github.com/graphql", (route) =>
route.fulfill({ status: 200, json: { data: {} } })
route.fulfill({
status: 200,
json: {
data: {
search: { issueCount: 0, pageInfo: { hasNextPage: false, endCursor: null }, nodes: [] },
rateLimit: { remaining: 5000, resetAt: new Date(Date.now() + 3600000).toISOString() },
},
},
})
);

// Seed localStorage with auth token and config before the page loads
Expand Down Expand Up @@ -104,10 +106,15 @@ test("OAuth callback flow completes and redirects", async ({ page }) => {
);
});
// Also intercept downstream dashboard API calls
await page.route("https://api.github.com/search/issues*", (route) =>
await page.route("https://api.github.com/graphql", (route) =>
route.fulfill({
status: 200,
json: { total_count: 0, incomplete_results: false, items: [] },
json: {
data: {
search: { issueCount: 0, pageInfo: { hasNextPage: false, endCursor: null }, nodes: [] },
rateLimit: { remaining: 5000, resetAt: new Date(Date.now() + 3600000).toISOString() },
},
},
})
);
await page.route("https://api.github.com/notifications*", (route) =>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { clearAuth, user, onAuthCleared, DASHBOARD_STORAGE_KEY } from "../../sto

// ── Shared dashboard store (module-level to survive navigation) ─────────────

const CACHE_VERSION = 1;
const CACHE_VERSION = 2;

interface DashboardStore {
issues: Issue[];
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dashboard/PullRequestsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export default function PullRequestsTab(props: PullRequestsTabProps) {
createdAt={pr.createdAt}
url={pr.htmlUrl}
labels={pr.labels}
commentCount={pr.comments + pr.reviewComments}
commentCount={pr.comments + pr.reviewThreads}
onIgnore={() => handleIgnore(pr)}
density={config.viewDensity}
>
Expand Down
14 changes: 7 additions & 7 deletions src/app/components/layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createSignal, Show } from "solid-js";
import { useNavigate } from "@solidjs/router";
import { user, clearAuth } from "../../stores/auth";
import { getCoreRateLimit, getSearchRateLimit } from "../../services/github";
import { getCoreRateLimit, getGraphqlRateLimit } from "../../services/github";
import { getUnreadCount, markAllAsRead } from "../../lib/errors";
import NotificationDrawer from "../shared/NotificationDrawer";
import ToastContainer from "../shared/ToastContainer";
Expand All @@ -27,7 +27,7 @@ export default function Header() {
const unreadCount = () => getUnreadCount();

const coreRL = () => getCoreRateLimit();
const searchRL = () => getSearchRateLimit();
const graphqlRL = () => getGraphqlRateLimit();

function formatLimit(remaining: number, limit: number, unit: string): string {
const k = limit >= 1000 ? `${limit / 1000}k` : String(limit);
Expand All @@ -43,7 +43,7 @@ export default function Header() {

<div class="flex-1" />

<Show when={coreRL() || searchRL()}>
<Show when={coreRL() || graphqlRL()}>
<div class="flex items-center gap-2 shrink-0">
<span class="text-xs font-medium text-gray-400 dark:text-gray-500">Rate Limits</span>
<div class="flex flex-col items-end text-xs tabular-nums leading-tight gap-0.5">
Expand All @@ -57,13 +57,13 @@ export default function Header() {
</span>
)}
</Show>
<Show when={searchRL()}>
<Show when={graphqlRL()}>
{(rl) => (
<span
class={rl().remaining < 5 ? "text-amber-600 dark:text-amber-400" : "text-gray-500 dark:text-gray-400"}
title={`Search rate limit resets at ${rl().resetAt.toLocaleTimeString()}`}
class={rl().remaining < 500 ? "text-amber-600 dark:text-amber-400" : "text-gray-500 dark:text-gray-400"}
title={`GraphQL rate limit resets at ${rl().resetAt.toLocaleTimeString()}`}
>
{formatLimit(rl().remaining, 30, "min")}
GraphQL {formatLimit(rl().remaining, 5000, "hr")}
</span>
)}
</Show>
Expand Down
Loading
Loading