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

chore(no-code experiments): refactor (2) #28324

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

jurajmajerik
Copy link
Contributor

@jurajmajerik jurajmajerik commented Feb 5, 2025

Part of #28205

Changes

  • Undo transforms when the variant tab is changed
  • Undo transforms when the content type selector (text/html) is changed
  • Only render the inputs when a selector is selected
  • Other small cleanups

https://www.loom.com/share/942c1c0cf5ff41a99979a22bffd088fa?sid=096012b5-037a-4164-b076-b6561bb4ee85

How did you test this code?

👀

@jurajmajerik jurajmajerik requested a review from a team February 5, 2025 10:34
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR refactors the no-code experiments functionality to improve state management and undo behavior when switching between variants and content types.

  • Removed undo_transforms field from WebExperimentForm interface in /frontend/src/toolbar/types.ts in favor of using original_html_state for state restoration
  • Added logic in /frontend/src/toolbar/experiments/experimentsTabLogic.tsx to restore original HTML state before applying new transforms when switching variants
  • Modified /frontend/src/toolbar/experiments/WebExperimentTransformField.tsx to conditionally render inputs only when a selector is selected
  • Improved variant handling in /frontend/src/toolbar/experiments/ExperimentsEditingToolbarMenu.tsx to use simplified variant change handler with single parameter

4 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Size Change: +61 B (+0.01%)

Total Size: 1.17 MB

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

compressed-size-action

Copy link
Contributor

@andehen andehen left a comment

Choose a reason for hiding this comment

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

Nice improvement! Looks good 👍

@jurajmajerik jurajmajerik merged commit 88e6167 into master Feb 5, 2025
103 checks passed
@jurajmajerik jurajmajerik deleted the nocode-experiments-refactor-2 branch February 5, 2025 13:36
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.

2 participants