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

Rework SessionsPlayerButton and clean up Sessions UI #5745

Merged
merged 13 commits into from
Aug 26, 2021

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Aug 25, 2021

Changes

This is a prerequisite for #5664 that reworks SessionsPlayerButton into something that will also be useful in the persons modal. Based on a design by @clarkus (#5664 (comment)), though a bit more lightweight than there at the moment – can always adjust any styles.
Also cleaned up nearby Sessions UI.

Before After
Zrzut ekranu 2021-08-25 o 20 20 29 Zrzut ekranu 2021-08-25 o 20 24 15

@timgl timgl temporarily deployed to posthog-pr-5745 August 25, 2021 18:29 Inactive
@Twixes Twixes temporarily deployed to posthog-pr-5745 August 25, 2021 18:32 Inactive
Copy link
Contributor

@clarkus clarkus left a comment

Choose a reason for hiding this comment

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

This change looks good to me. I missed this in the earlier design, but I wonder if the color is enough to communicate previously watched recordings. We could include a tooltip on hover that clarifies the meaning of each icon state.
Screen Shot 2021-08-25 at 11 48 16 AM

@Twixes Twixes temporarily deployed to posthog-pr-5745 August 25, 2021 19:21 Inactive
@@ -82,7 +84,7 @@ export function Popup({
{visible
? ReactDOM.createPortal(
<div
className="popper-tooltip"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: There's a handy library called clsx that can make this shorter.

className={clsx('popper-tooltip', className)}

Copy link
Member Author

Choose a reason for hiding this comment

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

That's great, thanks

frontend/src/scenes/sessions/SessionRecordingsButton.tsx Outdated Show resolved Hide resolved
for session_recording_package in session_recording_results:
for session_recording in session_recording_package:
del session_recording["start_time"]
del session_recording["end_time"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth it to use a new snapshot so that expected reflects these new parameters?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's kind of bit menial to add them (it's not really a snapshot, just values in self.assert* calls) due to quirks in datetime comparisons (I had some problems with tzinfo when I tried to do this before going for del) and I don't think this is important to getting this in, so I'll leave this with just a TODO for now.

@alexkim205
Copy link
Contributor

Nice! lgtm overall but left some feedback inline and below.

Are these two durations supposed to be the same? It's confusing that 1min is rounded up from 18s in this case.

Screen Shot 2021-08-25 at 2 21 32 PM

@macobo
Copy link
Contributor

macobo commented Aug 26, 2021

Q: In an ideal world most sessions would not have a dropdown. Do we show one even for those (as indicated by the screenshot?) If so - why? IMO This makes the "majority" case of navigation much slower - you expect most sessions (especially in modals) to have one recording only.

Also this kills a feature - being able to distinguish whether a user has seen a recording or not. This is something that's quite vital for session recordings - you don't want to watch one twice.

As-is this change would make my usage of session recordings more painful.

Note also #4884 - this quirk is something I think is temporary and we'll hopefully do away with soon.

cc @clarkus

Base automatically changed from persons-modal-refactor to master August 26, 2021 11:44
@Twixes Twixes temporarily deployed to posthog-pr-5745 August 26, 2021 15:00 Inactive
@Twixes
Copy link
Member Author

Twixes commented Aug 26, 2021

@alexkim205 Thanks for the review. As for durations, yes, they should definitely be different, as a PostHog session is detached from a session recording, that is a single session can have multiple session recordings, a single one, or none. So it's calculated separately based on PostHog events.

@macobo I see what you mean. I added a play icon to the button too, which is blue if there's an unwatched recording under it, and gray if all have already been watched. This should improve scannability.

Initially I wanted to make it play without a dropdown in case of a single recording, but I ran into a weird UX mismatch, where you'd be able to see the details of recordings when there were multiple of them (thanks to the dropdown), but you'd be clicking blindly in case of a single recording – no place to show the timestamp.
Alternatively I tried showing the dropdown on hover instead of on click, but that was super tricky with the way the popper component uses a ref + would potentially be annoying when moving the cursor over the column.
Hence I went for the dropdown-on-click-always approach.
Happy to hear what you think about this and iterate though (best in a later PR though). @clarkus @macobo

Updated button:
Zrzut ekranu 2021-08-26 o 17 21 02

@clarkus
Copy link
Contributor

clarkus commented Aug 26, 2021

@macobo I think we can maintain the watched / unwatched treatment given my previous comment. It's essentially how it works now with different color coding and additional tooltips to translate what each icon color means. Is there more to it, or would that be sufficient to communicate watched / unwatched?

I do think we should trigger dropdowns with clicks as much as possible. That's pretty consistent across all our dropdowns.

@Twixes
Copy link
Member Author

Twixes commented Aug 26, 2021

Also added a 500+ ms hover tooltip to the play icon for individual recordings :)
Zrzut ekranu 2021-08-26 o 17 23 14

@macobo
Copy link
Contributor

macobo commented Aug 26, 2021

@clarkus

@macobo I think we can maintain the watched / unwatched treatment given my previous comment.

Problem being you need to open a dropdown to see it in the first place. Given that these lists are supposed to get large, we have made a process that used to be purely visual into a clicking fest.

@Twixes

@macobo I see what you mean. I added a play icon to the button too, which is blue if there's an unwatched recording under it, and gray if all have already been watched. This should improve scannability.

I think so too. Didn't check out the code but looks much better.

Initially I wanted to make it play without a dropdown in case of a single recording, but I ran into a weird UX mismatch, where you'd be able to see the details of recordings when there were multiple of them (thanks to the dropdown), but you'd be clicking blindly in case of a single recording – no place to show the timestamp.

Very good point IMO re the design.

All-in-all it brings up the question of what problem we're solving and why?

For Sessions page specifically, after #4884 has been resolved we will have 1-1 matching. For people modal, I'd expect similar - one session recording per person 98% of the time (since it's based on user navigating around, how often do you use two browsers at once?)

What are we gaining by simplifying the 2% case?

@clarkus
Copy link
Contributor

clarkus commented Aug 26, 2021

Problem being you need to open a dropdown to see it in the first place. Given that these lists are supposed to get large, we have made a process that used to be purely visual into a clicking fest.

True, but we've also added extra information to communicate the freshness of recordings and their duration. It's another click but you can have more info to indicate which session might be worth watching. We are going to hit some uppperbound for scale here at some point. We could adjust to showing recordings inline with an overflow option that links off to a full list of recordings for the user, but I'm not sure we'd be able to include the other information in that case.

What are we gaining by simplifying the 2% case?

I think we're making it better until #4884 is completed. Once we have more confidence in a 1:1 match, we can adjust here. Given how things are working now, this feels like a better experience until we're in a more ideal state.

@Twixes Twixes merged commit 84dc2b0 into master Aug 26, 2021
@Twixes Twixes deleted the persons-modal-recordings branch August 26, 2021 17:17
Copy link
Contributor

@paolodamico paolodamico left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here. Quick posthumous review (UX/product, not code) based on PostHog Cloud to improve in a subsequent PR,

  1. There's a weird flicker with scrollbars which makes interacting with the page really difficult.
    image

  2. Probably related to the above, the tooltip in the Recordings column header is no longer showing.

  3. We should just allow direct clicking on the button if there's only one recording. No point in showing the dropdown. This way it can also be clear at a glance to users when a session has multiple recordings.

@clarkus
Copy link
Contributor

clarkus commented Aug 26, 2021

Oh I thought it was set to only show a drop down in the case of multiple recordings. Otherwise it's a button.

@Twixes
Copy link
Member Author

Twixes commented Aug 26, 2021

Couldn't reproduce the flickering, but there is a problem with sizing the last column in ResizableTable. Kind of outside the scope of this PR, but may be good to take a look at it later.
I see the point with the single recording case, put out a proposal how to handle it: #5757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants