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

When changing language, the diff shown is still from the previously-selected wiki #134

Closed
hrasyid opened this issue Dec 26, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@hrasyid
Copy link
Collaborator

hrasyid commented Dec 26, 2019

To repro:

  1. Open the main URL, which default to English
  2. change Wiki using the selector, let's say to French (fr)
  3. The UI language changes to French but the diff shown is still from the English Wikipedia. Only if you evaluate the current diff (e.g. by choosing "not sure") and then wait for the "next" button to appear will you get a diff from the French Wikipedia.

This might confuse the user into thinking that the selector doesn't work, and the workaround (evaluate the current diff so that the next button shows up) isn't obvious so they may be stuck without realizing how to proceed.

I suggest when the user changes the wiki/language from the selector, the page refresh so that a diff from the newly selected language shows up.

Example screenshot:
CKD44OYW9n2

@xinbenlv xinbenlv added the bug Something isn't working label Dec 26, 2019
@xinbenlv
Copy link
Contributor

Duplicate of #122

@xinbenlv xinbenlv marked this as a duplicate of #122 Dec 26, 2019
@xinbenlv
Copy link
Contributor

Thank you @hrasyid
If you like to help fix it, here are two code points:

  1. Load the next revison to show (https://github.com/google/wikiloop-battlefield/blob/b984f098dc703e9a02f907187ffabf748e07bcbb/pages/index.vue#L58)
  2. Switching the language https://github.com/google/wikiloop-battlefield/blob/b984f098dc703e9a02f907187ffabf748e07bcbb/layouts/default.vue#L47

So one of the implementation option is when the language is being switched out, we can generate an event from default.vue, and page index.vue subscribe to such event and load next.

Here is an example of emitting a custom event from vue component
https://github.com/google/wikiloop-battlefield/blob/3e820ae859065d6c497807b8a307d5f202da472a/components/RevisionCard.vue#L431

Give it a try and let me know if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants