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

Improve performance of random slots page #160

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Conversation

chrisbenincasa
Copy link
Owner

  • Move random slots to their own subcomponent (prevents re-render of whole page when weights change)
  • Only update underlying form value on slider commit value (onmouseup)
  • Memoize the dropdown portion of each slot row (prevent re-render when sliders change)
  • Add CSS animation on non-active sliders, smooth transitions while we're dragging

@@ -639,7 +677,7 @@ export default function RandomSlotEditorPage() {
<Select
label="Distribution"
{...field}
onChange={(e) => handleDistributionChange(e, field.onChange)}
// onChange={(e) => handleDistributionChange(e, field.onChange)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a heads up that this is commented out

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ah yep, this was on purpose.

@chrisbenincasa chrisbenincasa merged commit 193203c into main Mar 8, 2024
2 checks passed
@chrisbenincasa chrisbenincasa deleted the random-slots-page branch May 14, 2024 11:32
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