iiitl / iiitl/Opensource_Compass

Add Direct Issue Link to Each Featured Issue Card

Open Beginner friendly
#16 8 comments 0 reactions 0 assignees View on GitHub
frontend good first issue
Dominant language
TypeScript
Stars
0
Forks
16
PR merge metrics
No merged PRs in 30d

Description

### 📋 Description

On the Recommendations page, the **"Good First Issues"** section shows issue cards with a title, AI summary, labels, and a "View on GitHub" button. However, the button links to the **repository's issues list** (`/issues`) rather than the **specific issue** itself.

The `Issue` interface already has a concept of individual issue data (title, body, labels), and since the `repoId` is available, a direct issue URL can be constructed. This makes the feature significantly more useful — users can go directly to the issue they want to work on.

---

### 📍 File to Change

`frontend/app/(auth)/recommendations/components/featuredissues.tsx`

---

### 🔍 Current Code (line ~87)

```tsx
window.open(`https://github.com/${repoId}/issues`, '_blank')}
// ← Links to entire issues list, not a specific issue
>

View on GitHub

```

---

### ✅ What To Do

**Step 1:** Update the `Issue` interface in `frontend/lib/api/core-service.ts` to include an `issue_number` field (if not already present):

```ts
export interface Issue {
title: string;
body: string;
labels: string[];
issue_number?: number; // ← add this
ai?: {
summary?: string;
difficulty?: string;
estimated_time?: string;
};
}
```

**Step 2:** In `featuredissues.tsx`, construct the direct issue URL when `issue_number` is available:

```tsx
const issueUrl = issue.issue_number
? `https://github.com/${repoId}/issues/${issue.issue_number}`
: `https://github.com/${repoId}/issues`;

// Then use it in the button:
onClick={() => window.open(issueUrl, '_blank')}
```

**Step 3:** Update the button label to reflect whether it's a direct link:

```tsx
{issue.issue_number ? `View Issue #${issue.issue_number}` : 'View Issues'}
```

---

### 🏁 Acceptance Criteria

- [ ] Each issue card's button links to the **specific issue** (e.g. `github.com/owner/repo/issues/42`) when an `issue_number` is available
- [ ] Falls back to the general issues list (`github.com/owner/repo/issues`) when `issue_number` is not present
- [ ] The `Issue` interface in `core-service.ts` has an optional `issue_number` field
- [ ] The button label changes accordingly (e.g. `"View Issue #42"` vs `"View Issues"`)

---

### 💡 Technical Hints

- The `repoId` prop is already passed to `FeaturedIssues` (it's the `owner/repo` string like `"vercel/next.js"`)
- GitHub issue URLs follow the pattern: `https://github.com/{owner}/{repo}/issues/{number}`
- The `issue_number` may or may not be returned by the backend — the interface change should be backward-compatible using `?` (optional)

---

### 🚀 Getting Started

1. Fork the repository
2. Create a branch: `git checkout -b fix/issue-17-direct-issue-links`
3. Edit `frontend/app/(auth)/recommendations/components/featuredissues.tsx`
4. Optionally update `frontend/lib/api/core-service.ts` to add `issue_number`
5. Run: `cd frontend && npm run dev` → go to `/recommendations`
6. Open a Pull Request!

Contributor guide

Open the contributing guide

Research direction

Start with frontend/app/(auth)/recommendations/components/featuredissues.tsx and inspect how each Issue card builds its GitHub link and label. Check frontend/lib/api/core-service.ts for the Issue interface, then run the frontend development server and verify that cards with issue_number link to the specific issue while others use the repository issues list.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.