Skip to content

Conversation

pauldambra
Copy link
Member

Problem

If you want to create a particular kind of new insight it can take over two clicks. Nobody has time for that

Changes

Now it takes two clicks!

2023-03-15 12 25 07

How did you test this code?

👀 locally

@pauldambra pauldambra requested a review from a team March 15, 2023 12:30
@@ -299,31 +280,9 @@ export function NewInsightButton({ dataAttr }: NewInsightButtonProps): JSX.Eleme
placement: 'bottom-end',
className: 'new-insight-overlay',
Copy link
Member

Choose a reason for hiding this comment

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

Wow, this dropdown is really w i d e! I haven't notice before, because, well, I've always used the plus in the sidebar. But to ship this, let's constraint the width of .new-insight-overlay to something like 21rem (this number seems to result in all options having roughly equal-size two lines of description)

@Twixes
Copy link
Member

Twixes commented Mar 15, 2023

Ah, GitHub ate my review summary… Basically:
This doesn't seem to reduce the number of clicks? It used to be two and it's still two. In fact, it's now one click more if you want a Trends insight.
Though we've talked about this idea before, and I think we came to the conclusion that there is one potential benefit: this can help users choose the most relevant insight type more conciously. So let's ship this. Just before we do this, I have a few comments.

pauldambra and others added 2 commits March 15, 2023 19:02
@pauldambra
Copy link
Member Author

This doesn't seem to reduce the number of clicks? It used to be two and it's still two. In fact, it's now one click more if you want a Trends insight.

I thought "Oh yeah, you can click the plus"

I never do, which made me wonder if other people do.

Last 7 days only 7% of clicks on the insight and plus area were on the plus

  • 31% of people who click on the button area, click to save an insight
  • 52% of people who click on the plus, then click to save an insight

Hmmm, numbers but maybe not insight :rofl

@pauldambra
Copy link
Member Author

Screenshot 2023-03-15 at 19 25 54

@pauldambra pauldambra requested a review from Twixes March 15, 2023 19:26
Comment on lines 105 to 107
&[data-attr='sidebar-new-insights'] {
max-width: 21rem;
}
Copy link
Member

Choose a reason for hiding this comment

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

This style would also be useful on the "New insight" popover on the insights list page. Can we put it on .new-insight-overlay instead of this SideBar override?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, interesting, that already has an override that's being ignored

Screenshot 2023-03-16 at 11 30 01

*rolls up sleeves

Copy link
Member Author

Choose a reason for hiding this comment

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

How about passing optionally passing max width to popover....

Screenshot 2023-03-16 at 11 40 08

Screenshot 2023-03-16 at 11 39 16

Screenshot 2023-03-16 at 11 39 09

@@ -120,7 +123,7 @@ export const Popover = React.forwardRef<HTMLDivElement, PopoverProps>(function P
apply({ availableWidth, availableHeight, rects, elements: { floating } }) {
Object.assign(floating.style, {
maxHeight: `${availableHeight}px`,
maxWidth: `${availableWidth}px`,
Copy link
Member

@Twixes Twixes Mar 16, 2023

Choose a reason for hiding this comment

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

So, the reason this is potentially dangerous is now we're not taking availableWidth into account – and we always should be. But if we just set width instead of max-width in .new-insight-overlay, this'd work well – that width would be used most of the time, but max-width would automatically take precedence when needed. (Plus, we wouldn't need to extend the Popover API)

Copy link
Member Author

Choose a reason for hiding this comment

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

🤔

@pauldambra pauldambra requested a review from Twixes March 16, 2023 12:23
Twixes added 2 commits March 16, 2023 13:30
The tooltip basically functions as a on-hover label here, so using the same text as on the saved insights page, where it says "New insight".
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

🚢

@Twixes Twixes added the highlight ⭐ Release highlight label Mar 16, 2023
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@pauldambra pauldambra enabled auto-merge (squash) March 16, 2023 13:12
@pauldambra pauldambra merged commit ecdface into master Mar 16, 2023
@pauldambra pauldambra deleted the feat/new-insights-in-sidebar branch March 16, 2023 13:56
fuziontech added a commit that referenced this pull request Mar 16, 2023
* master: (101 commits)
  feat: feedback tab - improve the UI and switch to HogQL (#14777)
  feat(experiments): cache experiment results (#14742)
  fix(empty-state): properly fix query timeout state (#14793)
  chore(feature-flag): release json payload flag (#14775)
  feat(hogql): make sure joins work with properties (#14790)
  test(frontend): Tune visual regression test failure threshold (#14766)
  feat(hogql): count distinct and count star (#14786)
  feat(perf): only load experiment results once (#14772)
  feat: allow new insight type choice from sidebar (#14759)
  fix(persons): hide persons in the future (#14308)
  feat: allow query cards in saved insights grid (#14784)
  fix(lemon-ui): Align padding for small/large buttons with icons (#14750)
  chore(deps): Upgrade TypeScript from 4.8 to 4.9 in the frontend (#14609)
  feat: rename insight query tab to json tab (#14781)
  feat: use same top heading for insight card and exported insight (#14780)
  feat: define new insight urls in one place (#14778)
  fix(hogql): person properties in a funnel breakdown (#14765)
  fix: hide query based insights in recently viewed list (#14774)
  feat: improve query summaries (#14768)
  feat(hogql): add sampling support (#14733)
  ...
@pauldambra
Copy link
Member Author

Removing it in #14876

@pauldambra pauldambra removed the highlight ⭐ Release highlight label Mar 23, 2023
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.

3 participants