Skip to content

feat: make stat cards clickable#4

Merged
ziguifrido merged 1 commit into
mainfrom
feat/clickable-stat-cards
Jun 21, 2026
Merged

feat: make stat cards clickable#4
ziguifrido merged 1 commit into
mainfrom
feat/clickable-stat-cards

Conversation

@ziguifrido

@ziguifrido ziguifrido commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Makes the stat cards in the repository dashboard clickable — clicking Stars, Forks, Open Issues, or Watchers opens the corresponding page on GitHub.com in a new tab.

Stat Links to
Stars /stargazers
Forks /forks
Open Issues /issues
Watchers /watchers

Also bumps the project version to 0.3.3.

Changes

  • Replace <Card> wrappers with <a> links in the stats grid (src/components/ViewRepo.tsx)
  • Labels (Stars, Forks, etc.) now use group-hover:text-foreground for a subtle hover accent
  • Version updated in package.json, package-lock.json, and README.md

Summary by CodeRabbit

Release Notes v0.3.3

  • New Features

    • Repository topic badges are now clickable to search for related repositories
    • Key metrics (Stars, Forks, Open Issues, Watchers) are now interactive links to their corresponding GitHub pages
  • Chores

    • Updated Next.js, React, and React DOM dependencies to latest stable versions
    • Version bump to v0.3.3

…atchers

- Stars, Forks, Open Issues, and Watchers stat cards now open
  the corresponding GitHub.com page in a new tab
- Bump version to 0.3.3
@ziguifrido ziguifrido self-assigned this Jun 21, 2026
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
github-explorer-dashboard Ready Ready Preview, Comment Jun 21, 2026 6:52am

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The app version is bumped from v0.3.2 to v0.3.3 in package.json and README.md. Runtime dependencies (next, react, react-dom) and the eslint-config-next dev dependency are upgraded. ViewRepo is updated so topic badges trigger a search call and the four metrics cards become external anchor links to GitHub.

Changes

v0.3.3 Interactive ViewRepo + Dependency Upgrades

Layer / File(s) Summary
Version bump and dependency upgrades
package.json, README.md
App version incremented to 0.3.3; next (16.2.6 → 16.2.9), react/react-dom (19.2.4 → 19.2.7), and eslint-config-next (16.2.6 → 16.2.9) are upgraded.
Interactive topic badges and metrics links
src/components/ViewRepo.tsx
search is added to the useAppStore destructuring; topic Badge elements now call search("topic:<name>") on click; the Stars, Forks, Open Issues, and Watchers metric cards are refactored into anchor elements linking to their respective GitHub repository pages with updated hover styling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: make stat cards clickable' directly and clearly describes the main feature change in the pull request—converting stat cards into interactive, clickable links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)

✅ Unit Tests committed locally.

  • Create PR with unit tests
  • Commit unit tests in branch feat/clickable-stat-cards

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/ViewRepo.tsx`:
- Around line 159-166: The Badge component rendering the topic with an onClick
handler to trigger search is not keyboard-accessible. Replace the Badge
component with a semantic HTML button element that wraps the topic display and
maintains the same onClick handler for the search function. This will
automatically provide keyboard accessibility through standard Enter and Space
key support, and you can apply the existing className styling to the button to
preserve the visual appearance.
- Around line 55-57: The topic Badge component at lines 162-163 is clickable but
lacks keyboard accessibility and cannot receive focus. Convert the Badge to a
semantic interactive element such as a button, or add tabIndex="0" to make it
focusable, then implement keyboard event handlers (onKeyDown) to respond to
Enter and Space keys with the same click behavior. Ensure the element has proper
ARIA attributes if using a non-button element, and test that it can be navigated
to via keyboard and activated using Enter/Space keys.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 011c2745-6fcb-4267-8312-f6499453936e

📥 Commits

Reviewing files that changed from the base of the PR and between 7df0dde and 4e8e9aa.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • README.md
  • package.json
  • src/components/ViewRepo.tsx

Comment on lines +55 to 57
selectUser,
search
} = useAppStore();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
npm run lint
npm run build

Repository: ziguifrido/github-explorer

Length of output: 1330


Add keyboard support to topic Badge component for accessibility.

Lint and type checks pass. However, the topic Badge at line 162-163 is clickable but not keyboard-accessible. Make it a semantic control (button or interactive element) with proper keyboard handlers, or ensure it can receive focus and respond to Enter/Space keys.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ViewRepo.tsx` around lines 55 - 57, The topic Badge component
at lines 162-163 is clickable but lacks keyboard accessibility and cannot
receive focus. Convert the Badge to a semantic interactive element such as a
button, or add tabIndex="0" to make it focusable, then implement keyboard event
handlers (onKeyDown) to respond to Enter and Space keys with the same click
behavior. Ensure the element has proper ARIA attributes if using a non-button
element, and test that it can be navigated to via keyboard and activated using
Enter/Space keys.

Source: Coding guidelines

Comment on lines 159 to 166
<Badge
key={topic}
variant="secondary"
className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle"
onClick={() => search(`topic:${topic}`)}
className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle cursor-pointer transition-colors"
>
#{topic}
</Badge>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Topic badges are click-only and not keyboard-accessible.

Line 162 adds click behavior to Badge, but this control is not keyboard-operable as implemented. Use a semantic <button> (preferred) or add full keyboard interaction support.

Suggested fix
-              {activeRepo.topics.map(topic => (
-                <Badge 
-                  key={topic} 
-                  variant="secondary" 
-                  onClick={() => search(`topic:${topic}`)}
-                  className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle cursor-pointer transition-colors"
-                >
-                  #{topic}
-                </Badge>
-              ))}
+              {activeRepo.topics.map((topic) => (
+                <button
+                  key={topic}
+                  type="button"
+                  onClick={() => void search(`topic:${topic}`)}
+                  className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+                >
+                  #{topic}
+                </button>
+              ))}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Badge
key={topic}
variant="secondary"
className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle"
onClick={() => search(`topic:${topic}`)}
className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle cursor-pointer transition-colors"
>
#{topic}
</Badge>
{activeRepo.topics.map((topic) => (
<button
key={topic}
type="button"
onClick={() => void search(`topic:${topic}`)}
className="bg-muted hover:bg-muted text-muted-foreground hover:text-foreground text-[11px] py-0.5 px-2 rounded-md font-sans border border-subtle cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
#{topic}
</button>
))}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ViewRepo.tsx` around lines 159 - 166, The Badge component
rendering the topic with an onClick handler to trigger search is not
keyboard-accessible. Replace the Badge component with a semantic HTML button
element that wraps the topic display and maintains the same onClick handler for
the search function. This will automatically provide keyboard accessibility
through standard Enter and Space key support, and you can apply the existing
className styling to the button to preserve the visual appearance.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@ziguifrido ziguifrido merged commit 497791c into main Jun 21, 2026
4 checks passed
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

✅ Unit tests committed locally. Commit: 5bab48676d2b5e9b46778997c4a7c95ff1a96ff5

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.

1 participant