refactor: extract deltaChartUtils and PropertyComparisonChart from DBDeltaChart#1831
refactor: extract deltaChartUtils and PropertyComparisonChart from DBDeltaChart#1831kodiakhq[bot] merged 2 commits intomainfrom
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
E2E Test Results✅ All tests passed • 77 passed • 4 skipped • 861s
Tests ran across 4 shards in parallel. |
|
@claude - do code review |
|
Claude finished @alex-fedotyev's task in 1m 40s —— View job Code ReviewTasks
SummaryThis is a clean, faithful extraction. The +257/-257 symmetry holds, E2E tests all pass, and the file structure is logical. A few items worth noting below — most are pre-existing, but they're now more visible in isolated files. Issues
|
…DeltaChart Fixes #1830 Pure refactor — zero behavior change. Extracts inline utility functions and the PropertyComparisonChart component from DBDeltaChart.tsx (601 lines) into separate files, establishing the file structure for the Event Deltas improvement series. New files: - deltaChartUtils.ts: flattenData, getPropertyStatistics, mergeValueStatisticsMaps - PropertyComparisonChart.tsx: PropertyComparisonChart, HDXBarChartTooltip, layout constants (CHART_WIDTH, CHART_HEIGHT, CHART_GAP, PAGINATION_HEIGHT) DBDeltaChart.tsx shrinks from 601 to 344 lines (imports replace inline code). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses code review feedback — the PropertyComparisonChart outer div now uses the CHART_HEIGHT constant defined in the same file, preventing the values from drifting apart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e3a1f4b to
ac4ca01
Compare
…DeltaChart (#1831) ## Summary Fixes #1830 Pure refactor — **zero behavior change**. Extracts inline utility functions and the `PropertyComparisonChart` component from `DBDeltaChart.tsx` (601 lines) into separate files. ## Changes | Action | File | Lines | |--------|------|-------| | **NEW** | `deltaChartUtils.ts` | 107 lines — `flattenData`, `getPropertyStatistics`, `mergeValueStatisticsMaps` | | **NEW** | `PropertyComparisonChart.tsx` | 130 lines — `PropertyComparisonChart`, `HDXBarChartTooltip`, layout constants | | **MODIFIED** | `DBDeltaChart.tsx` | 601 → 344 lines — inline code replaced with imports | **+257 / -257** — exact symmetry confirming this is a pure move. ## Why `DBDeltaChart.tsx` at 601 lines violates the 300-line guideline. More importantly, extracting into separate files enables the Event Deltas improvement series (#1823–#1829) to add features to clean, focused files instead of one monolith. ## Review guidance This is a **move-only refactor**. To verify: 1. `deltaChartUtils.ts` contains the exact functions from lines 52–156 of the old `DBDeltaChart.tsx`, now exported 2. `PropertyComparisonChart.tsx` contains the exact component from lines 158–259 and constants from lines 261–271, now exported 3. `DBDeltaChart.tsx` imports from the new files — no logic changes ## Test plan - [ ] Existing E2E tests pass - [ ] Event Deltas comparison view works identically - [ ] No visual changes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Fixes #1830
Pure refactor — zero behavior change. Extracts inline utility functions and the
PropertyComparisonChartcomponent fromDBDeltaChart.tsx(601 lines) into separate files.Changes
deltaChartUtils.tsflattenData,getPropertyStatistics,mergeValueStatisticsMapsPropertyComparisonChart.tsxPropertyComparisonChart,HDXBarChartTooltip, layout constantsDBDeltaChart.tsx+257 / -257 — exact symmetry confirming this is a pure move.
Why
DBDeltaChart.tsxat 601 lines violates the 300-line guideline. More importantly, extracting into separate files enables the Event Deltas improvement series (#1823–#1829) to add features to clean, focused files instead of one monolith.Review guidance
This is a move-only refactor. To verify:
deltaChartUtils.tscontains the exact functions from lines 52–156 of the oldDBDeltaChart.tsx, now exportedPropertyComparisonChart.tsxcontains the exact component from lines 158–259 and constants from lines 261–271, now exportedDBDeltaChart.tsximports from the new files — no logic changesTest plan
🤖 Generated with Claude Code