Commit Graph

65 Commits

Author SHA1 Message Date
Savanni D'Gerinel 0032f16422 Resolve the duplicate widget insertion warning 2024-02-19 18:04:45 -05:00
Savanni D'Gerinel a5d51dab70 Hugely improve the historical view formatting 2024-02-19 17:56:48 -05:00
Savanni D'Gerinel c24a5f515f Set up CSS styles around the date range picker 2024-02-19 17:27:02 -05:00
Savanni D'Gerinel d70ca08db2 Correctly set the date range picker when initializing the historical view 2024-02-19 16:47:10 -05:00
Savanni D'Gerinel 86d7ca0b01 Change TextEntry to a builder pattern 2024-02-18 22:19:39 +00:00
Savanni D'Gerinel d137ee2481 Apply clippy 2024-02-18 22:19:39 +00:00
Savanni D'Gerinel 74dbb58ed9 Extract the date range picker and enable the quick picker 2024-02-18 22:19:39 +00:00
Savanni D'Gerinel 9a18496c95 Apply the value of a date field to the historical view
Date fields can now be updated and their values retrieved. So now I have added a button that retrieves the range of the date field and updates the historical view in response to them.
2024-02-18 22:19:39 +00:00
Savanni D'Gerinel 01776a534e Start setting up date range widgets 2024-02-18 22:19:39 +00:00
Savanni D'Gerinel b33d17c256 Start building an internally editable date field 2024-02-18 22:19:39 +00:00
Savanni D'Gerinel 6e5cbc0930 Ensure there is a button for every workout type 2024-02-09 22:40:29 -05:00
Savanni D'Gerinel 73a5ab89a3 Rename BikeRide to Biking
This just generally feels more comfortable, especially when put in conjuction with the other activity types
2024-02-09 08:24:01 -05:00
Savanni D'Gerinel 291dc32fe5 Show summaries of all time-distance workouts 2024-02-09 08:22:12 -05:00
Savanni D'Gerinel b5c42e3ac3 Add the activity type selector to the time-distance widget 2024-02-09 08:17:10 -05:00
Savanni D'Gerinel 38b1e62b60 Add the ability to edit the time on a time_distance record 2024-02-08 21:58:22 -05:00
Savanni D'Gerinel 4acf034b8d Clean up warnings and remove printlns 2024-02-08 19:01:56 -05:00
Savanni D'Gerinel 1aff203afc Reload data when the user saves on the DayEdit panel
This required some big overhauls. The view model no longer takes records. It only takes the date that it is responsible for, and it will ask the database for records pertaining to that date. This means that once the view model has saved all of its records, it can simply reload those records from the database. This has the effect that as soon as the user moves from DayEdit back to DayDetail, all of the interesting information has been repopulated.
2024-02-08 19:01:56 -05:00
Savanni D'Gerinel 9fc9d2b758 Create Duration and Distance structures to handle rendering
These structures handle parsing and rendering of a Duration and a Distance, allowing that knowledge to be centralized and reused. Then I'm using those structures in a variety of places in order to ensure that the information gets rendered consistently.
2024-02-08 10:30:14 -05:00
Savanni D'Gerinel 76f4b31466 Show existing time/distance workout rows in day detail and editor 2024-02-08 10:23:47 -05:00
Savanni D'Gerinel 73052a0694 Save new time/distance records
This sets up a bunch of callbacks. We're starting to get into Callback Hell, where there are things that need knowledge that I really don't want them to have.

