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

feat: actions as saved filters #26283

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

anirudhpillai
Copy link
Contributor

@anirudhpillai anirudhpillai commented Nov 19, 2024

Problem

No way to reuse filters across the app.
Actions are essentially saved filters as you can save the filters there and then select the action to view series on an insight.
On the activity page though, there's no way to pick an action to filter for events (people have requested saved filters there as well), so have added a way to pick 'saved filters'/actions there as well.

Changes

  1. Can pick 'saved filters'/actions on the Activity page/DataTable component.
    Also tackles part of Saved filters #20314 in letting DataTable have a way to pick 'Saved Filters'.
actions_as_saved_filters.mov
  1. Also Fixes Saved filters (or creating actions out of series) #2895 by letting users save the currently added filters into an Action.
action.from.filters.mov

This is just one approach, open to suggestions to improve the flow :)

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

Does this work well for both Cloud and self-hosted?

N/A

How did you test this code?

Tested Locally, will add E2E tests once everyone approves the UX.

Copy link
Contributor

github-actions bot commented Nov 19, 2024

Size Change: +82 B (+0.01%)

Total Size: 1.16 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.16 MB +82 B (+0.01%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@anirudhpillai anirudhpillai marked this pull request as ready for review November 20, 2024 12:25
@anirudhpillai anirudhpillai requested a review from a team November 20, 2024 12:25
saveFilterGroupAsAction: ({ propertyGroupIndex }) => {
const filterGroup = values.filters.values[propertyGroupIndex]

router.actions.push(urls.createAction(filterGroup))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

any way to get this to open in a new tab?

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@aspicer
Copy link
Contributor

aspicer commented Nov 21, 2024

Implementing saved filters as actions could make sense, but I think having to explain that to a user (and have every user understand it to use this feature) is a little confusing

Right now, they can save filters as an action, but then if they want to reuse those, do they need to use an action instead of selecting the event and applying "saved filters"?

Once they've created an action, can the "saved filter" only apply to the event type they created the action with? Or how could they take the same set of saved filters and apply them to different insights on different events?

I guess it feels to me that the usability of this approach isn't quite there - saved filters might need to be given a bit more respect as their own independent entity than just being a shortcut to actions. But please let me know if I'm misunderstanding how this should flow or not getting the functionality!

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.

Saved filters (or creating actions out of series)
3 participants