-
Notifications
You must be signed in to change notification settings - Fork 7
OPS-4144 new portfolio list page #4812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a new Portfolio List page that replaces the previous card-based layout with a comprehensive table view featuring fiscal year selection, filtering capabilities, export functionality, and a summary visualization of budget distribution across portfolios.
Changes:
- Added new backend API endpoint for batch portfolio funding summary retrieval with filtering support (budget range, available percentage, portfolio IDs)
- Implemented frontend table view with sortable columns, tabs (All/My Portfolios), fiscal year selector, and filter system
- Created horizontal stacked bar chart component with interactive legend for portfolio budget visualization
Reviewed changes
Copilot reviewed 53 out of 55 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/ops_api/ops/resources/portfolio_funding_summary.py | New batch API endpoint with filtering logic |
| backend/ops_api/ops/schemas/portfolio_funding_summary.py | Schema definitions for batch requests and responses |
| backend/ops_api/tests/ops/funding_summary/test_portfolio_funding_summary.py | Comprehensive API tests for new endpoint |
| frontend/src/pages/portfolios/list/PortfolioList.jsx | Complete page rewrite with table layout |
| frontend/src/pages/portfolios/list/PortfolioList.hooks.js | Custom hook for state management and data fetching |
| frontend/src/components/Portfolios/PortfolioTable/* | Table components with sorting functionality |
| frontend/src/components/Portfolios/PortfolioSummaryCards/* | Summary card with stacked bar visualization |
| frontend/src/components/UI/DataViz/HorizontalStackedBar/* | Reusable stacked bar chart component |
| frontend/src/pages/portfolios/list/PortfolioFilterButton/* | Filter modal with budget range slider and percentage filters |
| frontend/cypress/e2e/portfolioList.cy.js | Updated E2E tests for new functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/src/components/Portfolios/PortfolioSummaryCards/PortfolioSummaryCards.constants.js
Show resolved
Hide resolved
|
Code Review: PR #4812 - OPS-4144 New Portfolio List Page by Claude 🤖 Overview This PR implements a comprehensive portfolio list page with advanced filtering, sorting, and export capabilities. The implementation includes:
PR Stats: 6,475 additions, 97 deletions across 76 files 🎯 What Works Well Strong Architecture Patterns ✅ Clean separation of concerns with dedicated hooks (usePortfolioList) and helper modules Code Quality
Location: frontend/src/pages/portfolios/list/PortfolioList.helpers.js:30-53 // TODO: Remove this function before merge This function is marked as "temporary for testing" but is exported and has test coverage. Should be removed along with its tests in PortfolioList.helpers.test.js.
Locations: Multiple files The default budget range [0, 100000000] is duplicated across:
Recommendation: Extract to a shared constant: Same for PERCENTAGE_RANGE_LABELS in PortfolioList.constants.js - consider moving to global constants if used elsewhere.
Location: frontend/src/pages/portfolios/list/PortfolioList.helpers.js:117-133 Current implementation: Issue: Users won't know if export fails (silent failure) Recommendation: Add user-facing error notification:
Locations:
The table uses custom division order (DCFD→DFS→DEI→OD→Non-OPRE→OCDO) while summary cards use PORTFOLIO_ORDER constant. Question: Is this intentional? If not, should they share the same constant?
Location: PortfolioList.hooks.js:60-62 if (min === max) { Issue: If all portfolios have the same budget, falls back to default range. Could confuse users with slider showing $0-$100M when actual data is $5M-$5M. Consideration: Could add small buffer (±10%) or display message about limited range.
Location: PortfolioList.hooks.js:73-77 if (!portfolio) { Issue: If API calls have different timing, could spam console during loading Suggestion: Either remove (may be normal during loading) or convert to data consistency metric/log 🔍 Code Quality Observations Backend (portfolio_funding_summary.py) Good:
Consider:
Frontend Hook (PortfolioList.hooks.js) Good:
Consider:
Frontend Components PortfolioFilterButton.jsx:
PortfolioTable.jsx:
HorizontalStackedBar.jsx:
🧪 Testing Coverage
E2E Test Coverage (portfolioList.cy.js)
Potential Gaps
📝 Documentation OpenAPI Spec (backend/openapi.yml)
Code Comments
🚀 Performance Considerations Good Practices
Potential Optimizations (Future)
🔐 Security
📋 Checklist Before Merge Required
Recommended
Optional (Nice to Have)
🎉 Summary This is a high-quality, well-tested implementation of a complex feature. The architecture is solid, test coverage is comprehensive, and the code follows project conventions. The issues identified are minor and primarily involve cleanup (temporary code) and polish (constants extraction, error handling). Recommendation: Approve with minor changes. The required items are quick fixes that shouldn't require additional review rounds. Great work on the thorough testing and accessibility considerations! 🚀 |
|
🎉 This PR is included in version 1.257.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

What changed
This PR implements a new Portfolio List page with summary card, tale, filters and export button.
Issue
#4144
How to test
Screenshots
Definition of Done Checklist