Skip to content

Fix: Discussion cards non-functional — wire onClick to redirect to GitHub discussion#1393

Merged
sanjay-kv merged 2 commits intomainfrom
copilot/fix-discussion-tab-functionality
May 4, 2026
Merged

Fix: Discussion cards non-functional — wire onClick to redirect to GitHub discussion#1393
sanjay-kv merged 2 commits intomainfrom
copilot/fix-discussion-tab-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

DiscussionCard had cursor: pointer CSS but no click handler — only the title <a> tag was interactive. Clicking anywhere else on the card (body text, author, engagement stats) did nothing, making cards appear broken.

Changes Made

  • src/components/discussions/DiscussionCard.tsx
    • Added handleCardClickwindow.open(discussion.html_url, "_blank", "noopener,noreferrer")
    • Bound to card wrapper onClick so the entire card surface is clickable
    • Added e.stopPropagation() on the inner title <a> to prevent double-navigation
    • Keyboard accessibility: role="button", tabIndex={0}, onKeyDown handles both Enter and Space, aria-label
// Before: only the title <a> was interactive
<motion.div className="discussion-card-new" ...>
  <a href={discussion.html_url} target="_blank">...</a>

// After: entire card is clickable
<motion.div
  className="discussion-card-new"
  onClick={handleCardClick}
  role="button"
  tabIndex={0}
  onKeyDown={(e) => (e.key === "Enter" || e.key === " ") && handleCardClick()}
  aria-label={`Open discussion: ${discussion.title}`}
>
  <a href={discussion.html_url} target="_blank" onClick={(e) => e.stopPropagation()}>

Dependencies

  • No new dependencies.

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 4, 2026

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

Project Deployment Actions Updated (UTC)
recode-website Ready Ready Preview, Comment May 4, 2026 11:45am

Copilot AI changed the title [WIP] Fix discussion tab not expanding or functional Fix: Discussion cards non-functional — wire onClick to redirect to GitHub discussion May 4, 2026
Copilot AI requested a review from sanjay-kv May 4, 2026 11:46
@Adez017 Adez017 self-requested a review May 4, 2026 12:08
@Adez017 Adez017 marked this pull request as ready for review May 4, 2026 12:09
@sanjay-kv
Copy link
Copy Markdown
Member

@Adez017 the issue raised and what it done is different right, there is already redirection to github working?

@Adez017
Copy link
Copy Markdown
Member

Adez017 commented May 4, 2026

@Adez017 the issue raised and what it done is different right, there is already redirection to github working?

Currently only the title is redirecting and now this creates whole cards functional. Isn't it ?

@sanjay-kv
Copy link
Copy Markdown
Member

thanks for clarification

@sanjay-kv sanjay-kv merged commit 586303e into main May 4, 2026
7 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project.

I would be grateful if you can nominate for keeping this opensource project live and running Link to Nominate. Please do star the repo and Keep up the fantastic work! 🚀

@sanjay-kv sanjay-kv added level 2 30 points recode this is label for leaderboard in-review The current changes are in review and would need approval and testing before merging labels May 4, 2026
@sanjay-kv sanjay-kv added this to the recode:launch 3.0 milestone May 4, 2026
@sanjay-kv sanjay-kv moved this to Q3 2026 – July-Sept in Recode Public Roadmap May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-review The current changes are in review and would need approval and testing before merging level 2 30 points recode this is label for leaderboard

Projects

Status: Done
Status: Q3 2026 – July-Sept

Development

Successfully merging this pull request may close these issues.

🐞[Bug]: Dicussion tab not expanding/non functional

3 participants