Skip to content

Migrate UserPosts components to TypeScript and Apollo#282

Open
flyblackbox wants to merge 1 commit into
mainfrom
codex/migrate-userposts-components-to-typescript
Open

Migrate UserPosts components to TypeScript and Apollo#282
flyblackbox wants to merge 1 commit into
mainfrom
codex/migrate-userposts-components-to-typescript

Conversation

@flyblackbox
Copy link
Copy Markdown
Contributor

@flyblackbox flyblackbox commented Dec 7, 2025

Summary

  • rewrite UserPosts into a typed, shadcn-style component backed by Apollo per-user post queries
  • add supporting ui primitives, shared utility, and test page for user post listings
  • update ProfileView to consume the migrated component

Testing

  • not run (not requested)

Codex Task


Note

Migrates UserPosts to a typed Apollo-backed component with pagination and states, adds shadcn-style UI primitives and GraphQL query, introduces a test page, and updates ProfileView to use it.

  • UserPosts:
    • Rewrites client/src/components/UserPosts/UserPosts.jsx to UserPosts.tsx using Apollo GET_USER_POSTS with typed responses and client-side pagination.
    • Adds loading skeletons, empty/error states with retry, and basic post cards; supports props userId, pageSize, className.
    • Updates entry to index.ts and removes old JS entry.
  • GraphQL:
    • Adds client/src/graphql/queries/userPosts.ts defining the GET_USER_POSTS query and related types.
  • UI primitives & utils:
    • Adds shadcn-style components: ui/alert, ui/button, ui/card, ui/skeleton and shared cn util.
  • Test page:
    • Introduces client/src/app/test/user-posts/page.tsx for previewing posts via userId and optional pageSize query params.
  • Integration:
    • Updates client/src/views/Profile/ProfileView.jsx to import and use new UserPosts.

Written by Cursor Bugbot for commit 2cbd6c7. This will update automatically on new commits. Configure here.

@railway-app
Copy link
Copy Markdown

railway-app Bot commented Dec 7, 2025

🚅 Deployed to the quotevote-monorepo-pr-282 environment in profound-optimism

Service Status Web Updated (UTC)
quotevote-api ✅ Success (View Logs) Web Dec 7, 2025 at 7:05 am

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 7, 2025

Deploy Preview for quotevote ready!

Name Link
🔨 Latest commit 2cbd6c7
🔍 Latest deploy log https://app.netlify.com/projects/quotevote/deploys/69352546473fff00084dfaa3
😎 Deploy Preview https://deploy-preview-282--quotevote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

const pageSize = useMemo(() => {
const parsed = Number(searchParams?.pageSize)
return Number.isFinite(parsed) && parsed > 0 ? parsed : 10
}, [searchParams?.pageSize])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Client component cannot receive searchParams as props

The page is marked with "use client" but tries to receive searchParams as a prop. In Next.js App Router, client components do not receive searchParams as props - that pattern only works for server components. The searchParams prop will always be undefined, causing userId to always be empty and the page to always show the "provide a userId" message. Client components need to use the useSearchParams() hook from next/navigation to access query string parameters.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant