From 1a509d428c4912f9820f4b28d01eeed3ee09c8e6 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Wed, 3 Dec 2025 10:24:04 +0100 Subject: [PATCH 1/4] fix: swap j/k keybindings to match Vim conventions Change-Id: I1fdbc38047c1036a8783c99f64119890b1aed61e Signed-off-by: Thomas Kosiewski --- src/browser/contexts/pr-review.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/contexts/pr-review.tsx b/src/browser/contexts/pr-review.tsx index 15f5e3a..0b46861 100644 --- a/src/browser/contexts/pr-review.tsx +++ b/src/browser/contexts/pr-review.tsx @@ -2047,14 +2047,14 @@ export function useKeyboardNavigation() { // Shortcuts switch (e.key.toLowerCase()) { - case "k": + case "j": e.preventDefault(); // Use startTransition to allow React to interrupt rendering during rapid navigation startTransition(() => { store.navigateToNextUnviewedFile(); }); break; - case "j": + case "k": e.preventDefault(); // Use startTransition to allow React to interrupt rendering during rapid navigation startTransition(() => { From 08cb274c97791e42362efe2e8ef643b98a7f6851 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Wed, 3 Dec 2025 10:38:42 +0100 Subject: [PATCH 2/4] style: format code with bun run fmt Change-Id: I3b4839ad380eeb6362da75009ddfe018af49d201 Signed-off-by: Thomas Kosiewski --- scripts/build-browser.ts | 5 ++++- scripts/build-vercel.ts | 4 +++- src/browser/components/pr-review.tsx | 7 ++++++- src/index.ts | 10 +++++----- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/build-browser.ts b/scripts/build-browser.ts index 3c0d1db..bce13fa 100644 --- a/scripts/build-browser.ts +++ b/scripts/build-browser.ts @@ -28,7 +28,10 @@ async function build() { const indexHtml = await Bun.file(indexPath).text(); await Bun.write(indexPath, indexHtml.replaceAll("./", "/")); - await cp(resolve(process.cwd(), "src", "browser", "logo.svg"), resolve(process.cwd(), "dist", "browser", "logo.svg")); + await cp( + resolve(process.cwd(), "src", "browser", "logo.svg"), + resolve(process.cwd(), "dist", "browser", "logo.svg") + ); // Build worker separately with document shim for Prism/refractor const workerResult = await Bun.build({ diff --git a/scripts/build-vercel.ts b/scripts/build-vercel.ts index 07d7c34..272fb28 100644 --- a/scripts/build-vercel.ts +++ b/scripts/build-vercel.ts @@ -17,7 +17,9 @@ await import("./build-browser"); // Copy browser build contents to public (served by Vercel CDN) const browserFiles = await readdir(browserDistDir); for (const file of browserFiles) { - await cp(resolve(browserDistDir, file), resolve(publicDir, file), { recursive: true }); + await cp(resolve(browserDistDir, file), resolve(publicDir, file), { + recursive: true, + }); } console.log("Copied browser files to public/"); diff --git a/src/browser/components/pr-review.tsx b/src/browser/components/pr-review.tsx index beb3b11..72b168c 100644 --- a/src/browser/components/pr-review.tsx +++ b/src/browser/components/pr-review.tsx @@ -2839,7 +2839,12 @@ const SubmitReviewDropdown = memo(function SubmitReviewDropdown() { e.stopPropagation(); handleSubmit(); }} - disabled={submitting || (reviewType === "COMMENT" && pendingCount === 0 && !reviewBody.trim())} + disabled={ + submitting || + (reviewType === "COMMENT" && + pendingCount === 0 && + !reviewBody.trim()) + } className={cn( "flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded-md transition-colors disabled:opacity-50", reviewType === "APPROVE" && diff --git a/src/index.ts b/src/index.ts index 041e675..80fee85 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,6 @@ import { serveStatic } from "@hono/node-server/serve-static"; const app = new Hono(); - // Debug route to see filesystem structure on Vercel app.get("/_debug", (c) => { const listDir = (path: string, depth = 0): string[] => { @@ -18,10 +17,12 @@ app.get("/_debug", (c) => { return results; } const entries = readdirSync(path, { withFileTypes: true }); - for (const entry of entries.slice(0, 50)) { // Limit to 50 entries + for (const entry of entries.slice(0, 50)) { + // Limit to 50 entries if (entry.isDirectory()) { results.push(`${indent}${entry.name}/`); - if (depth < 2) { // Limit depth + if (depth < 2) { + // Limit depth results.push(...listDir(resolve(path, entry.name), depth + 1)); } } else { @@ -36,7 +37,7 @@ app.get("/_debug", (c) => { const cwd = process.cwd(); const metaDirname = import.meta.dirname; - + const info = { cwd, metaDirname, @@ -54,7 +55,6 @@ app.route("/", api); app.use("/*", serveStatic({ root: resolve(process.cwd(), "public") })); - // SPA fallback - serve index.html for client-side routing // Static files are served by Vercel CDN from public/ app.get("*", (c) => { From 40972eb1949fcb52bf504adb8a847a000587877d Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Wed, 3 Dec 2025 10:45:09 +0100 Subject: [PATCH 3/4] fix: resolve TypeScript errors for CI - pr-overview.tsx: Convert undefined to null for CommentBox body prop, and normalize requested_reviewers null to undefined for MergeSection - github.tsx: Replace octokit.paginate with octokit.request (paginate not available in @octokit/core), remove non-existent clearPending call - user-hover-card.tsx: Add type assertion for pronouns field (not in @octokit/openapi-types schema yet) Change-Id: Ib140d36609368c8920416c9c0627726c0efb4020 Signed-off-by: Thomas Kosiewski --- src/browser/components/pr-overview.tsx | 7 +++++-- src/browser/contexts/github.tsx | 7 +++---- src/browser/ui/user-hover-card.tsx | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/browser/components/pr-overview.tsx b/src/browser/components/pr-overview.tsx index 9405ab4..f359cec 100644 --- a/src/browser/components/pr-overview.tsx +++ b/src/browser/components/pr-overview.tsx @@ -711,7 +711,7 @@ export const PROverview = memo(function PROverview() { key={`comment-${comment.id}`} user={comment.user} createdAt={comment.created_at} - body={comment.body} + body={comment.body ?? null} reactions={reactions[`comment-${comment.id}`]} onAddReaction={(content) => handleAddCommentReaction(comment.id, content) @@ -747,7 +747,10 @@ export const PROverview = memo(function PROverview() { {canWrite && pr.state === "open" && !pr.merged && ( <> { - const result = labels.map((l) => ({ + .then(({ data: labels }) => { + const result = labels.map((l: { name: string; color: string; description: string | null }) => ({ name: l.name, color: l.color, description: l.description ?? null, })); cache.set(cacheKey, result); - cache.clearPending(cacheKey); return result; }); diff --git a/src/browser/ui/user-hover-card.tsx b/src/browser/ui/user-hover-card.tsx index 5501ead..c1d4fc7 100644 --- a/src/browser/ui/user-hover-card.tsx +++ b/src/browser/ui/user-hover-card.tsx @@ -110,10 +110,10 @@ function UserHoverCardContent({
{profile.login} - {profile.pronouns && ( + {(profile as UserProfile & { pronouns?: string }).pronouns && ( <> · - {profile.pronouns} + {(profile as UserProfile & { pronouns?: string }).pronouns} )}
From 3c092101c86da83fe3c836053420665ce8bef611 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Wed, 3 Dec 2025 10:46:42 +0100 Subject: [PATCH 4/4] style: format code with prettier Change-Id: Ifebfd59cce5c6a07854adffa9e24f9ace8ca5214 Signed-off-by: Thomas Kosiewski --- src/browser/components/pr-overview.tsx | 3 ++- src/browser/contexts/github.tsx | 12 +++++++----- src/browser/ui/user-hover-card.tsx | 4 +++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/browser/components/pr-overview.tsx b/src/browser/components/pr-overview.tsx index f359cec..b6558ae 100644 --- a/src/browser/components/pr-overview.tsx +++ b/src/browser/components/pr-overview.tsx @@ -749,7 +749,8 @@ export const PROverview = memo(function PROverview() { { - const result = labels.map((l: { name: string; color: string; description: string | null }) => ({ - name: l.name, - color: l.color, - description: l.description ?? null, - })); + const result = labels.map( + (l: { name: string; color: string; description: string | null }) => ({ + name: l.name, + color: l.color, + description: l.description ?? null, + }) + ); cache.set(cacheKey, result); return result; }); diff --git a/src/browser/ui/user-hover-card.tsx b/src/browser/ui/user-hover-card.tsx index c1d4fc7..1a225ae 100644 --- a/src/browser/ui/user-hover-card.tsx +++ b/src/browser/ui/user-hover-card.tsx @@ -113,7 +113,9 @@ function UserHoverCardContent({ {(profile as UserProfile & { pronouns?: string }).pronouns && ( <> · - {(profile as UserProfile & { pronouns?: string }).pronouns} + + {(profile as UserProfile & { pronouns?: string }).pronouns} + )}