Commit 81ff9ff
refactor: Address Copilot code review recommendations
Address 3 of 4 Copilot recommendations from PR review:
1. [Rejected] SustainabilityPageDataID [JsonIgnore] attribute
- Intentionally excluded from JSON serialization
- Internal DB identifier only used for backend query filtering
- Frontend doesn't need this ID - proper encapsulation
2. [Fixed] Extract magic number 10 to named constant
- Added MAX_TREND_REPORTS constant in TrendChart.tsx
- Documents relationship to pagination limit
- Improves maintainability
3. [Fixed] Add user-facing message for insufficient trend data
- Previously returned null silently when < 2 reports
- Now shows helpful message: "Trend analysis requires at least 2 data points"
- Better UX for users with only 1 report
4. [Fixed] Remove unnecessary null-coalescing operator
- LoadMoreHistory parameter is non-nullable
- Removed redundant commandData?.PageIndex ?? 0
- Simplified to commandData.PageIndex
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d253a77 commit 81ff9ff
File tree
3 files changed
+22
-5
lines changed- src
- Client
- dist
- src/Sustainability/tab-template/history
- UIPages/SustainabilityTab
3 files changed
+22
-5
lines changed
0 commit comments