Skip to content

Fix the Bookmark Context not updating when user updates in exercises #519

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

Conversation

tfnribeiro
Copy link
Contributor

  • The interactive text object needs to be re-created as this is what contains the change, so a flag was created that gets called when the bookmark is changed.

Notes

  • Match doesn't need any change as the context is not rendered in the frontend
  • Multiple Choice context needed another use effect that only updates the bookmark that can be edited (the one being tested)

- The interactive text object needs to be re-created as this is what contains the change, so a flag was created that gets called when the bookmark is changed.
Copy link

netlify bot commented Sep 4, 2024

Deploy Preview for voluble-nougat-015dd1 ready!

Name Link
🔨 Latest commit 36e1048
🔍 Latest deploy log https://app.netlify.com/sites/voluble-nougat-015dd1/deploys/66d859f60fbc500008c30ed2
😎 Deploy Preview https://deploy-preview-519--voluble-nougat-015dd1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -252,6 +253,7 @@ export default function NextNavigation({
reload={reload}
setReload={setReload}
notifyDelete={() => setIsDeleted(true)}
notifyWordChange={() => isBookmarkChanged()}
Copy link
Member

@mircealungu mircealungu Sep 10, 2024

Choose a reason for hiding this comment

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

Ehi Tiago, could this be a sign that we should move the edit button away from the next navigation? Or rename NextNavigation to something else? Currently it feels wrong to pass the notifyWordChange to the NextNavigation which passes it on further to the edit box...

I think the right direction would be to move both the speech button and the edit button. We've already talked about the speech into the main exercise as underline. If we also move the edit box, we could have a design like this:

image

We can almost skip passing the exerciseBookmark down to the NextNavigation too... because as far as I can tell, it's mainly used for the Speech and for the EditBookmark dialog.

In any case, I would say, the first step could be moving the Edit bookmark button, so the button lives in the same component as the bookmarks that it edits.

Do you see what I mean?

P.S. Surely, we could also, just as well not do it now, but rather open an issue instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the NextNavigation originally was just to create a component to avoid repeating a lot of the same formatting for each of the exercises. I think the main reason was because some exercises had speech and other didn't have the speech bubble (Match vs Others). Eventually that was also where Merle has implemented the celebration modal logic/message of learning a word.

This means that the component which essentially was meant to just place these icons in a bottom row in a standard way has gotten much more complex than it should.

I agree with having the speech / edit in the text, and removing the pronounce buttons from the end, and that should make it easier to unpack the component.

Now, I think we should still keep this idea that the exercise renders what it has to render, but the Next / Congratulations / Auto-Pronounce these are all exercise independent and they just just be placed bellow the current exercise. This would mean that this logic should not be part of the Specific Exercise implementation, but rather controls to the ExerciseSession.

I think to do this well it will take a bit of time, there is a lot of things that would have to be moved, but it would be beneficial to make sense of the code.

Essentially, this:

image

Would be part of a component in the Exercise code, rather than in each exercise itself. We still have the issue of having to test if it's the Match, but maybe we can just have a generic "MultipleWordsProgressed" logic for the rendering of the congratulations box.

Copy link
Member

Choose a reason for hiding this comment

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

Let's merge this for now because it's a bug fix. Then we'll do the refactoring at a later point. I've created an issue with this conversation: #535.

@mircealungu mircealungu merged commit b2d3c0a into master Sep 12, 2024
4 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.

When updating the context at the end of the exercise the exercise doesn't reflect the change
2 participants