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

Feature/alternate before next #85

Merged
merged 20 commits into from
Feb 23, 2024
Merged

Feature/alternate before next #85

merged 20 commits into from
Feb 23, 2024

Conversation

jthrilly
Copy link
Member

@jthrilly jthrilly commented Feb 22, 2024

This PR implements a completely rewritten navigation system, with the aim of fixing the problems with the registerBeforeNext functionality.

Specific changes:

  • Delete useNavigationHelpers hook, and implement all navigation methods inside of ProtocolScreen.
  • Fixed stage animations by triggering them separately from the state updates in redux. I also implemented some basic animation orchestration that needs to be finished.
  • Remove the use of query state. This means that session state is now entirely within redux. The only disadvantage is that it is now not possible to 'force navigate' to a specific stage. We can add this feature back in relatively easily.
  • Pass select functions into Stage and Navigation, and use selectors within those components for everything else.
    • registerBeforeNext - passed in to Stage, and automatically set to null within ProtocolScreen just prior to triggering the stage animation. ⚠️ This was a total nightmare to get right.
    • stage - got via redux selector and passed directly into Stage and through to the stage component.
    • getNavigationHelpers - heavily memoised function that returns moveForward and moveBackward functions, which can be used where needed by the stage. As far as I know, there are only three instances where these are used: TieStrengthCensus & DyadCensus (both for the 'auto advance' functionality), and SlidesForm (uses it to allow pressing enter to advance.
  • Rewrote the implementation of registerbeforenext on several interfaces:
    • NameGenerator/NameGeneratorRoster - rewrote the function to correctly trigger min/max node functionality, and be shared between all interfaces
    • DyadCensus/TieStrengthCensus - completely rewrote to remove flawed assumptions that were causing all the bugs we encountered before.
  • Store stage "metadata" which is used by dyadcensus and tie strength census to track when the participant answers "no" when creating an edge. Completely rewrote useSteps and useEdgeState and tried to combine as much code between the two interfaces as possible.

Copy link

vercel bot commented Feb 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fresco ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 2:49pm

@jthrilly jthrilly merged commit cc132f4 into main Feb 23, 2024
5 checks passed
@jthrilly jthrilly deleted the feature/alternate-beforeNext branch March 28, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant