Skip to content

Feature/court case improvements#6966

Open
patphongs wants to merge 7 commits intodevelopfrom
feature/court-case-improvements
Open

Feature/court case improvements#6966
patphongs wants to merge 7 commits intodevelopfrom
feature/court-case-improvements

Conversation

@patphongs
Copy link
Member

@patphongs patphongs commented Feb 6, 2026

Summary

Resolves #6965
Resolves #6963

This PR makes several improvements to the court case index page:

  1. Cross-reference entries: Adds a new cross_references StreamField to CourtCaseIndexPage that allows editors to create plain-text index entries (e.g., "Miller: FEC v.") with "See:" links pointing to existing CourtCasePage instances. This supports cases where the alternate name/title does not have its own court case page but should still appear in the alphabetically-sorted index.
  2. Page chooser search: Adds search_fields to CourtCasePage so editors can search for cases by title when using the page chooser in the new cross-reference StreamField.
  3. Case number sort simplification: Simplifies case number extraction to use only the first case number for sorting purposes.

Required reviewers

1 engineer
1 content

Impacted areas of the application

  • Court case index page (/legal/court-cases/)
  • Wagtail CMS editor interface for CourtCaseIndexPage
  • Court case sorting logic

Screenshots

Cross reference feature

Before: No cross-reference entries exist; alternate names with no page are absent from the index.

After: Cross-reference entries appear as plain text with a "See:" line linking to the referenced case pages, sorted alphabetically alongside normal entries.

Screenshot 2026-02-11 at 11 47 11 PM

Case number sort

Screenshot 2026-02-11 at 11 51 13 PM

How to test

  1. In the Wagtail admin, navigate to the Court Case Index Page.
  2. Add one or more entries to the new Cross References StreamField panel, providing a plain-text title (e.g., "Wagner: FEC v.") and selecting one or more court case pages for the "See also cases" field.
  3. Save and publish the page.
  4. Visit the court case index page and verify:
    • The cross-reference entry appears in the correct alphabetical position in the table.
    • It renders as plain text (not a link), followed by See: <linked case title(s)>.
    • Normal court case entries are unaffected and still render as links.
    • Check that the case number sort works. Expectation is that the higher case number will be first in the list and then descend from there, in reverse chronological order. See ticket and above screenshot for details.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 96.20253% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.79%. Comparing base (05b2069) to head (a0f3818).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
fec/home/tests/test_court_cases.py 93.87% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6966      +/-   ##
===========================================
+ Coverage    79.58%   79.79%   +0.21%     
===========================================
  Files          254      255       +1     
  Lines         6406     6474      +68     
===========================================
+ Hits          5098     5166      +68     
  Misses        1308     1308              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@patphongs patphongs marked this pull request as ready for review February 12, 2026 14:49
@patphongs
Copy link
Member Author

patphongs commented Feb 17, 2026

Note for myself, cc @johnnyporkchops : After merging the rulemaking CMS PR into develop, the latest migration in home becomes 0148_alter_courtcasepage_sections_and_more.

On this PR, I'll need to:

  1. Merge develop into this branch
  2. Delete the old 0148_courtcaseindexpage_cross_references.py
  3. Run ./manage.py makemigrations to generate a new migration file.

Django should generate a fresh 0149_courtcaseindexpage_cross_references.py that depends on the rulemaking PR's migration 0148.

@patphongs
Copy link
Member Author

Django should generate a fresh 0149_courtcaseindexpage_cross_references.py that depends on the rulemaking PR's migration 0148.

This is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Update sort logic for court case index page Determine next steps for court cases without links

1 participant

Comments