fix: contribution graph enhancements#292
Conversation
…r extraction logic
|
@Cyberistic is attempting to deploy a commit to the better-auth Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR improves the mobile UX of the user profile page, focusing on making the contribution graph usable on small screens (half-year toggle, touch/slide interaction, selected-day indicator) and tightening mobile layout for repository browsing.
Changes:
- Enhance
ContributionChartfor mobile: half-year toggle, held/slide interaction with tooltip positioning, and scroll locking during drag. - Adjust user profile repositories UI for mobile (full-width tab switcher, mobile filter/sort row, improved repo row layout).
- Update contributor setup docs to use
bunxfor Prisma, and add a placeholder Prisma migration to match an already-applied migration ID.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/web/src/components/users/user-profile-content.tsx | Mobile layout refinements for profile sidebar/main content and repository list/filter UX. |
| apps/web/src/components/dashboard/contribution-chart.tsx | Mobile contribution graph interaction enhancements (half-year toggle, held tooltip, sliding). |
| apps/web/prisma/migrations/20260228005751_init/migration.sql | Adds an empty migration to satisfy Prisma’s applied-migrations tracking. |
| CONTRIBUTING.md | Switch Prisma commands from npx to bunx to match Bun-first workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, 130); | ||
| }, [isHalfTransitioning, isMobile]); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
toggleHalfYear schedules a timeout via halfTransitionTimeoutRef, but the timeout is never cleared on unmount. If the component unmounts (route change) during the 130ms delay, the callback can still run and call setHalfYear / setIsHalfTransitioning, causing state updates after unmount. Add an effect cleanup to clear any pending timeout (and optionally clear it inside clearHeldCell / before unmount).
| useEffect(() => { | |
| useEffect(() => { | |
| return () => { | |
| if (halfTransitionTimeoutRef.current !== null) { | |
| window.clearTimeout(halfTransitionTimeoutRef.current); | |
| halfTransitionTimeoutRef.current = null; | |
| } | |
| }; | |
| }, []); | |
| useEffect(() => { |
| <div ref={scrollContainerRef}> | ||
| <div | ||
| className="inline-grid pt-0" | ||
| className={cn( | ||
| "inline-grid pt-0 transition-opacity duration-200", | ||
| isHalfTransitioning | ||
| ? "opacity-0" | ||
| : "opacity-100", | ||
| )} |
There was a problem hiding this comment.
The chart container no longer has overflow-x-auto (now just <div ref={scrollContainerRef}>). On smaller desktop widths (or constrained containers), the full-year grid can exceed the available width and will overflow instead of being horizontally scrollable. Consider restoring horizontal overflow scrolling (potentially conditionally) so the layout doesn’t break when the grid is wider than its container.
| onContextMenu={( | ||
| e, | ||
| ) => | ||
| e.preventDefault() | ||
| } |
There was a problem hiding this comment.
onContextMenu is always prevented for contribution cells. This blocks the standard right‑click context menu on desktop (copy, inspect, accessibility tools) even though the mobile long‑press behavior is the main concern. Consider only preventing the context menu on touch devices / when a non-mouse pointer interaction is active.
| onContextMenu={( | |
| e, | |
| ) => | |
| e.preventDefault() | |
| } | |
| onContextMenu={(e) => { | |
| const isTouchLike = | |
| (typeof window !== | |
| "undefined" && | |
| window | |
| .matchMedia && | |
| window | |
| .matchMedia( | |
| "(pointer: coarse)", | |
| ).matches) || | |
| (typeof navigator !== | |
| "undefined" && | |
| (navigator.maxTouchPoints || | |
| 0) > 0); | |
| if (isTouchLike) { | |
| e.preventDefault(); | |
| } | |
| }} |
| This file was added to keep backwards compatibility with older versions without dropping the whole database. No idea how it appeared in the first place. | ||
| Deleting the folder gives the following prisma error: | ||
| - The following migration(s) are applied to the database but missing from the local migrations directory: 20260228005751_init | ||
| - You may use prisma migrate reset to drop the development database. | ||
| - All data will be lost. | ||
| If you can figure out how to delete this folder, please do. |
There was a problem hiding this comment.
This migration file is intentionally empty, but the comment reads like a temporary note (“No idea how it appeared… If you can figure out how to delete this folder, please do.”). Since migrations are long-lived artifacts, replace this with a clear, actionable explanation of why the migration must exist (e.g., referenced in _prisma_migrations) and what the recommended remediation is, without open-ended instructions.
| This file was added to keep backwards compatibility with older versions without dropping the whole database. No idea how it appeared in the first place. | |
| Deleting the folder gives the following prisma error: | |
| - The following migration(s) are applied to the database but missing from the local migrations directory: 20260228005751_init | |
| - You may use prisma migrate reset to drop the development database. | |
| - All data will be lost. | |
| If you can figure out how to delete this folder, please do. | |
| This migration file is intentionally empty and is retained to preserve Prisma's migration history. | |
| The migration "20260228005751_init" has been recorded as applied in the database (for example, | |
| in the `_prisma_migrations` table or equivalent metadata). Removing this directory or file | |
| while it is still referenced by the database causes Prisma to report an error such as: | |
| - The following migration(s) are applied to the database but missing from the local migrations directory: 20260228005751_init | |
| Do NOT delete this file or its containing folder in environments where the corresponding | |
| migration is recorded as applied. If this migration is no longer needed, the recommended | |
| remediation is to perform a controlled reset of the database (for example, using | |
| `prisma migrate reset`) in a non-production environment, understanding that all data will | |
| be lost. In production environments, keep this file to maintain a consistent migration history. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Hey could you fix merge conflicts? Thanks |
|
@ping-maxwell done |
All changes for mobile:
I also experimented with adding haptics but couldn't figure out how to reliably fire it on slide so I let go of this for now.