Conversation
…r extraction logic
…nd sorting options in user profile
- Added gists tab to user profile with count badge - Implemented search and filters (All, Public, Secret, Starred) - Added sorting by Updated/Created - Created gist detail page with file viewer - Added API functions for fetching gists and starred gists - Added caching support for gist data
|
@Cyberistic is attempting to deploy a commit to the better-auth Team on Vercel. A member of the Team first needs to authorize it. |
- Added gist route at /[owner]/gist/[gistId] to match link URLs - Fixed import path in /gists/[gistId] page - Made stars field optional in UserGist interface - Gists now redirect to owner-specific URLs
- Add GistStarButton component for starring/unstarring gists - Create server actions for gist star/unstar operations - Update fetchGistFromGitHub to check viewer star status - Add viewerHasStarred field to GistDetail type - Refactor gist page into layout with tab navigation: - Create GistNav component matching repo tab style - Create GistHeader component for shared header - Create separate pages for Files, Revisions, and Comments tabs - Remove sidebar revisions panel in favor of tab - Add modular components: gist-files, gist-revisions, gist-comments - Delete monolithic gist-detail-content.tsx
There was a problem hiding this comment.
Pull request overview
This PR adds a gists feature to the user profile, enabling users to view gists associated with any user profile (including public, secret, and starred gist filtering), as well as a dedicated gist detail view with file rendering, revision history, and comments.
Changes:
- Adds a "Gists" tab to user profiles with filtering (all/public/secret/starred), sorting, and search
- Adds a gist detail page at
/:owner/gist/:gistIdwith file rendering, revision history, and comments sub-pages - Improves the contribution chart and repo list for mobile responsiveness
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
apps/web/src/proxy.ts |
Routes /:owner/gist/:gistId to the internal /repos/:owner/gist/:gistId app path |
apps/web/src/lib/github.ts |
Adds getUserGists, getUserStarredGists, getGist, getGistComments API functions with caching and sync job support |
apps/web/src/lib/github-types.ts |
Defines new shared UserGist, GistDetail, and GistComment interfaces |
apps/web/src/lib/github-utils.ts |
Extends URL parsing and internal URL routing to handle gist.github.com URLs |
apps/web/src/components/users/user-profile-gists.tsx |
New component rendering a list of gists with metadata |
apps/web/src/components/users/user-profile-content.tsx |
Adds gists tab to user profile, plus mobile layout improvements for repos and contribution chart |
apps/web/src/components/gist/ |
New gist-specific components: header, file viewer, revisions, comments, nav, star button |
apps/web/src/app/(app)/repos/[owner]/gist/ |
New gist pages (layout, files, revisions, comments) and server actions for starring |
apps/web/src/app/(app)/[owner]/page.tsx |
Fetches gists and starred gists alongside existing profile data |
apps/web/src/components/dashboard/contribution-chart.tsx |
Adds mobile half-year toggle, touch/hold interactions, and tooltip Y-axis positioning |
apps/web/next.config.ts |
Adds gists to the known routes list to prevent URL rewriting |
apps/web/prisma/migrations/20260228005751_init/migration.sql |
Placeholder migration file for DB backwards compatibility |
CONTRIBUTING.md |
Updates npx to bunx for Prisma commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export function GistComments({ gist, comments }: GistCommentsProps) { | ||
| return ( | ||
| <div className="border border-border rounded-md overflow-hidden"> | ||
| <div className="px-4 py-3 border-b border-border bg-muted/30"> | ||
| <h3 className="text-sm font-medium">Comments</h3> | ||
| </div> | ||
| <div className="p-4"> | ||
| <CommentThread comments={comments} /> |
There was a problem hiding this comment.
The gist prop in GistComments is declared in the GistCommentsProps interface and destructured, but it is never actually used inside the component body. This unused prop adds unnecessary complexity. If it's intended for future use (e.g., to show context or allow adding comments), it should be noted with a comment; otherwise it should be removed.
There was a problem hiding this comment.
Intended for the future
apps/web/src/proxy.ts
Outdated
| // /:owner/gist/:gistId → /repos/:owner/gist/:gistId | ||
| if (repo === "gist" && rest[0]) { | ||
| const url = request.nextUrl.clone(); | ||
| url.pathname = `/repos/${owner}/gist/${rest.join("/")}`; | ||
| return NextResponse.rewrite(url); |
There was a problem hiding this comment.
The comment says // /:owner/gist/:gistId → /repos/:owner/gist/:gistId but this route also handles sub-paths (like /:owner/gist/:gistId/revisions and /:owner/gist/:gistId/comments). The comment should mention that sub-paths are included, e.g. // /:owner/gist/:gistId(/...) → /repos/:owner/gist/:gistId(/...).
| export interface UserGist { | ||
| id: string; | ||
| description: string | null; | ||
| html_url: string; | ||
| public: boolean; | ||
| created_at: string; | ||
| updated_at: string; | ||
| stars?: number; | ||
| files: Record< | ||
| string, | ||
| { | ||
| filename: string; | ||
| type: string; | ||
| language: string | null; | ||
| size: number; | ||
| } | ||
| >; | ||
| comments: number; | ||
| } |
There was a problem hiding this comment.
The UserGist interface is duplicated: one definition exists in apps/web/src/lib/github-types.ts (the canonical, shared type) and another local one is declared in apps/web/src/components/users/user-profile-gists.tsx. These two definitions differ subtly — stars is number (required) in github-types.ts but number | undefined (optional) in the component file.
The component's user-profile-content.tsx then imports the type via an inline import() expression (import("@/components/users/user-profile-gists").UserGist) rather than from github-types.ts. The local duplicate should be removed in favor of the canonical UserGist from @/lib/github-types.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…st type - Add comment explaining gist prop is reserved for future use in GistComments - Update proxy.ts route comment to indicate sub-paths are included - Remove duplicate UserGist interface from user-profile-gists.tsx - Import UserGist from @/lib/github-types in user-profile-content.tsx
Changes
In profile:

gist view:

TODO