Skip to content

fix(frontend): featured posts navigate to post detail (RC1-004) #355 - #433

Merged
motirebuma merged 3 commits into
mainfrom
issue#355
Jul 22, 2026
Merged

fix(frontend): featured posts navigate to post detail (RC1-004) #355#433
motirebuma merged 3 commits into
mainfrom
issue#355

Conversation

@niamao

@niamao niamao commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make each featured post card a link to its post detail route via toAppPostUrl.
  • Add unit and E2E regression coverage for featured-post navigation (desktop + mobile).
  • Stop tracking .env.local (add .env.example + gitignore) so API overrides stay machine-local.
  • Fix GetActionReactions variable type (String!) to match the hosted API and avoid 400s.
  • Request activity _id and use stable keys in activity lists (no index-based keys).
  • Ignore local .cursor/ so IDE/agent rules stay machine-specific.

Commits

  1. fix(frontend): navigate featured posts to detail pages (RC1-004)
    • Featured post card → post detail navigation
    • Unit + E2E coverage
    • Untrack .env.local; add .env.example and frontend gitignore/README updates
  2. fix: align actionReactions types and stabilize activity list keys
    • GetActionReactions($actionId: String!) (frontend + backend schema)
    • GET_USER_ACTIVITY requests entity _id
    • Stable React keys in ActivityList / PaginatedActivityList
  3. chore: ignore local .cursor directory
    • Root .gitignore entry for .cursor/

Test plan

  • Open homepage logged out; confirm Featured Posts cards are links.
  • Click each featured card and land on /dashboard/post/... for that post.
  • Confirm browser back returns to the homepage with cards still visible.
  • Open a post with comments/votes; confirm no GetActionReactions 400 in the console.
  • Open a profile activity feed; confirm no React unique-key warning.
  • pnpm test -- src/__tests__/app/page.test.tsx (featured posts navigation cases)
  • pnpm test:e2e featured-posts.spec.ts
  • Confirm .env.local is ignored and new clones use cp .env.example .env.local
  • Confirm .cursor/ is ignored and not present in the PR diff

Wire featured post cards to post detail routes and add unit/E2E coverage.
Stop tracking .env.local so machine-specific API overrides stay local.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quotevote Ready Ready Preview, Comment Jul 22, 2026 6:33am

Use String! for GetActionReactions to match the hosted API, request
activity _id in the feed query, and key activity rows by stable ids.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Cursor rules and agent config machine-local and out of the repo.

Co-authored-by: Cursor <cursoragent@cursor.com>

@motirebuma motirebuma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hi @niamao nice work all-around, clean PR. Looks good to me overall.

My thoughts on your changes:

  1. Featured post card nav (RC1-004): wrapping the card in a when a post.url is present, and a otherwise, is the right approach. Using toAppPostUrl is good for consistency, and I also like that you've added the necessary aria-label and focus-visible styling. Using the shared cardContent fragment to avoid duplication between the link and div cases is a good touch as well.

  2. actionReactions type: changing actionId: ID! to String! in both the backend and the frontend query is the correct fix here. ID is a scalar type that can be serialized differently on different clients, but the hosted API (and presumably legacy APIs) expect a string. The change makes sense, and the note in the commit message explaining why it's String! is a good addition.

  3. Stable activity list keys: using item._id along with the postId fallback, activity type, vote id, etc. is the right approach. Adding _id to the GET_USER_ACTIVITY query (and the corresponding activity type and vote id fields) ensures that we have the unique key available in all cases. I think this is sufficient, but in the rare case that those fields are somehow missing, it'll fall back to the less reliable combination of postId + activityType + voteId, which should still be better than using the array index. This pattern has been applied to both ActivityList.tsx and PaginatedActivityList.tsx.

  4. .env.local -> .env.example: unstaging the .env.local file and instead adding a more informative .env.example is the right thing to do. Looks like the .gitignore patterns are also correct (ignoring .env.local, but not .env.example and .env.e2e.example). README has been updated as well.

  5. .cursor/ in .gitignore: no problem, that's a sensible addition.

Testing: I've reviewed both the unit and E2E tests, and they both look good to me. The unit tests verify that the card is rendered as an tag with the expected href, and confirm that data-testid selectors are present. The E2E test mocks GraphGL and fires off a click event, verifying that the card navigation works and then the back button works as well. The note about clearing storageState to emulate a logged-out session is a good touch.

My general impression: looks good to me, approved for merging.

Thanks @niamao

@flyblackbox @niamao

@motirebuma
motirebuma merged commit b48086e into main Jul 22, 2026
5 checks passed
@niamao niamao linked an issue Jul 23, 2026 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RC1-004 Featured posts should navigate to post detail page

2 participants