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-overview.tsx b/src/browser/components/pr-overview.tsx index 9405ab4..b6558ae 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,11 @@ export const PROverview = memo(function PROverview() { {canWrite && pr.state === "open" && !pr.merged && ( <> { - const result = labels.map((l) => ({ - name: l.name, - color: l.color, - description: l.description ?? null, - })); + .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/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(() => { diff --git a/src/browser/ui/user-hover-card.tsx b/src/browser/ui/user-hover-card.tsx index 5501ead..1a225ae 100644 --- a/src/browser/ui/user-hover-card.tsx +++ b/src/browser/ui/user-hover-card.tsx @@ -110,10 +110,12 @@ function UserHoverCardContent({
{profile.login} - {profile.pronouns && ( + {(profile as UserProfile & { pronouns?: string }).pronouns && ( <> ยท - {profile.pronouns} + + {(profile as UserProfile & { pronouns?: string }).pronouns} + )}
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) => {