-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
There was a problem hiding this 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 fromWebExperimentForm
interface in/frontend/src/toolbar/types.ts
in favor of usingoriginal_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
frontend/src/toolbar/experiments/WebExperimentTransformField.tsx
Outdated
Show resolved
Hide resolved
frontend/src/toolbar/experiments/WebExperimentTransformField.tsx
Outdated
Show resolved
Hide resolved
frontend/src/toolbar/experiments/WebExperimentTransformField.tsx
Outdated
Show resolved
Hide resolved
Size Change: +61 B (+0.01%) Total Size: 1.17 MB ℹ️ View Unchanged
|
There was a problem hiding this 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 👍
Part of #28205
Changes
https://www.loom.com/share/942c1c0cf5ff41a99979a22bffd088fa?sid=096012b5-037a-4164-b076-b6561bb4ee85
How did you test this code?
👀