Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forms for managing tags #809

Merged
merged 29 commits into from May 4, 2024

Conversation

MisterPhilip
Copy link
Contributor

@MisterPhilip MisterPhilip commented Apr 20, 2024

Closes #460, adding support for a UI for managing tags.

Goals for this PR:

  • List all tags
    • Show a listing of all the tags currently created.
    • Preview the tag color
    • See the number of items that are tagged with the tag
  • Form to add or update tags
    • Show a form to add a new tag or an update existing tag. Separate from the existing widget.
    • Add a preview tag feature in the form that automatically updates when the color is updated
    • Show a list of number of items tagged for each item type, linking to the item list with a tag filter automatically applied
  • Delete existing tags
    • Default item confirmation screen
    • Add warning copy when the tag is in use anywhere
  • List all tagged items for a given tag
    • Show all items (TBD if in a single view or in separate tables) that are tagged with this tag

Added a new menu item:
image

The tag list view, with preview of the color:
image

The tag detail view, with links to the measurements & activities, pre-filtered to the current filter
image

The tag edit form with default browser color editor:
image

The tag deletion confirmation warning:
image

Other notes - I might be one of the few developing on Windows. I had a few issues with the build scripts and getting the correct line endings to show. What is committed is a much smaller amount than what was coming out prior to editing the build scripts/configs. I have these changes locally but might be worth discussing if they should be merged in (separately) to the repo. Also, I'm not as familiar with Django/Python, so definitely happy to hear any feedback you may have. I figured this would be a good first PR that had some substance 😄

@cdubz
Copy link
Member

cdubz commented Apr 20, 2024

Thanks for working on this! I’m traveling this weekend but will take a look next week. Curious to see what you found developing from Windows. Baby Buddy has a pretty outdated dev env and build system. I’ve been very slowly trying to bring it up to date but it’s still relying on some long abandoned tooling hah.

@MisterPhilip
Copy link
Contributor Author

Yeah, I'm still tweaking and jotting down notes. I'll eventually split this out into it's own conversation, but for reference with this PR, I've had to:

  • Update _runCommand to spawn as a shell (which should be fine here _runCommand never accepts user args)
  • Update .prettierrc to force set line endings.
    This might have been my editor config, but this helped force the correct setting. You'll note the CI errors are lint based, I suspect only because the default settings vs. my local are still off.

Anyways, I suspect this will be ready for final review sometime next week. The core features are all there, just aiming to complete the stretch goals.

@cdubz - I could use your feedback on the last stretch goal (" Show all items (TBD if in a single view or in separate tables) that are tagged with this tag"). My idea here is to show everything that is tagged with a given tag. An example where this could be useful is we tag our measurements with "home measurement" or "office measurement", depending on if the measurement was taken at home or the doctor's office. Being able to see all measurements for "office measurement" would give us a quick overview into his official vitals. From the UX side though, I'm not sure if there is a good way to unify everything in a single table. Measurements could probably be rolled into a single table, but then the activities have too many different attributes that might need to be displayed in a single table. We could show a table for all measurements and one for each activity too, but I'm not sure how much easier that would be to parse from the user's perspective. Maybe this would be more useful just as a separate feature with a measurements overview page that could filter down instead of doing it via a tag detail view?

Anyways, this would be the desired output for a given tag:

+-----------+--------+--------+------------------+
| Item Type | Child  | Amount |       Date       |
+-----------+--------+--------+------------------+
| Height    | Jane   |     76 | April 23, 2024   |
| Height    | Joe    |     68 | April 23, 2024   |
| Weight    | Joe    |    8.1 | April 22, 2024   |
| Weight    | Joe    |      8 | April 1, 2024    |
| Height    | Joe    |     64 | December 5, 2023 |
+-----------+--------+--------+------------------+

@cdubz
Copy link
Member

cdubz commented Apr 24, 2024

I could use your feedback on the last stretch goal (" Show all items (TBD if in a single view or in separate tables) that are tagged with this tag"). My idea here is to show everything that is tagged with a given tag. An example where this could be useful is we tag our measurements with "home measurement" or "office measurement", depending on if the measurement was taken at home or the doctor's office. Being able to see all measurements for "office measurement" would give us a quick overview into his official vitals. From the UX side though, I'm not sure if there is a good way to unify everything in a single table. Measurements could probably be rolled into a single table, but then the activities have too many different attributes that might need to be displayed in a single table. We could show a table for all measurements and one for each activity too, but I'm not sure how much easier that would be to parse from the user's perspective. Maybe this would be more useful just as a separate feature with a measurements overview page that could filter down instead of doing it via a tag detail view?

Yeah the UI here would be pretty challenging. I think we'd have to show a very limited amount of information about each tag thing and link off to the main entry for more detail. Maybe the timeline page can offer some basic insight? I don't think we would necessarily want to use that format but it does deal with presenting information about all the separate models together.

@cdubz
Copy link
Member

cdubz commented May 3, 2024

@MisterPhilip is this one ready for review yet? We still have it marked draft but I'm happy to start taking a closer look when you're ready.

simwir and others added 2 commits May 3, 2024 05:57
Changes the empty filler in the sleep pattern report to instead be awake
time. Add labels to this awake time so it is possible to see for how
long the baby was awake between sleeps.
@MisterPhilip
Copy link
Contributor Author

@cdubz - Sorry, was pulled onto a different project recently. I have one more test to fix and then I should be set. I think I'll be able to wrap it up this weekend.

@MisterPhilip MisterPhilip marked this pull request as ready for review May 3, 2024 23:45
@MisterPhilip
Copy link
Contributor Author

@cdubz all yours for review!

@coveralls
Copy link

Coverage Status

coverage: 98.652% (+0.02%) from 98.636%
when pulling 63dd463 on MisterPhilip:460_manage_tags_form
into 712779b on babybuddy:master.

Copy link
Member

@cdubz cdubz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MisterPhilip thanks so much for your work here -- this is awesome! Let me see if I can get the rebase conflicts resolved...

@cdubz cdubz added the enhancement Feature requests or improvements to existing functionality label May 4, 2024
@cdubz cdubz added this to the 2.4.0 milestone May 4, 2024
@cdubz cdubz merged commit 31c6f5b into babybuddy:master May 4, 2024
8 checks passed
@MisterPhilip
Copy link
Contributor Author

Yeah, sorry about that! I had rebased, but I think had selected mine fork instead of the main babybuddy as the origin.

@MisterPhilip MisterPhilip deleted the 460_manage_tags_form branch May 4, 2024 02:06
@cdubz
Copy link
Member

cdubz commented May 4, 2024

Yeah no worries I just squashed it 😁

@MrApplejuice
Copy link
Contributor

Looks lovely @MisterPhilip !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add form for managing tags
6 participants