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

Saved insights default 2 #5616

Merged
merged 19 commits into from
Aug 25, 2021
Merged

Saved insights default 2 #5616

merged 19 commits into from
Aug 25, 2021

Conversation

liyiy
Copy link
Contributor

@liyiy liyiy commented Aug 17, 2021

Changes

Please describe.
If this affects the frontend, include screenshots.

Feature flag 3408-saved-insights should be on for this to work. After that, navigate to / and it should take you to /saved_insights automatically

Updates to the search/filters bar, card layout, and insight action dropdowns

Screen.Recording.2021-08-19.at.1.11.50.AM.mov
Screen.Recording.2021-08-21.at.8.15.54.PM.mov

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests
  • Migrations are safe to run at scale (e.g. PostHog Cloud) – present proof if not obvious
  • New/changed UI is decent on smartphones (viewport width around 360px)

@timgl timgl temporarily deployed to posthog-pr-5616 August 17, 2021 13:12 Inactive
@liyiy
Copy link
Contributor Author

liyiy commented Aug 17, 2021

@clarkus What kind of dropdown options do you think makes sense for last modified?

Screen Shot 2021-08-17 at 1 12 29 PM

@clarkus
Copy link
Contributor

clarkus commented Aug 17, 2021

@liyiy I think we could mimic the time range options shown for visualizations. There are a lot of options here, but it does set some precedent for the presets users might expect. Let's start with this. We can update later after we see how it's being used.

Screen Shot 2021-08-17 at 10 29 07 AM

@timgl timgl temporarily deployed to posthog-pr-5616 August 19, 2021 04:02 Inactive
@timgl timgl temporarily deployed to posthog-pr-5616 August 19, 2021 04:03 Inactive
@timgl timgl temporarily deployed to posthog-pr-5616 August 19, 2021 05:11 Inactive
@timgl timgl temporarily deployed to posthog-pr-5616 August 19, 2021 06:28 Inactive
@liyiy liyiy marked this pull request as ready for review August 19, 2021 06:29
@timgl timgl temporarily deployed to posthog-pr-5616 August 19, 2021 18:52 Inactive
@timgl timgl temporarily deployed to posthog-pr-5616 August 19, 2021 19:01 Inactive
@clarkus
Copy link
Contributor

clarkus commented Aug 19, 2021

Here's a quick update that aligns the dashboard item menus to the ones used on insights. https://www.figma.com/file/gQBj9YnNgD8YW4nBwCVLZf/PostHog-App?node-id=3164%3A39543

Screen Shot 2021-08-19 at 1 28 39 PM

Screen Shot 2021-08-19 at 1 35 49 PM

@timgl timgl temporarily deployed to posthog-pr-5616 August 22, 2021 00:14 Inactive
@paolodamico
Copy link
Contributor

Pretty swamped this week, @mariusandra @alexkim205 would you be able to help with a review here?

