-
Notifications
You must be signed in to change notification settings - Fork 9
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
Open ImageViewer when user clicks an article image #92
base: master
Are you sure you want to change the base?
Conversation
Thank you! I think this works as specified. As the code does not look completely straight-forward, could you describe how you came up to this solution, and then we can see if there should be some comments within the code? |
Support multiple images in image viewer
Ringed.Seal.-.Google.Chrome.2023-03-05.01-58-36.mp4 |
Also added some comments in the code. |
When the wikipedia article is mounted /updated, we query all the images with links in the wikipedia article, suppress the original image click actions (open the wikipedia image page), and add the new click action. When an image is clicked, we call the backend api to get image url and metadata for all images. When the metadata of all images is ready, we extract the metadata we want from the data response, fill it into the imageviewer items list and open the image viewer. Also, we save the the metadata locally at the first image click, so if the user clicks the image again (could be another image in the article), we can use the metadata stored locally and open the image viewer immediately. |
One thing I found tricky is that the author and creation date the wikipedia api returns are html strings sometimes(e.g. author with its wikipedia page link) (see sample in the video). Shall we make the imageviewer support html strings? Thanks! |
I am sorry that I have not been able to respond sooner. I will leave it to @tuukka to review the PR. I can respond to the question. It is possible that html strings would limit the way in which links could be used as default behavior of the metadata fields. I think therefore that it would make sense to observe how the different sources behave and expand only after they have become more familiar (and when we have more sources to review). |
Converted all html strings to regular string in the latest commit. Could you review the PR? @tuukka |
Hi @susannaanas @tuukka, could you review the pull request? It has been two weeks. Thanks! |
Ringed.Seal.-.Google.Chrome.2023-02-26.18-53-39.mp4