Commit Graph

14 Commits (4ac24aa8cc0744904e2721c7036e42d7bcc766be)

Author SHA1 Message Date
Dustin 4ac24aa8cc 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:28:38 -06:00
Dustin bf844224b5 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 b5dff8eaf7 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 9fe1eb2c0d ui: Fix date field on xact form
Accidentally left a hard-coded development value here.
2025-03-08 20:14:54 -06:00
Dustin 21b10c4ec1 backend: Attach photo to Journal ID
Firefly attachments are related to transaction journal entries rather
than the transactions themselves.  In other words, they're attached to
splits.
2025-03-08 20:13:10 -06:00
Dustin ff043631fa ui: Move camera action buttons below image viewer
On mobile, the screen is too narrow to put the action buttons to the
right of the image viewer.
2025-03-08 20:12:20 -06:00
Dustin 1f8584e164 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 ab4b443a2d Fix path to static resources
In production deployments, the static assets are stored in
`/usr/local/share/receipts/static`.  The working directory is
`/usr/local/share/receipts`, so using a relative path of `static` is
sufficient.  We can use the same path in development with a symlink
pointing to the `esbuild` output directory.
2025-03-08 20:09:13 -06:00
Dustin 62e040836a Attach receipts to Firefly transactions
And now we come to the meat of the thing: the ability to update
transactions and attach receipts.  Most of this is straightforward,
except for changing the amount of split transactions.  Hopefully, this
won't come up too often, since I can't really split transactions without
a receipt.  Just to be on the safe side, attempting to change the amount
of a split transaction will return an error.
2025-03-08 20:08:14 -06:00
Dustin 5169758c23 Fetch transactions from Firefly III
This is all pretty straightforward.  The only real problem is that
the search results only contain matching transactions *splits*.  Since
transactions themselves do not have an amount, the value shown in the
_Amount_ column on the transaction list may be incorrect if a
transaction contains multiple splits and some of them do not match the
search query.
2025-03-08 16:01:08 -06:00
Dustin ec2e477fcd Implement basic page navigation w/ mock data
Obviously, we'll replace the mock `Database` with a Firefly III API
client, but this is here for now to support the UI interactions.
2025-03-08 11:16:35 -06:00
Dustin 7c6e993c1b fixup! Initial commit 2025-03-08 11:16:13 -06:00
Dustin 660a882971 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
Dustin 63ced69e31 Initial commit 2025-03-05 18:02:52 -06:00