-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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): Add input field for editing selector #26487
Conversation
Size Change: +402 B (+0.03%) Total Size: 1.16 MB ℹ️ View Unchanged
|
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
@@ -131,6 +132,12 @@ export const experimentsTabLogic = kea<experimentsTabLogicType>([ | |||
hideButtonExperiments: () => false, | |||
}, | |||
], | |||
editSelectorShowing: [ |
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.
Nit: If we have a state value that's only used locally within a single element, especially a toggle or boolean value, I strongly prefer using local state instead of a Kea value. In WebExperimentTransformField.tsx
, we already do this with [transformSelected, setTransformSelected]
.
While we always aim to separate state from React components, I think this is the one exception. It simplifies working with the value since it only requires a single line of code, and you don't have to update two separate files.
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.
Sounds good, updated in 98d0eec
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.
Good catch!
Changes
Adds an input field for editing the selector associated with a web experiment transform. This lets the user be more specific with the behavior they'd like.
From https://posthoghelp.zendesk.com/agent/tickets/20916
How did you test this code?
I verified I could edit the selector, and that the selector saved as expected and was applied after I refreshed the page.