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(app): store run step completion in redux #16570

Merged
merged 9 commits into from
Oct 23, 2024

Conversation

sfoster1
Copy link
Member

@sfoster1 sfoster1 commented Oct 22, 2024

[It turns out that since we implemented the green checks displayed for completed steps as react component state, if you navigate away from the component it loses the state.

To fix this we can throw it in redux. This PR does that, in the app anyway.

testing

  • the green checks on the desktop should still work, including when you nav away and back

reviews

  • i have not done redux stuff in a while! does this look right?

Closes RQA-3304

Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Looking good! Agree with the overall approach!

@@ -68,4 +71,5 @@ export const rootReducer: Reducer<State, Action> = combineReducers({
sessions: sessionReducer,
calibration: calibrationReducer,
protocolStorage: protocolStorageReducer,
protocolRuns: protocolRunReducer,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm very excited about this!

),
})
)
}, [runId, protocolAnalysis, dispatch])
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling this could cause an infinite re-render, but I could be wrong. We probably want to do something like protocolAnalysis.key.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup this happened instantly. This can be either a robot-side or app-side analysis so we have to try the id too but it works when you do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want some sort of store update here if a run is already in progress, and we don't actually need any setup, rather than forgoing the top level setup field?

protocol analyses are absolutely not safe to use as hook dependencies
@sfoster1 sfoster1 marked this pull request as ready for review October 23, 2024 14:10
@sfoster1 sfoster1 requested a review from a team as a code owner October 23, 2024 14:10
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Very nice!

@sfoster1 sfoster1 merged commit 33554cb into edge Oct 23, 2024
13 checks passed
@sfoster1 sfoster1 deleted the rqa-3304-green-checks-in-redux branch October 23, 2024 16:25
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