Commit Graph

6 Commits (da9d336817fbdfb0b1649d9ed46be928f0e04384)

Author SHA1 Message Date
Dustin 15227125b9 ui: Request higher video resolution from camera
Apparently, you get 640x480 unless you ask for more?  Need to constrain
the viewer size, though, otherwise it massively overflows the page and
makes it impossible to see what you're taking a picture of.
2025-03-08 20:41:40 -06:00
Dustin 3b586413ff ui: Remove photo cropper element
It turns out the cropper is _way_ too hard to use on mobile.  The
cropper handles are much too small for a touch screen.  Maybe I can
figure out how to improve the UX eventually, but for now, Tabitha
requested that we remove that functionality.
2025-03-08 20:20:29 -06:00
Dustin 9cef220f90 ui: Persist success notification, redirect to list
Tabitha requested that the application returns to the transaction list
after the form was submitted successfully.  Before the navigation
starts, we still want to see the info toast, though.  Since the
navigation may take a few seconds, we keep the toast open indefinitely.
2025-03-08 20:18:37 -06:00
Dustin 69b511613f ui: Disable submit button while cropping
It's not immediately clear that submitting the form while the cropper is
active will not include the image _at all_.  To make this evident, we
disable the submit button until the crop is complete.
2025-03-08 20:15:41 -06:00
Dustin 2d7ff417fc ui: Select environment camera if possible
Apparently, Firefox/Android defaults to using the front camera, and
does not provide any native UI for selecting a different one.  We can
request the back camera by indiciting that the "environment" camera is
"ideal."
2025-03-08 20:10:50 -06:00
Dustin 837caecc3a js: Initial UI implementation
I've implemented the UI using TypeScript and Shoelace.  I originally
started with Pico CSS, but I didn't really like its visuals.  Since
capturing photos using the camera requires JavaScript, and that's
basically the entire point of this application, Shoelace's JavaScript
dependency (for WebComponents), is acceptable.

The photo capture uses the Media Capture Web API, which exposes the
camera directly as a video stream.  We capture a frame from this stream
and save it in a canvas, which we then pass to Cropper.js to let the
user select only the relevant portion of the picture containing the
receipt itself.
2025-03-08 11:11:42 -06:00