Skip to content

Add filing path and document intake - #145

Open
nonprofittechy wants to merge 3 commits into
workflow/branch-aware-navigationfrom
workflow/filing-path-upload
Open

Add filing path and document intake#145
nonprofittechy wants to merge 3 commits into
workflow/branch-aware-navigationfrom
workflow/filing-path-upload

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

What changed

  • starts version-2 drafts on a new What are you trying to do? screen
  • replaces lead-only upload with one multi-PDF intake for lead and supporting documents
  • shows Uploading → Analyzing → Ready as in-page states
  • adds Here's what we found for extracted court/category/type corrections and new/existing confirmation
  • adds the shared eight-stage progress UI and temporary downstream compatibility bridges
  • keeps filing metadata out of intake so it can move to Organize Documents

Screenshots

Filing path

Filing path

Consolidated upload

Upload documents

Extraction review

Extraction review

Impact

This is stacked on #144. The new beginning works end-to-end, then temporarily bridges into the legacy form until the later stacked PRs replace the downstream screens.

Validation

  • Illinois test-account browser verification with all three screenshots
  • uv run pytest (193 passed)
  • npm run test:unit (17 passed)
  • Ruff, djLint, CSS/JS format hooks, ty, migration drift check

Part of #136.

Copilot AI 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.

Pull request overview

This PR introduces the first user-visible screens for workflow version 2, including a new “filing path” start, consolidated multi-PDF intake with lead/supporting documents, an extraction review screen, and a shared progress UI, while temporarily bridging unmigrated downstream routes into the legacy flow.

Changes:

  • Start v2 drafts on the new Filing Path screen and route into consolidated document upload.
  • Add document intake + extraction review screens (including LLM-based guess extraction) and UI state handling.
  • Add shared workflow base/progress UI and legacy redirect bridges for not-yet-migrated screens.

Reviewed changes

Copilot reviewed 19 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
efile_app/efile/workflow.py Adds stage labels and stage-progress context for the new progress UI; updates stage assignment for extraction review.
efile_app/efile/views/upload_documents.py Implements consolidated multi-PDF upload, lead/supporting handling, and extraction guess generation.
efile_app/efile/views/legacy_workflow.py Adds temporary redirect bridge to force drafts into legacy flow for unmigrated screens.
efile_app/efile/views/filing_path.py Adds the new v2 entry screen to select filing path and persist normalized branch state.
efile_app/efile/views/extraction_review.py Adds extraction review screen that confirms extracted fields and branches to next step.
efile_app/efile/views/draft_views.py Creates v2 drafts starting at Filing Path and redirects accordingly.
efile_app/efile/urls.py Wires new v2 endpoints and legacy bridge routes.
efile_app/efile/tests/test_reorganized_start.py Adds coverage for new start/upload/extraction/legacy-bridge behavior.
efile_app/efile/tests/test_durable_drafts.py Updates durable draft creation expectations for v2 workflow start.
efile_app/efile/templates/efile/workflow_base.html Introduces a shared base layout for reorganized workflow screens.
efile_app/efile/templates/efile/upload_documents.html Adds the consolidated upload UI and document list.
efile_app/efile/templates/efile/options.html Updates the new-draft redirect fallback to the filing path route.
efile_app/efile/templates/efile/filing_path.html Adds the new “What are you trying to do?” start screen UI.
efile_app/efile/templates/efile/extraction_review.html Adds the “Here’s what we found” extraction review UI.
efile_app/efile/templates/efile/components/workflow_progress.html Adds the new eight-stage progress component.
efile_app/efile/static/js/upload-documents.js Adds client-side upload/remove behavior and in-page upload state handling.
efile_app/efile/static/css/reorganized-flow.css Adds styling for the new workflow shell, cards, progress UI, and new screens.
efile_app/efile/services/drafts.py Allows creating drafts with an explicit workflow_version.
efile_app/efile/services/current_drafts.py Plumbs workflow_version through draft creation and ensures it can be enforced/updated.
Suppressed comments (1)

efile_app/efile/static/js/upload-documents.js:86

  • The remove-document handler also unconditionally parses response.json(); if the request redirects (e.g., auth timeout) it will throw. Add a redirected check similar to the upload handler.
            const response = await fetch(window.location.href, {
                method: "POST",
                body
            });
            const result = await response.json();
            if (response.ok && result.success) window.location.reload();
            else window.alert(result.error || "Could not remove the document.");

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +116 to +128
promote_document = None
other_documents = FilingDocument.objects.filter(draft=draft).exclude(pk=document.pk)
if document.role == FilingDocument.Role.LEAD and other_documents.exists():
replacement = other_documents.order_by("sort_order", "created_at").first()
assert replacement is not None
promote_document = replacement.pk
document.delete()
if promote_document is not None:
replacement = FilingDocument.objects.get(pk=promote_document)
replacement.role = FilingDocument.Role.LEAD
replacement.sort_order = 0
replacement.save(update_fields=["role", "sort_order", "updated_at"])
return JsonResponse({"success": True})
Comment on lines +38 to +52
write_case_data(
draft,
{
"existing_case": existing_case,
"court_name": request.POST.get("court_name", ""),
"case_category_name": request.POST.get("case_category_name", ""),
"case_type_name": request.POST.get("case_type_name", ""),
"docket_number": request.POST.get("docket_number", ""),
},
current_step=WorkflowStepKey.EXTRACTION_REVIEW,
)
next_step = get_next_step(WorkflowStepKey.EXTRACTION_REVIEW, draft)
if next_step:
return redirect(get_step_url(next_step.key, jurisdiction))

Comment thread efile_app/efile/static/js/upload-documents.js
@nonprofittechy
nonprofittechy marked this pull request as ready for review August 10, 2026 22:46
@nonprofittechy
nonprofittechy force-pushed the workflow/filing-path-upload branch from df3bba5 to 8d9a1c3 Compare August 10, 2026 22: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.

2 participants