Skip to content

Add Import Plan button and upload page#550

Open
neoneye wants to merge 10 commits intomainfrom
feat/plan-import
Open

Add Import Plan button and upload page#550
neoneye wants to merge 10 commits intomainfrom
feat/plan-import

Conversation

@neoneye
Copy link
Copy Markdown
Member

@neoneye neoneye commented Apr 10, 2026

Summary

  • Add "Import Plan" button to the top-right of the /plan list page
  • New /plan/import page with zip file upload form
  • Upload is accepted and validated (.zip only) but not yet processed (placeholder)

Test plan

  • "Import Plan" button visible on /plan page
  • Clicking it navigates to /plan/import
  • Upload form accepts .zip files
  • Error shown for non-.zip files or empty selection
  • Success message shown after upload
  • Actual zip processing (next PR)

🤖 Generated with Claude Code

neoneye and others added 10 commits April 10, 2026 17:32
Adds "Import Plan" button to /plan list page (top-right corner).
Links to /plan/import with a zip file upload form. The uploaded
file is accepted but not yet processed (placeholder for next step).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add import_pending state to PlanState enum
- Upload stores zip in run_zip_snapshot, creates PlanItem, redirects to plan view
- 50 MB upload limit
- Purple status chip for import_pending in plan list

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Python enum change alone isn't enough — PostgreSQL has its own
enum type that needs ALTER TYPE ADD VALUE. Added to both
frontend_multi_user and worker_plan_database startup migrations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop zone covers the main area. Click to browse or drag a .zip file.
Upload button appears after file is selected. Page-level dragover
prevented so the browser doesn't navigate away on accidental drops.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gunicorn worker was timing out (60s) during zip upload + DB insert.
Bumped to 120s. Also added try/except around the DB commit so import
errors show a user-visible message instead of crashing the worker.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Verify zip is valid (rejects corrupt/non-zip files)
- Remove ExtraFilenameEnum files (log.txt, track_activity.jsonl, etc.)
- Verify all remaining files match FilenameEnum (including templates)
- Reject zips with unrecognized files
- Store the cleaned zip in run_zip_snapshot

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
macOS resource forks (._*) and other non-PlanExe files are silently
dropped. Only FilenameEnum files are kept. Rejects only if zero
recognized files remain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Eliminates "Confirm Form Resubmission" on page reload. The upload
is now a JS fetch() to /plan/import/upload (JSON API), and the
page navigates via window.location on success.

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