Closed timofeysie closed 3 years ago
It would be nice to know other things about the Wikidata/Wikipedia details such as if they even have a description, a modified description, a link, and particular languages available. Keep in mind we want to be able to select a small portion of the detail description to use in the sliding item options.
As a sub item to this issue, https://github.com/timofeysie/khipu/issues/26
We now have three different descriptions to deal with:
The main page currently has a slide component to expose the first one. Many have no description, or one that is not appropriate. If it does exist it needs to be sent to the detail page to start off as the editable description. The other two can then provide cut and paste ability to add and edit the description or create a new one. The result of this can then replace the default wikidata list. The main problem here is how to persist this data so the user has control over their changes.
The problem with sending the description to the detail page is that an item is selected and the details of the selection are added to the route like this:
this.router.navigate([`/categories/item-details/${this.categoryName}/${qCode}`]);
Obviously a long description can not be sent this way. And, we want users to be able to share these description urls. So we really need to be recreating what we need in the details page based on the url.
For example, this url: http://localhost:4200/categories/item-details/fallacies/Q310486
If one user sends this to another user, and they don't have the fallacies category in the same language with that q-code, then can we find a description for it? It doesn't really make sense that the recipient would want to edit the definition, as the item is not yet part of any list they have. So it only makes sense to worry about this if this item does in fact exist on the fallacies list that they should have in their store. If it's on a new device, then there will be a whole host of issues and 'what should we do in this case?' questions to answer.
I get that there is a lot to do in this issue. But one step at a time. What is the simplest next step here? Look in the categories list for the categoryName in the url, then try and find the qCode in that list. Also, it's pretty clear that the url should be something like one of these:
/categories/fallacies/item-details/Q310486
/categories/fallacies/details/Q310486
/categories/fallacies/Q310486
Any opinions?
A few issues with getting the selected item. The feature module has a separate state for each folder. We can of course import that and declare it in the module, but then it's going to be a new instance I think. Also, if the user refreshes the page, that wouldn't be there anyway. When the state is in the local storage, we need a way to re-hydrate that when needed, which would be in this case.
Seeming small issues were hard to fix, and a refactor was needed. Re-opening this to capture that work. The two remaining issues are:
Example: https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=Stack%20Overflow