Skip to content

Add photo upload UI to community fridge form - #533

Closed
neal-bpm wants to merge 5 commits into
vn/community-fridge-ui-v1from
vn/community-fridge-photo-upload-v1
Closed

neal-bpm wants to merge 5 commits into
vn/community-fridge-ui-v1from
vn/community-fridge-photo-upload-v1

Conversation

@neal-bpm

@neal-bpm neal-bpm commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes

Replaces the plain "Photo URL" text input in the community fridge form with a proper drag-and-drop file upload widget. The widget is built on Phoenix LiveView's native file upload primitives and persists files via MediaStorage. It handles new uploads, preserves existing photos through re-submits, supports cancellation of pending entries before save, and validates file type and size client-side.

  • mount/1 registers a single-file upload slot (:photo, gif/png/jpg/jpeg and size of 10MB)
  • Save handler calls consume_uploaded_entries → MediaStorage.upload_file! and injects the returned URL into params; falls through unchanged when no file is selected so the hidden input preserves the existing photo
  • cancel_upload event removes a pending entry before save
  • Template shows existing photo preview (with hidden input to preserve it through form submits), drag-and-drop zone with live_file_input, pending entry preview via live_img_preview, and per-entry error display

Tests cover: existing photo renders in edit form, dropzone markup is present, pending upload preview appears after file selection, and cancel removes the preview.

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added tests.
  • Are there other PRs or Issues that I should link to here?
  • Will this be part of a product update? If yes, please write one phrase
    about this update in the description above.

  Replaces the plain "Photo URL" text input with a drag-and-drop upload widget backed by LiveView's file upload primitives and MediaStorage.

  - mount/1 registers a single-file upload slot (:photo, gif/png/jpg/jpeg)
  - Save handler calls consume_uploaded_entries → MediaStorage.upload_file! and injects the returned URL into params; falls through unchanged when no file is selected so the hidden input preserves the existing photo
  - cancel_upload event removes a pending entry before save
  - Template shows existing photo preview (with hidden input to preserve it through form submits), drag-and-drop zone with live_file_input, pending entry preview via live_img_preview, and per-entry error display

  Tests cover: existing photo renders in edit form, dropzone markup is present, pending upload preview appears after file selection, and cancel removes the preview.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: bikebrigade/dispatch/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de298f9f-557e-4320-97f3-87a76550296d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@neal-bpm
neal-bpm marked this pull request as ready for review October 8, 2026 04:17
@neal-bpm

neal-bpm commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #540. Work consolidated into vn/community-fridge-feature for unified review.

@neal-bpm neal-bpm closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant