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(Experiments): Allow users to edit and preview no-code experiments from experiment page. #25877

Merged
merged 25 commits into from
Nov 4, 2024

Conversation

Phanatic
Copy link
Contributor

Problem

In the past, creating a no-code experiment required a user to navigate to the Toolbar page and then launch the toolbar from there to edit an existing experiment.

This PR instead adds a custom implementation section to the experiment page that allows a user to bring up the toolbar with the experiment pre-selected. It also adds a preview variant button to each variant of the web experiment.

Changes

1. Editing a web experiment from its individual page.

On the edit page of a web experiment, this is what you see now for implementation

image

Clicking on Edit Web experiment on website brings up this dialog that shows the authorized URLs for the posthog project

image

Selecting a URL takes one to the domain with the experiment pre-selected

image

2. Previewing web experiment variants from an experiment page.

The Distribution table now has an additional column if its a web experiment, all widths adjusted accordingly.

image

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

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

How did you test this code?

@Phanatic Phanatic changed the title Experiments: Allow users to edit and preview experiments from experiment page. feat(Experiments): Allow users to edit and preview experiments from experiment page. Oct 29, 2024
@Phanatic Phanatic changed the title feat(Experiments): Allow users to edit and preview experiments from experiment page. feat(Experiments): Allow users to edit and preview no-code experiments from experiment page. Oct 29, 2024
@Phanatic Phanatic force-pushed the exp-show-previews-link branch from 4082893 to 6881ac4 Compare October 29, 2024 15:48
@jurajmajerik
Copy link
Contributor

Not sure if this is still on a todo list, but transforms for a variant still isn't applied correctly here:

Screen.Recording.2024-10-29.at.17.06.46.mov

@jurajmajerik
Copy link
Contributor

When saving a new experiment, an empty error banner flickers before successfully saving:

Screen.Recording.2024-10-29.at.17.11.06.mov

@jurajmajerik
Copy link
Contributor

Working well, some comments :)

@Phanatic
Copy link
Contributor Author

Phanatic commented Oct 31, 2024

@jurajmajerik thanks for taking a look!

re : #25877 (comment)

The transform the HTML is overriding the transform for the text. Maybe I should order it so that the most significant changes happen first and then the lower priority. As an example HTML Changes -> CSS changes -> Text changes.

This way, the Text changes are always applied.

This should be fixed now

@Phanatic
Copy link
Contributor Author

Good catch on #25877 (comment)
I just fixed this, it was an issue with checking if any errors existed on the logic before saving.
no_flashing_error

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 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

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 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

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@Phanatic Phanatic force-pushed the exp-show-previews-link branch from b70a767 to b4dbb4d Compare November 1, 2024 16:57
Copy link
Contributor

github-actions bot commented Nov 1, 2024

Size Change: +613 B (+0.05%)

Total Size: 1.15 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.15 MB +613 B (+0.05%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 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

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@Phanatic Phanatic merged commit 69d2f2d into master Nov 4, 2024
96 checks passed
@Phanatic Phanatic deleted the exp-show-previews-link branch November 4, 2024 18:55
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.

4 participants