lemeryfertitta / Climbdex

Search engine for training board climbs
https://climbdex.com
MIT License
42 stars 10 forks source link

Show personal climb history/stats below climb #55

Open gardaholm opened 6 months ago

gardaholm commented 6 months ago

If logged in, it would be nice to show the personal history of this climb below the drawing. For example: No. of Attempts / No. of Sends or a detailed view. Maybe also including the dates. This would make projecting sessions more helpful. Right now we don't have any idea how often we tried a boulder or how long we are projecting it.

for example 02.10.23: 4 Attempts 10.10.23: 4 Attempts 05.01.24: 3 Attempts 01.02.24: Send

At the moment I think only sends (+ attempts) are available via the personal logbook?

lemeryfertitta commented 6 months ago

You can log non-send attempts on the aurora apps. I personally haven't used the feature, so I don't know exactly where its displayed (logbook, climb info), but it should be there somewhere, based on the "bids" table and some of the API calls I've looked at.

I like the idea of having those details accessible from the climb. Perhaps an icon similar to the checkmark and/or a different background color in the climb list would be nice for indicating climbs that have been attempted but not sent.

gardaholm commented 6 months ago

we use the attempts for harder projects, but weren't really able to use this data in the aurora apps, because it's hardly available, you only see it in the Logbook, but the data there is pretty useless imo due to the lack of filters. I think the infos about attempts make sense on the projects/climbs itself.

I played with boardlib and the logbook a bit the last days but couldn't make sense about the bids + ascents. there seems to be an attempt table, but haven't really come that far yet :)

gardaholm commented 5 months ago

Some ideas to add this information into the UI

image
lemeryfertitta commented 5 months ago

Nice! I like the coloring ideas, maybe preferring yellow to indicate attempted instead of a red. I also like having something on the page to indicate login status and allow for logging out. While it seems useful to show attempts so far, the image above looks messy and I'm worried that when combined with a description its taking a huge amount of space and the board image is getting very small.

Maybe with the arrows removed, we'd just have the info icon up top (total of 3 - bluetooth, beta, and info), and the info page can do all of the heavy lifting to show attempts and such. Not sure attempts need to be shown directly on the climb page, especially if the info page is relatively quick and easy to display. The info page could be a modal to avoid having to navigate back and forth.

gardaholm commented 5 months ago

Maybe with the arrows removed, we'd just have the info icon up top (total of 3 - bluetooth, beta, and info), and the info page can do all of the heavy lifting to show attempts and such. Not sure attempts need to be shown directly on the climb page, especially if the info page is relatively quick and easy to display. The info page could be a modal to avoid having to navigate back and forth.

I guess a modal should also be fine, to keep the main page tidy

gardaholm commented 2 months ago

I just saw the PR 38 on boardlib (https://github.com/lemeryfertitta/BoardLib/pull/38) about the more detailed logbook. I guess if this version is deployed to climbdex, we should be able to mark the attempts in the list as well?

This would be such a great addition!

lemeryfertitta commented 2 months ago

Yes, that PR could be used for reading the bids info to display the number of attempts on a given climb.

https://github.com/lemeryfertitta/BoardLib/pull/26/files has been released for a while, which could be used for ticking climbs and including the number of attempts (bid_count, I believe).

Both would need some UI work.

gardaholm commented 1 month ago

I've got the attempts running on my branch right now and changed colors to yellow and green. I find this already really useful!

Also added a menu item in the right corner, if a cookie is set with the button to logout. Couldn't really figure out how to query the username and/or query the profile-image from the api. But maybe it's not really needed, I guess nobody is using multiple logins …

Also trying to query the attempt-stats from the logbook (# of sessions and # of tries) and put it into a modal on the climb-detail page. But couldn't figure it out yet.

image
lemeryfertitta commented 1 month ago

Nice! The attempts look good!

Also trying to query the attempt-stats from the logbook (# of sessions and # of tries) and put it into a modal on the climb-detail page. But couldn't figure it out yet.

Which part is giving you trouble? Happy to help if I can. Looks like the latest boardlib updates included those stats. Seems like # sessions is being calculated by the number of unique dates and the number of tries by the sum of the number of tries in each session: https://github.com/lemeryfertitta/BoardLib/pull/38/files#diff-7bb2bc18c99f942deac4c1182a591a5347f089c4631cd3d48d7e736a1cfda350R529-R541

gardaholm commented 1 month ago

Thanks. I tried it a few different ways now, but somehow I either can't access the data or the numbers are not the same as in the manual csv export.

I tried to fetch the bids in a similar way like the ticked climbs and add it with uuid-angle key. From get_bids_logbook() I fetched the bid_counts and splitted it to have one for is_mirror true/false. See this snipped here:
https://github.com/gardaholm/Climbdex/blob/d7a1b922bbf866f772b137674d57d81a73cd4475/climbdex/views.py#L148C1-L171C28

This seems to work. I can get the bid_count from get get_bids_logbook() but I cant fetch sessions_count or tries_total.

image

but compared to the manual csv export via boardlib logbook the numbers don't add up. for "girl on fire" it should probably be 2 tries each.

image

So therefor I guess the bids are not what we need here? Or I try do it in a totally wrong way :)

lemeryfertitta commented 1 month ago

If I'm understanding correctly, you're just looking at the raw bids data. In the linked code from my previous comment, you can see that there is some post-processing that has been done to get the CSV export in that format.

Maybe using logbook_entries (link) would give you what you are looking for?

gardaholm commented 1 month ago

was finally able to merge the data together. Problem was that there was no identifier and each climb could have multiple entries in logbook_entries(). Therefor I would suggest adding climb_uuid into the logbook_entries. Commented the parts here

Added the session-info below as Description just for testing, but works fine. Need to figure solution for the menu, as you've suggested in #46

image