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

fix: Reset state when new instance of widget created #486

Merged
merged 3 commits into from
May 24, 2024

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented May 22, 2024

- We were using the same initial data regardless of how long the widget was opened
- We want to keep the same WidgetHandler and panelIds so that panels open in the same spot
- Want to start with a fresh state
- Freeze the initialData whenever the fetched widget is updated
- Fixes deephaven#401
- Tested using the steps in the description
@mofojed mofojed requested a review from bmingles May 22, 2024 15:45
@mofojed mofojed self-assigned this May 22, 2024
rerender(
makeWidgetHandler({
widget: widget2,
fetch: fetch2,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the change to fetch what you want to test here or just the change to widget?

Copy link
Member Author

@mofojed mofojed May 24, 2024

Choose a reason for hiding this comment

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

The descriptor. I'll have another PR up shortly that will negate the need to pass in fetch entirely.

Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

App code change looks good. Left a couple of comments / questions on the test

- Create utility functions to make tests more readable
- Clean up some comments
- Refactor some of the tests with a new utility function to be more readable
@mofojed mofojed requested a review from bmingles May 24, 2024 17:33
Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

LGTM

@mofojed mofojed merged commit df587a8 into deephaven:main May 24, 2024
13 checks passed
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.

Recreating UI components resets their state to when the page loaded instead of a clean state
2 participants