Open waldyrious opened 10 years ago
Changing the control should also update the currently loaded article, not just future queries.
I tried to find a solution for this.
The control is not an issue but I have problems with understand how to obtain the information from wikipedia/mediaWiki. Any pointers?
Yeah, that's why I removed the hacktoberfest
label, as this probably needs a bit of research work. I would say that a first implementation could be done by fetching the contents as is currently done, and simply trimming out excess contents (just the first sentence vs. just the first paragraph vs. the entire first section). This could be done using regex find/replace.
Eventually, we will want to also fetch the Wikidata description. but I guess that could be left to a separate issue, to keep things simple.
By the way: back in 2012 I made a proposal for related functionality in Wikipedia's Navigation popups gadget. Some of the code there may be relevant for this. Here's the full current source of the gadget.
Funny thing, I just learned about Ted Nelson's (of Project Xanadu fame) StretchText proposal, which is a proposal for precisely this kind of progressive disclosure in prose (though it's a bit more fleshed-out in terms of how the UI should work, and more ambitious in the seamlessness of the intended UX).
There could be a set of radio buttons, a dropdown list or even a slider (UI up for discussion) to pick between different content lengths: