Skip to content

Implement project list#38

Open
sprucely wants to merge 3 commits into
mainfrom
swe/ProjectList
Open

Implement project list#38
sprucely wants to merge 3 commits into
mainfrom
swe/ProjectList

Conversation

@sprucely

@sprucely sprucely commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #17

Summary by CodeRabbit

  • New Features

    • Added a Project Identification workflow stage with a project list view, summary cards, tabbed status breakdown, search, and pagination.
    • Displays project counts and an SFN distribution summary, along with a disabled “Finalize” action.
    • Supports loading, error messaging, and a Retry option when the project list fails to load.
    • Updated workflow navigation to recognize and render the new stage UI.
  • Bug Fixes

    • Improved display normalization for missing fields and remapped specific status text for consistency.
    • Project list loading now uses the correct fiscal-year cycle and filtering behavior.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a Project List API backed by fiscal-year parsing, database queries, aggregation, and stored procedure changes. It also adds a client project-identification stage with tabs, summaries, search, retry handling, workflow integration, and expanded tests.

Changes

Project List feature

Layer / File(s) Summary
Fiscal year cycle contract
server/Models/FiscalYearCycle.cs, tests/server.tests/Models/FiscalYearCycleTests.cs
Adds fiscal-year parsing, normalized FY## values, October–September cycle dates, and validation tests.
Stored procedure output
database/data/StoredProcedures/GetProjectList.sql
Updates project matching, director and organization fields, cycle filtering, and UNION projections.
Response contracts and aggregation
server/Models/ProjectList/ProjectListDtos.cs, server/ProjectList/IProjectListService.cs, server/ProjectList/ProjectListResponseFactory.cs, tests/server.tests/ProjectList/ProjectListResponseFactoryTests.cs
Defines project-list DTOs and builds counts, summaries, SFN distribution, and row results.
Database service and API
server/ProjectList/*, server/Controllers/ProjectListController.cs, server/Program.cs, tests/server.tests/ProjectList/ProjectListControllerTests.cs
Retrieves stored-procedure rows and summary counts, registers the service, and exposes GET /api/projectlist with fiscal-year validation.
Client query and stage
client/src/queries/projectList.ts, client/src/components/ProjectIdentificationStage.tsx
Fetches project-list data and renders loading/error states, summaries, tabs, badges, search, pagination, and a disabled Finalize button.
Workflow integration and client tests
client/src/routes/(authenticated)/workflow.$stageId.tsx, client/src/test/routes/(authenticated)/workflow.test.tsx
Mounts the stage for project identification and tests fiscal-year requests, rendered data, filtering, search, and retry behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ProjectIdentificationStage
  participant ProjectListController
  participant ProjectListService
  participant GetProjectList
  Browser->>ProjectIdentificationStage: render project-identification stage
  ProjectIdentificationStage->>ProjectListController: GET /api/projectlist?fy=FY26
  ProjectListController->>ProjectListService: validate FY and call GetAsync
  ProjectListService->>GetProjectList: execute stored procedure
  GetProjectList-->>ProjectListService: project rows
  ProjectListService-->>ProjectListController: aggregated ProjectListResponse
  ProjectListController-->>ProjectIdentificationStage: return response
  ProjectIdentificationStage->>ProjectIdentificationStage: filter and display rows
Loading

Possibly related PRs

  • ucdavis/AD419#25: Both changes update GetProjectList.sql and its project-list result shape.
  • ucdavis/AD419#22: Both changes modify the project-identification workflow route.
  • ucdavis/AD419#20: Adds PGM award fields consumed by this PR’s project-list filtering.

Suggested reviewers: rmartinsen-ucd

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and matches the main change: adding the project list feature and its supporting UI, API, and tests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch swe/ProjectList

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
tests/server.tests/Models/FiscalYearCycleTests.cs (1)

8-28: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding test cases for 4-digit years and 2-digit boundaries.

The valid-case theory only covers "FY25" and "fy26". Adding "FY2025" (4-digit path) and "FY00"/"FY99" (2-digit boundaries) would verify the shortYear < 100 ? 2000 + shortYear : shortYear branch and edge values.

🧪 Suggested InlineData additions
     [InlineData("FY25", "FY25", 2024, 10, 1, 2025, 9, 30)]
     [InlineData("fy26", "FY26", 2025, 10, 1, 2026, 9, 30)]
+    [InlineData("FY2025", "FY25", 2024, 10, 1, 2025, 9, 30)]
+    [InlineData("FY00", "FY00", 1999, 10, 1, 2000, 9, 30)]
+    [InlineData("FY99", "FY99", 2098, 10, 1, 2099, 9, 30)]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/server.tests/Models/FiscalYearCycleTests.cs` around lines 8 - 28, The
FiscalYearCycle.TryParse test only covers mid-range 2-digit inputs, so add cases
for the 4-digit parse path and the 2-digit boundary values. Extend
TryParse_maps_fiscal_year_to_cycle_dates in FiscalYearCycleTests with InlineData
for "FY2025" plus "FY00" and "FY99", and assert the expected FiscalYear,
CycleStart, and CycleEnd so the shortYear conversion branch is exercised.
client/src/components/ProjectIdentificationStage.tsx (1)

141-142: 📐 Maintainability & Code Quality | 🔵 Trivial

Verify workflow-panel classes align with Tailwind/DaisyUI guidelines.

The workflow-panel and workflow-panel__header classes use BEM-style custom CSS. The coding guidelines prefer Tailwind CSS classes unless necessary, while also allowing UC Davis Gunrock design system patterns. Confirm these classes are part of the Gunrock design system; otherwise, consider replacing with Tailwind utilities.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/components/ProjectIdentificationStage.tsx` around lines 141 - 142,
The `workflow-panel` and `workflow-panel__header` wrappers in
`ProjectIdentificationStage` should be checked against the Gunrock design
system, since they currently use custom BEM-style classes that may conflict with
the Tailwind/DaisyUI preference. If these class names are not part of the
approved design system, replace them with equivalent Tailwind utility classes
and keep the surrounding JSX structure in `ProjectIdentificationStage`
consistent with the existing layout.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/components/ProjectIdentificationStage.tsx`:
- Around line 63-65: ProjectIdentificationStage currently only checks data and
isLoading, so a failed useQuery can leave the loading state stuck forever.
Update the query handling in ProjectIdentificationStage (and the other matching
location noted in the review) to also read the error state from
useQuery/projectListQueryOptions, render an error message when the fetch fails
after retries, and provide a retry action that re-runs the query instead of
continuing to show “Loading project list...”.

In `@server/Models/FiscalYearCycle.cs`:
- Around line 27-32: Add explicit bounds validation in the FiscalYearCycle
parsing flow before constructing the DateOnly values. In the logic that computes
endYear and startYear for the FiscalYearCycle constructor, reject parsed years
outside the supported range so endYear stays within 2 to 9999 (and startYear
remains valid) instead of letting DateOnly throw ArgumentOutOfRangeException.
Make the parse path return a validation failure/400-style result for invalid
inputs like "FY10000" rather than creating the FiscalYearCycle with invalid
dates.

---

Nitpick comments:
In `@client/src/components/ProjectIdentificationStage.tsx`:
- Around line 141-142: The `workflow-panel` and `workflow-panel__header`
wrappers in `ProjectIdentificationStage` should be checked against the Gunrock
design system, since they currently use custom BEM-style classes that may
conflict with the Tailwind/DaisyUI preference. If these class names are not part
of the approved design system, replace them with equivalent Tailwind utility
classes and keep the surrounding JSX structure in `ProjectIdentificationStage`
consistent with the existing layout.

In `@tests/server.tests/Models/FiscalYearCycleTests.cs`:
- Around line 8-28: The FiscalYearCycle.TryParse test only covers mid-range
2-digit inputs, so add cases for the 4-digit parse path and the 2-digit boundary
values. Extend TryParse_maps_fiscal_year_to_cycle_dates in FiscalYearCycleTests
with InlineData for "FY2025" plus "FY00" and "FY99", and assert the expected
FiscalYear, CycleStart, and CycleEnd so the shortYear conversion branch is
exercised.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71c774af-2b1b-416b-b557-0c960ad85f7a

📥 Commits

Reviewing files that changed from the base of the PR and between bc49ed3 and e897324.

📒 Files selected for processing (15)
  • client/src/components/ProjectIdentificationStage.tsx
  • client/src/queries/projectList.ts
  • client/src/routes/(authenticated)/workflow.$stageId.tsx
  • client/src/test/routes/(authenticated)/workflow.test.tsx
  • database/data/StoredProcedures/GetProjectList.sql
  • server/Controllers/ProjectListController.cs
  • server/Models/FiscalYearCycle.cs
  • server/Models/ProjectList/ProjectListDtos.cs
  • server/Program.cs
  • server/ProjectList/IProjectListService.cs
  • server/ProjectList/ProjectListResponseFactory.cs
  • server/ProjectList/ProjectListService.cs
  • tests/server.tests/Models/FiscalYearCycleTests.cs
  • tests/server.tests/ProjectList/ProjectListControllerTests.cs
  • tests/server.tests/ProjectList/ProjectListResponseFactoryTests.cs

Comment thread client/src/components/ProjectIdentificationStage.tsx Outdated
Comment thread server/Models/FiscalYearCycle.cs Outdated
@sprucely sprucely requested a review from rmartinsen-ucd July 9, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project list grid and Issues/Clean/All screen (read-only)

1 participant