Skip to content

fix: send Insights docs link to issue-discovery doc in Discovery mode…#268

Merged
anderdc merged 4 commits intoentrius:testfrom
edwin-rivera-dev:fix/insights-card-docs-link-per-mode-152
Apr 15, 2026
Merged

fix: send Insights docs link to issue-discovery doc in Discovery mode…#268
anderdc merged 4 commits intoentrius:testfrom
edwin-rivera-dev:fix/insights-card-docs-link-per-mode-152

Conversation

@edwin-rivera-dev
Copy link
Copy Markdown
Contributor

Summary

Fixes #152. On a miner's detail page, the "Learn more about scoring in the docs" link in the Insights & Next Actions card always pointed to docs.gittensor.io/oss-contributions.html, even when the user had toggled the page to Issue Discovery mode. The link now matches the active view.

Root cause

MinerDetailsPage already derives viewMode: 'prs' | 'issues' from the URL toggle at the top of the page and passes it to MinerScoreCard. It did not pass the same prop to MinerInsightsCard, so the insights card had no way to know which docs page to link to and used the OSS one as a hardcoded fallback.

Fix

  • MinerInsightsCard accepts a new optional viewMode?: 'prs' | 'issues' prop (default 'prs' for backward compatibility).
  • A single docsUrl constant inside the component picks between issue-discovery.html and oss-contributions.html based on viewMode.
  • MinerDetailsPage forwards its existing viewMode to MinerInsightsCard, matching the pattern it already uses for MinerScoreCard.

No other callers exist (verified via grep).

Type of Change

  • Bug fix

Testing

  • npm run build
  • npm run lint:fix
  • Manual (per issue repro):
    1. Open /miners/details?githubId=152555741 - toggle is on OSS Contributions --> "docs" link opens docs.gittensor.io/oss-contributions.html ✅ (unchanged)
    2. Click Issue Discovery toggle in the top-right --> URL gains &viewMode=issues, card re-renders --> "docs" link now opens docs.gittensor.io/issue-discovery.html
    3. Refresh on the Issue Discovery URL --> link still points to issue-discovery.html

Checklist

  • Backwards-compatible (prop is optional, defaults to 'prs')
  • No new dependencies
  • Two files touched
  • Follows the pattern already used by MinerScoreCard for the same viewMode prop

Media to Upload

14.04.2026_22.08.25_REC_152.mp4

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Closing — CI is failing (build + format) and the diff includes unrelated changes (removing the viewMode guard on MinerScoreBreakdown). The bug is valid but the fix is a one-liner — no need for the restructuring that broke the build.

@anderdc anderdc closed this Apr 15, 2026
@anderdc anderdc reopened this Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

The bug is real but the fix is a one-liner — the component already has isIssueMode, just use it in the href. Drop the assembleIssueInsights restructuring (it's what broke the build) and the unrelated MinerScoreBreakdown guard removal.

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

Docs link fix looks good now. Still has the unrelated MinerScoreBreakdown guard removal in MinerDetailsPage.tsx — drop that change, it's not part of this fix.

@edwin-rivera-dev
Copy link
Copy Markdown
Contributor Author

Hi, @anderdc Thanks for your feedback. I have just updated. Please review again and let me know. 👍

anderdc
anderdc previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

MinerScoreBreakdown revert done. Clean one-file fix. Looks good.

@anderdc anderdc dismissed their stale review April 15, 2026 15:49

Bug is already fixed on test — viewMode is already passed and the conditional href already works.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Closing — the bug from #152 is already fixed on test. MinerDetailsPage already passes viewMode to MinerInsightsCard, and the conditional href already picks the right docs URL. This PR just extracts the inline conditional to a variable, which isn't worth a standalone PR.

@anderdc anderdc closed this Apr 15, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Reopening — you addressed all the feedback. Sorry for the back and forth.

@anderdc anderdc reopened this Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

All feedback addressed. Clean fix.

@anderdc anderdc merged commit 14eab0a into entrius:test Apr 15, 2026
4 checks passed
@anderdc anderdc added the bug Something isn't working label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] "docs" link behind "Learn more about scoring in the" text in issue discovery page is wrong

2 participants