Skip to content

Add researcher-friendly error messages for zip upload#26

Open
leotrs wants to merge 1 commit intomainfrom
prs-twr.5
Open

Add researcher-friendly error messages for zip upload#26
leotrs wants to merge 1 commit intomainfrom
prs-twr.5

Conversation

@leotrs
Copy link
Copy Markdown
Contributor

@leotrs leotrs commented Mar 26, 2026

Summary

  • Add app/upload/zip_errors.py with translate_zip_errors() that maps every ZipValidator failure to plain-language messages researchers can understand and act on
  • Group related errors (e.g. 3 forbidden file types become one message listing all 3) so users can fix everything in one pass
  • Add non-blocking warnings for skipped files (macOS metadata), large images (>10MB), and high file counts (>200)
  • Add ZipUploadResult dataclass with HTML formatting methods for errors and warnings
  • Add warning display support to upload form template with amber/yellow styling
  • Strip all technical jargon (no "symlink", "MIME type", "path traversal", "compression ratio", etc.)

Test plan

  • 33 unit tests covering all error categories, grouping, warnings, HTML escaping, and jargon-free verification
  • End-to-end tests that run ZipValidator then translate, verifying final messages
  • Pre-existing test suite passes (3 pre-existing failures unrelated to this change)
  • CI validates full suite

🤖 Generated with Claude Code

Translate technical ZipValidator errors into plain language that
non-developer researchers can understand and act on. Groups related
errors (e.g. multiple forbidden files), strips jargon (no "symlink",
"MIME type", "path traversal"), and adds non-blocking warnings for
skipped files, large images, and high file counts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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