@@ -67,7 +52,6 @@ export type DisplayedType = ChartDisplayType | 'RetentionContainer'
interface DisplayProps {
className: string
element: (props: any) => JSX.Element | null
icon: (props: any) => JSX.Element | null
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, will removing icons here be consistent with how we want to use DashboardItems in InsightHistoryPanel and DashboardItems?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we're getting rid of insight history panel and yes, it should be gone in the dashboard items I believe under the mocks chris posted?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I've been dropping icons from the menus. I think we're overusing them in a few places. The exceptions for inline icons so far have been + icons as prefixes in buttons.

frontend/src/scenes/saved-insights/SavedInsights.tsx Outdated Show resolved Hide resolved
frontend/src/scenes/saved-insights/SavedInsights.tsx Outdated Show resolved Hide resolved
},
setCreatedBy: () => {
actions.loadInsights()
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Kind of torn if it's worth the refactor to put all these parameters (tab, search term, dates, type, etc.) under a source of truth filters like we have in our insight logics. It would make for less boilerplate code and could persist these options in the url (which is especially helpful if the user wants to navigate back to their saved_insights after clicking an insight row). @mariusandra what are your thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would indeed be great to persist these variables in the URL... and that's indeed easier to achieve if you have one filters reducer, versus multiple other reducers, though this can work as well.

posthog/api/insight.py Show resolved Hide resolved
@alexkim205
Copy link
Contributor

Hey @liyiy, looking nice! Left some inline comments + some bugs I ran into below:

Not sure if my CH setup is being uncooperative, but I get stuck in a reload loop when I try to spin this up with yarn start-ch-dev and navigate to /saved_insights:

Screen.Recording.2021-08-23.at.9.43.38.PM.mov

Counts start with 1 even if insights don't exist:

Screen Shot 2021-08-23 at 9 51 25 PM

@liyiy
Copy link
Contributor Author

liyiy commented Aug 25, 2021

@alexkim205 hmm how are you accessing that saved_insights endpoint? The feature flag needs to be on for it to work

@timgl timgl temporarily deployed to posthog-pr-5616 August 25, 2021 04:21 Inactive
@timgl timgl temporarily deployed to posthog-pr-5616 August 25, 2021 04:39 Inactive
Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

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

I tested this (and the relevant part under insights), and found some mostly-UX problems.

  1. a) It doesn't want to change the name, and b) clicking on "description" seems focuses the "name" field
    2021-08-25 13 52 58

  2. Afterwards updating the filter loses data
    2021-08-25 13 54 20

  3. The save button and its connected "save to dashboard" flow seems off here:
    2021-08-25 13 56 22

  4. It wasn't obvious that to test this, I had to open the / path, which would take me to the saved insights page. This would be nice to include in the PR description for people who want to test (unrelated pet peeve of mine: screencasts that just omit the URL bar :D). There was also nothing I could click to open this page.

  5. I can filter by types, but in the "list" view I don't see what types are in the list. Perhaps icons to the rescue? :D
    image

  6. The "last modified" and "created by" columns just sort the current page, not the entire list:
    2021-08-25 14 07 16

  7. With the "..." icon so close to the name, it doesn't feel like a row-level menu, but more like a user-level menu.
    2021-08-25 14 08 06

  8. In the card view I lose the information about who made the insight. The old "home" view does contain this information for example:
    2021-08-25 14 09 29

  9. Let the user edit the name when renaming:
    2021-08-25 14 18 00

Comment on lines +52 to +77
.dashboard-item {
border: 1px solid transparent;
padding-bottom: 10px;
cursor: pointer;

.dashboard-item-container:not(.funnel) .dashboard-item-content {
transform: scale(0.333);
transform-origin: top left;
overflow: inherit;
position: inherit;
& > div {
height: 300% !important;
width: 300% !important;
}
}
.dashboard-item-header {
cursor: pointer !important;
}

.svg-funnel-js__label * {
font-size: 8px;
}
&:hover {
border-color: var(--primary);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This and surrounding code (copied from InsightHistoryPanel.scss?) seems so specific, it feels messy to write the same thing in two files. Even if we're getting rid of InsightHistoryPanel eventually, I'd add some comment here to keep the scss files in sync... or then reuse the them in a more direct way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I can leave a comment here. The better update is probably for me to consolidate all the dashboard items into the new mock design

},
],
searchTerm: [
'' as string,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I think as string is not needed here

},
setCreatedBy: () => {
actions.loadInsights()
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would indeed be great to persist these variables in the URL... and that's indeed easier to achieve if you have one filters reducer, versus multiple other reducers, though this can work as well.

@liyiy
Copy link
Contributor Author

liyiy commented Aug 25, 2021

@mariusandra

Points 1-4 are very valid, the creation flow PR here should be tackling those issues and I will leave better instructions on how to reproduce my PRs 😄 .

Will incorporate 5, 6, 7, and 8

9 I will hold off for because I feel like that's something that can be improved upon in a follow up PR and I'd also have to update that functionality for dashboard item renaming too

@timgl timgl temporarily deployed to posthog-pr-5616 August 25, 2021 16:33 Inactive
@liyiy
Copy link
Contributor Author

liyiy commented Aug 25, 2021

UX updates:

Screen Shot 2021-08-25 at 12 29 20 PM

Screen Shot 2021-08-25 at 12 29 30 PM

Screen Shot 2021-08-25 at 12 34 59 PM

@mariusandra mariusandra temporarily deployed to posthog-pr-5616 August 25, 2021 18:30 Inactive
@alexkim205 alexkim205 self-assigned this Aug 25, 2021
@alexkim205
Copy link
Contributor

Talked offline with @liyiy and decided to approve merge to master to avoid merge conflicts w/ #5702. I'll follow up with PR to address the above stuff.

@alexkim205 alexkim205 self-requested a review August 25, 2021 21:44
@liyiy liyiy merged commit ce2f446 into master Aug 25, 2021
@liyiy liyiy deleted the saved-insights-default-2 branch August 25, 2021 21:46
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