anvc / scalar

Born-digital, open source, media-rich scholarly publishing that’s as easy as blogging.
Other
231 stars 73 forks source link

Feature Suggestion: Anonymous Interactive Lens #227

Closed alexdryden closed 8 months ago

alexdryden commented 8 months ago

Need:

Authors can make lenses public, and registered users can suggest lenses to authors, but authors and scholars we work with have been wanting a feature that allows anonymous users to interact with with lenses and experimentally change their parameters without needing a login.

Proposal:

I propose an additional lens option for authors who want to include a reader-operated, interactive lens for readers who do not have an account. This option would enable the lens controls for anonymous users without offering any way to save the lens.

Details:

Here is a rough sketch of an implementation idea I came up with:

In the hamburger drop down for lenses, add an option for authors to "Permit anonymous interactions" or "Restrict anonymous interactions", which would set an "interactive" property on the LensObject similar to the public/private setting.

Then, when determining if the buttons can be clicked and results rendered, instead of only consulting userId == 'unknown', there would be an additional check to see if the lens was interactive, i.e., this.scalarLensObject.interactive == false. I have made a these changes in a feature branch of our fork which would need some work but gives you the basic idea: https://github.com/anvc/scalar/compare/master...UIUCLibrary:scalar:anon-interactive-lens

Is this a feasible route to pursue? It seems like there is a case already where a user who doesn't have author rights in the book can make a kind of temporary lens that isn't persisted, and they can then decide to save it as a duplicate (or not). If I'm describing that correctly, then the feature I propose would be a kind of subset of that behavior in which the only answer to "do you want to save this lens?" is "no".

eloyer commented 8 months ago

Thanks for bringing this up, this makes sense to me. Instead of adding another setting, I'd support making this the default behavior, along with a new message similar to the one logged-in users get, but saying something to the effect of "Since you're not logged in, your changes won't be saved" (this may have been what you were suggesting). Happy to review a PR to this effect.