Skip to content

Keep filers in place when checking or changing files, and return detours to where they started - #277

Merged
nonprofittechy merged 3 commits into
mainfrom
fix/workflow-detours-and-document-checks
Oct 1, 2026
Merged

nonprofittechy merged 3 commits into
mainfrom
fix/workflow-detours-and-document-checks

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

Summary

A tester uploading a fee waiver on Fees was sent to the full "Check your documents" page and back, losing their fee waiver choice. Fixing that surfaced a family of detours where the app forgot why the filer was on a page. This PR keeps people where they are, or returns them to where they came from.

1. Fee waiver uploads are checked on Fees

The new copy is previewed in place with This copy looks right / Remove and upload a different file. The fee waiver choice stays selected, and Continue waits for the check (the server also refuses to continue with unchecked files).

2. One detour model in workflow.py

  • continue_url / continue_step decide where a finished step goes: back to Review or the handoff list, or to the single step that fixes what the change broke, still carrying the marker. That's Organize when a document has no filing type, and Find your case when an existing case isn't found yet.
  • Only a step's completion decides. Intermediate actions (adding a person, removing a file) keep the marker and stay on the screen.
  • Only two markers, review and handoff. They're checked in one place (return_target / clean_return_to) and never echoed back unchecked.
  • "Change files" on the preview keeps the origin through upload and preview.

Bugs fixed along the way:

  • The handoff middleware rewrote every successful POST to the handoff list. So Add a person on People bounced back to the list, and Find your case skipped Confirm your case. The middleware now only keeps the draft in the URL.
  • Confirm case dropped the marker when sending unchecked handoff documents to the preview.
  • The "needs organizing" check treated an empty document type as unfinished. Organize saves none when the court offers no choices, so with the check centralized this would have looped Organize ↔ Review. It now checks only the filing type.

3. Files added on the checklist are checked there

Previously Review sent the filer to the preview page and back for them. Confirm/remove now live in a shared document-checks endpoint and script used by both Fees and the checklist. Any supporting file can be removed there; the main document is still changed on the upload step.

Behavior changes to note

  • Switching between a new and an existing case from Review now goes Find your case (if needed) → Organize → Review, instead of restarting the flow. This skips the checklist, which is guidance, not a gate.
  • payment and document_checklist are no longer accepted as return markers.

Not in this PR

  • On a handoff detour, the "Back" and "Continue" labels don't say "Back to your list" the way they say "Back to review".
  • The handoff "missing details" list (issues_for) still requires document_type_code for every document, which can't be satisfied for courts with no confidentiality choices.

Testing

  • uv run pytest: 1330 passed. New: test_detours.py, test_document_checks.py, test_checklist_document_checks.py.
  • npm run test:unit: 70 passed. New: document-checks.test.js, plus coverage for Fees keeping Continue disabled while a check is pending.
  • New opt-in Chromium test, 9 scenarios: PAYMENT_FLOW_BROWSER_TESTS=1 uv run pytest -s efile/tests/test_payment_flow_browser.py. It needs the PDF.js vendor files (npm ci in efile_app).
    • Covers: the reported Fees flow, Axe, mobile width, remove/re-upload, reload before checking, a stale second tab, an unreadable PDF, Change files from Review, and checklist checks.
    • The stale-tab scenario can log a SQLite "table is locked" error from the test server. That's specific to SQLite and doesn't occur on PostgreSQL.

🤖 Generated with Claude Code

nonprofittechy and others added 3 commits October 1, 2026 15:26
Uploading a waiver on Fees redirected to the full document preview and back,
which dropped the filer's fee waiver choice. The new copy is now previewed and
confirmed (or removed) in place, and Continue waits for that check.

Adds an opt-in Chromium test covering the Fees flows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change files on the preview dropped where the filer came from, so someone
fixing a file from Review walked the whole flow again. Where a finished step
goes is now decided by workflow.continue_url: back to Review or the handoff
list, or to the one step that fixes what the change broke (Organize for a
document without a filing type, Find your case for an existing case not yet
found), still carrying the marker.

The handoff middleware no longer rewrites every successful POST, which sent
filers back to the list mid-step: adding a person on People, and finding a
case before confirming it. Gates and intermediate actions keep the marker,
markers are checked in one place, and only review and handoff are accepted.

The organizing check no longer treats an empty document type as unfinished,
since Organize saves none when the court offers no choices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing document added on the checklist was only previewed after Review
sent the filer to the preview step and back. The new copy is now shown open
on the checklist to confirm or remove, and Continue waits for it.

Confirming or removing a copy moves from the fee waiver endpoint to its own
document-checks endpoint and script, shared by Fees and the checklist. Any
supporting file can be removed there; the main document is still changed on
the upload step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nonprofittechy
nonprofittechy merged commit c34b905 into main Oct 1, 2026
8 checks passed
@nonprofittechy
nonprofittechy deleted the fix/workflow-detours-and-document-checks branch October 1, 2026 20:27
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.

1 participant