fix: remove explicit type annotations from SeverityChart Tooltip formatter#14
Merged
Merged
Conversation
…atter Removes the explicit `(value: number, name: string)` type annotations from the recharts Tooltip formatter callback. The explicit types conflict with recharts' stricter Formatter<ValueType, NameType> type in newer versions. Letting TypeScript infer the types from the library's definition resolves the compilation error. Fixes TypeScript error: Type '(value: number, name: string) => [string, string]' is not assignable to type 'Formatter<ValueType, NameType>' Agent-Logs-Url: https://github.com/SynTechRev/ODIA/sessions/68618152-d7a0-4312-b08a-d19a0cf7b76c Co-authored-by: SynTechRev <235390103+SynTechRev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix TypeScript compilation error in SeverityChart
fix: remove explicit type annotations from SeverityChart Tooltip formatter
Apr 13, 2026
There was a problem hiding this comment.
Pull request overview
Fixes a TypeScript compilation error in the frontend severity pie chart by making the Recharts <Tooltip /> formatter callback contextually typed (via Recharts’ Formatter<ValueType, NameType>), unblocking desktop/Electron builds.
Changes:
- Remove explicit
number/stringparameter annotations fromTooltip.formatterinSeverityChartto restore assignability to Recharts’ formatter type.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Recharts'
Tooltipformatterprop is typed asFormatter<ValueType, NameType>whereValueTypeandNameTypeare constrained generics. Explicitly annotating the callback parameters asnumberandstringbreaks assignability, causing a TS compilation error that blocks desktop builds.Change
frontend/components/analysis/SeverityChart.tsxDropping the annotations lets TypeScript infer from recharts' own type definitions — no semantic change, type-system compatibility restored.
Original prompt
Fix TypeScript Compilation Error in SeverityChart and Clean Up Release Branches
Problem Overview
The repository has been stuck in a failed release cycle with multiple attempts from VS Code agents. There are TypeScript compilation errors blocking desktop builds and a confused branch/tag state.
Current Issues
frontend/components/analysis/SeverityChart.tsx(line 89)Root Cause
File:
frontend/components/analysis/SeverityChart.tsxLine: 89-92
Error:
Current problematic code:
The explicit type annotations
(value: number, name: string)conflict with recharts' stricter type system in newer versions. TypeScript cannot infer the proper compatibility.Required Changes
1. Fix TypeScript Error in SeverityChart.tsx
Location:
frontend/components/analysis/SeverityChart.tsxlines 88-93Change from:
Change to:
Explanation: Remove explicit type annotations and let TypeScript infer the types from recharts' Formatter type definition. This ensures compatibility with the library's expected signature.
2. Verify No Other TypeScript Errors
Check for any similar patterns in other chart components:
frontend/components/analysis/*.tsx3. Clean Up Branch State (Optional Documentation)
Add a note in commit message about cleaning up the v2.1.1 branch confusion for future reference.
Testing Requirements
Before Committing
Type Check:
Build Test:
cd frontend ELECTRON_BUILD=1 npm run buildEnsure no compilation errors
After PR Merge
Expected Outcome
After this fix:
Post-Merge Actions
After this PR is merged to master:
Delete the v2.1.1 branch (if it exists as a branch, not a tag):
Create v2.1.0 release tag from clean master:
git tag -a v2.1.0 -m "Release v2.1.0 - First Official Release" git push origin v2.1.0Monitor automated build:
Files to Modify
frontend/components/analysis/SeverityChart.tsx- Remove type annotations from Tooltip formatterAcceptance Criteria
Related Context
Success Metrics
After merge and v2.1.0 release:
The following is the prior conversation context from the user's chat exploration (may be truncated):
Assistant: Perfect! Now I have a complete picture. Let me provide you with a thorough assessment:
🔍 COMPLETE ASSESSMENT & ROOT CAUSE ANALYSIS
📊 CURRENT STATE
✅ What's Working
.github/workflows/release-desktop.ymlis in place❌ The Problem - NO RELEASE HAS BEEN CREATED YET
Root Cause: The README now points to release links, but NO ACTUAL RELEASE EXISTS.
**Why the 404 error happens:...
This pull request was created from Copilot chat.