fix(miner-insights): render insight description body in Insights & Next Actions card#1183
Open
Khaostica wants to merge 1 commit into
Open
fix(miner-insights): render insight description body in Insights & Next Actions card#1183Khaostica wants to merge 1 commit into
Khaostica wants to merge 1 commit into
Conversation
…xt Actions card
The MinerInsightsCard rendered each insight's title + type chip but never
its description, because the JSX held a self-closing Typography where
{insight.description} should have been a child. The data was correct;
the render was empty.
Adds the missing description child and extracts the pure insight-builder
logic into src/components/miners/minerInsights.ts so a regression test
can pin every builder's description-populating behavior without standing
up React DOM testing infrastructure.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Insights & Next Actions card on every miner detail page silently dropped the description body under each insight. Each row rendered only the title + colored type chip (
WARNING/TIP/ACHIEVEMENT) with empty space below it, removing all the actionable context users rely on.Root cause:
MinerInsightsCard.tsxhad a self-closing<Typography sx={{...}} />where{insight.description}was supposed to be rendered. TheInsightIteminterface declareddescription: stringand all 8 insight builders (PR-mode + issue-mode) populated it correctly, but the JSX never emitted a child for it — so the styled<p>sat empty in the DOM on every row.The fix is a one-line render change. The remaining diff extracts the pure insight-builder logic out of the JSX file into
src/components/miners/minerInsights.tsso each builder can be unit-tested without standing up React DOM testing infrastructure (matching the existingsrc/tests/*.test.tspure-logic convention). The new test file pins every builder's description-populating behavior so this regression cannot silently come back.Changes
src/components/miners/MinerInsightsCard.tsx— adds{insight.description}as a child of the previously self-closingTypography. Removes the inlined insight builders/assemblers (now imported from./minerInsights).src/components/miners/minerInsights.ts(new) — pure module exportingInsightItem,InsightType, the 8 builders (getOpenPrInsight,getCredibilityInsight,getEligibilityInsight,getCollateralInsight,getOpenIssueRiskInsight,getIssueEligibilityInsight,getIssueCredibilityInsight,getIssueSolvedInsight), andassemblePrInsights/assembleIssueInsights. Behavior is identical to the previous inlined implementation — code was moved verbatim.src/tests/minerInsights.test.ts(new) — 10 Vitest cases following the pure-logic pattern of the existing tests insrc/tests/. Covers every builder and asserts both assemble-level outputs contain only insights with non-empty descriptions.Related Issues
Closes #1182
Type of Change
Screenshots
Before:

After:

Checklist
STATUS_COLORS+alpha()onlynpm run formatandnpm run lint:fixhave been runnpm run buildpasses