Skip to content
Closed
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
5 changes: 4 additions & 1 deletion scripts/build-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
4 changes: 3 additions & 1 deletion scripts/build-vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/");

Expand Down
8 changes: 6 additions & 2 deletions src/browser/components/pr-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -747,7 +747,11 @@ export const PROverview = memo(function PROverview() {
{canWrite && pr.state === "open" && !pr.merged && (
<>
<MergeSection
pr={pr}
pr={{
...pr,
requested_reviewers:
pr.requested_reviewers ?? undefined,
}}
checkStatus={checkStatus}
checks={checks}
canMerge={canMergePR}
Expand Down
7 changes: 6 additions & 1 deletion src/browser/components/pr-review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand Down
17 changes: 9 additions & 8 deletions src/browser/contexts/github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1348,19 +1348,20 @@ function createGitHubStore() {
if (pending) return pending;

const promise = octokit
.paginate("GET /repos/{owner}/{repo}/labels", {
.request("GET /repos/{owner}/{repo}/labels", {
owner,
repo,
per_page: 100,
})
.then((labels) => {
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;
});

Expand Down
4 changes: 2 additions & 2 deletions src/browser/contexts/pr-review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
6 changes: 4 additions & 2 deletions src/browser/ui/user-hover-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ function UserHoverCardContent({
</a>
<div className="flex items-center gap-1.5 text-sm text-muted-foreground">
<span>{profile.login}</span>
{profile.pronouns && (
{(profile as UserProfile & { pronouns?: string }).pronouns && (
<>
<span>·</span>
<span>{profile.pronouns}</span>
<span>
{(profile as UserProfile & { pronouns?: string }).pronouns}
</span>
</>
)}
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] => {
Expand All @@ -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 {
Expand All @@ -36,7 +37,7 @@ app.get("/_debug", (c) => {

const cwd = process.cwd();
const metaDirname = import.meta.dirname;

const info = {
cwd,
metaDirname,
Expand All @@ -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) => {
Expand Down