However, edit fields for TimeDistanceEdit now propogate data back into the view model, which is then able to save the results.
2024-02-08 10:20:57 -05:00
Savanni D'Gerinel 2c42c35dfe Build the facilities to add a new time/distance workout
This adds the code to show the new records in the UI, plus it adds them to the view model. Some of the representation changed in order to facilitate linking UI elements to particular records. There are now some buttons to create workouts of various types, clicking on a button adds a new row to the UI, and it also adds a new record to the view model. Saving the view model writes the records to the database.
2024-02-08 09:44:58 -05:00
Savanni D'Gerinel af1422d523 Build some convenienc functions for measurement entry fields
Move the weight field into text_entry
2024-02-08 09:18:55 -05:00
Savanni D'Gerinel 792e20d44b Add buttons with icons to represent workouts 2024-02-08 09:13:54 -05:00
Savanni D'Gerinel 74df2880bb Implement the Edit Cancel button 2024-02-08 09:13:54 -05:00
Savanni D'Gerinel 96c4201680 Render time distance details in the day detail view 2024-02-08 09:02:09 -05:00
Savanni D'Gerinel ecdd38ebbc Show a summary of the day's biking stats when there is one 2024-02-08 08:57:17 -05:00
Savanni D'Gerinel 2fb8728856 Invert the TraxRecord
This simplifies, though not as much as I was hoping, the patterns for accessing data along strict type patterns. I may see better results once I'm getting the Time/Distance views working.
2024-02-08 00:20:40 -05:00
Savanni D'Gerinel 9727d35116 Resolve clippy warnings
Warnings were mounting up. It was time to resolve them before attempting a massive rebase.
2024-02-07 23:36:03 -05:00
Savanni D'Gerinel 3db870d790 Set up time distance operations and tests 2024-02-03 15:28:33 -05:00
Savanni D'Gerinel 304008c674 The view model can no longer be initialized without an app 2024-01-31 09:51:17 -05:00
Savanni D'Gerinel 772188b470 Set up text entry fields for all of the common metrics 2024-01-31 08:56:54 -05:00
Savanni D'Gerinel bc31522c95 Add the on_update callback to TextEntry, and test the component 2024-01-31 08:44:46 -05:00
Savanni D'Gerinel 55c1a6372f Rename the formatters 2024-01-31 08:38:17 -05:00
Savanni D'Gerinel 69567db486 Introduce a structure for formatting and parsing Weight values 2024-01-30 10:08:10 -05:00
Savanni D'Gerinel 7ec48ded5d Make the day summary use the view model 2024-01-20 17:04:20 -05:00
Savanni D'Gerinel 9461c387fe Simplify the weight editor 2024-01-20 16:05:33 -05:00
Savanni D'Gerinel d4c48c4443 Add a step count editor field 2024-01-20 15:59:03 -05:00
Savanni D'Gerinel 9bedb7a76c Tons of linting and get tests running again 2024-01-20 15:04:46 -05:00
Savanni D'Gerinel 1fe318068b Set up a view model for the day detail view 2024-01-20 11:16:31 -05:00
Savanni D'Gerinel 18e7e4fe2f Start setting up the day detail view model
I've created the view model and added a getter function for the weight.
I'm passing the view model now to the DayDetailView, DayDetail, and
DayEdit.

I'm starting to set up the Save function for the view model, draining
all of the updated records and saving them.

None of the components yet save any updates to the view model, so
updated_records is always going to be empty until I figure that out.
2024-01-18 09:00:08 -05:00
Savanni D'Gerinel 1c2c4982a1 Update the record in the detail view on save 2024-01-18 07:43:18 -05:00
Savanni D'Gerinel c075b7ed6e Just barely get the data saveable again
Starting to see some pretty serious limitations already.
2024-01-17 22:59:20 -05:00
Savanni D'Gerinel 56d0a53666 Fix how DayEdit deals with the weight field 2024-01-17 22:35:13 -05:00
Savanni D'Gerinel b00acc64a3 Set up the ActionGroup component 2024-01-17 22:13:55 -05:00
Savanni D'Gerinel 104760c754 Be able to switch into edit mode 2024-01-15 23:27:55 -05:00
Savanni D'Gerinel 1e6555ef61 Create a day detail view
DayDetail, the component, I used to use as a view. Now I'm swapping
things out so that DayDetailView handles the view itself. The DayDetail
component will still show the details of the day, but I'll create a
DayEditComponent which is dedicated to showing the edit interface for
everything in a day.

The swapping will now happen in DayDetailView, not in DayDetail or an
even deeper component.
2024-01-15 15:53:01 -05:00
Savanni D'Gerinel 2e2ff6b47e Create a Singleton component and use it to simplify the weight view 2024-01-15 13:20:23 -05:00
Savanni D'Gerinel 0007522b26 Extract the Weight and Time Distance widgets 2024-01-01 23:58:55 -05:00
Savanni D'Gerinel b7b9b1b29f Create an EditView "component"
This is a super tiny data structure that covers an edit mode, a view
mode, and an unconfigured mode. It's mostly a container so that views
don't have to preserve everything directly.
2024-01-01 23:49:31 -05:00
Savanni D'Gerinel 2e3d5fc5a4 Clean up the parameters to TextEntry and populate the field 2024-01-01 22:57:59 -05:00