posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat(insights): add existing insights to dashboard

Open jithenms opened this issue 1 year ago • 8 comments
trafficstars

Problem

Currently, users need to go the insights tab and individually add insights to their dashboards. In the current version of dashboards, there is only support to create a new insight and not add an existing one. This PR aims to offer a modal similar to the one found in the insight page so users can both add existing insights or create new insights to their dashboards from their dashboards.

Closes #19710

Changes

Screenshot 2024-01-16 at 10 49 06 PM

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

jithenms avatar Jan 17 '24 03:01 jithenms

Currently if you have many insights (so that there are 2 or more pages on the saved insights page) you will not be able to see insights from a page other than the last viewed saved insights page. For example if you add insights until the second page is visible, navigate to this page on the saved insights view and then open the dashboard modal, you'll only see the insights from this second page.

Ah yes that makes complete sense now that I thought about it. I think the idea around isolating the responsibilities of the saved insights and modal logics to fetch insights would probably be the ideal solution here so what I did was implement a very simple loader into the modal logic to fetch and maintain insights isolated from savedInsightsLogic.

jithenms avatar Jan 20 '24 06:01 jithenms

  1. The insights need to be paginated or we need to adapt the flow for a case when the user has many insights.

Yes, pagination makes sense. Just implemented a very simple pagination control into the modal.

jithenms avatar Jan 20 '24 06:01 jithenms

  • The "add text card" dropdown is missing from the button (see inline comment)

Oh yes, sorry about that just added it back. I had originally thought it was a placeholder but I see now it is the actual text cards on the dashboards.

jithenms avatar Jan 20 '24 06:01 jithenms

3. Not a total blocker, but would be nice to have solved: If there are many insights the list displays a scrollbar, but there is no gap between the scrollbar and the button. This doesn't look nice. I guess this issue is already present in the "add to dashboard modal".

Added padding to the sides of the list container to give it some room.

jithenms avatar Jan 20 '24 06:01 jithenms

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar Jan 29 '24 07:01 posthog-bot

@thmsobrmlr just wanted to check in. How is it looking?

jithenms avatar Feb 03 '24 17:02 jithenms

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar Feb 12 '24 07:02 posthog-bot

Sorry @jithenms, I've been bogged down in some other tasks and haven't gotten to this yet. I will make some time for it this week.

thmsobrmlr avatar Feb 12 '24 12:02 thmsobrmlr

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar Feb 27 '24 07:02 posthog-bot

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

posthog-bot avatar Mar 05 '24 07:03 posthog-bot

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar Mar 14 '24 07:03 posthog-bot

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

posthog-bot avatar Mar 22 '24 07:03 posthog-bot