controversies-of-science / react-worldviewer-app

(WIP) => { The Controversies of Science App. Currently includes controversy search and a swiping interface for structuring the crowdsourcing of information on controversies. }
https://www.controversiesofscience.com
1 stars 0 forks source link

Experiment with programmatic hash links #14

Open worldviewer opened 7 years ago

worldviewer commented 7 years ago

Some of the things that I'd really like to be able to do with these hash links are completely experimental ...

Hash Links

For going to specific parts of the page:

http://www.controversiesofscience.com/arp/worldview/text#footnotes
http://www.controversiesofscience.com/arp/worldview/text#footnote-1
http://www.controversiesofscience.com/arp/worldview/text#annotations
http://www.controversiesofscience.com/arp/worldview/text#paragraph-1
http://www.controversiesofscience.com/arp/worldview/text#<keyword>-quote
http://www.controversiesofscience.com/arp/worldview/text#quotes

The quote could be automatically mined from the quote's body by identifying the first non-stop-word label not already reserved as an id for that page. For instance, if the quote was ...

"'Space' was invented on Earth before we knew what was out there"

... the keyword would be space and the url would look like:

http://www.controversiesofscience.com/arp/worldview/text#space-quote

What would be ideal is even if the quote is broken up by paragraphs, there exists a span which can be used to identify the end of each quote, so that it can be selected, annotated and shared as a distinct unit.

And if there are other versions of the quote which might be better for sharing -- like with some words or content left out -- that they are also available:

http://www.controversiesofscience.com/arp/worldview/text#short-space-quote

With relevant image:

http://www.controversiesofscience.com/arp/worldview/text#short-space-quote-with-image

Or adding in a reference too:

http://www.controversiesofscience.com/arp/worldview/text#short-space-quote-with-image-and-reference

Or use to go straight to best comments:

http://www.controversiesofscience.com/arp#best-comments
http://www.controversiesofscience.com/arp#best-comment-1

One question is: On the /card route, if this should aggregate from all feeds and cards (probably).

Or best questions for a controversy card:

http://www.controversiesofscience.com/arp#best-questions

It might (?) make sense, in such cases, to redirect, so that content is not being duplicated across pages:

http://www.controversiesofscience.com/arp/propositional#best-questions

There is a discussion of how to handle hashes with React Router at:

https://github.com/ReactTraining/react-router/issues/394
https://github.com/rafrex/react-router-hash-link

What would be nice is to spawn a dynamic hash link handler in the event that a hash link is not found on the page.

User-Generated Zoom Hash Links

Another really nice feature would be to permit users to create their own zoom frame id's for a particular graphic which would not only take the site visitor to the controversy card image, but also zoom them into the frame that has been associated with that id. A user could create that frame and id by clicking a button while they are at some particular zoom level. If specified as "public", these frame snapshots could subsequently be invoked by other users because they would then list on the page under ...

http://www.controversiesofscience.com/arp/worldview/card#shares
http://www.controversiesofscience.com/arp/worldview/card#best-shares
http://www.controversiesofscience.com/arp/worldview/card#<user-specified keyword>-share
http://www.controversiesofscience.com/arp/worldview/card#ngc4603-share

I don't know how hard it would be to do that, but if it proves impossible, it is probably still an option to use a route:

http://www.controversiesofscience.com/arp/worldview/card/ngc4603-share

The thing about this is that the page cannot possibly contain all of these images (or even thumbnails) from former shares, so the way to do this would be to store them in an S3 bucket when they are generated, and then if a person goes to them, only then fetch them from the bucket.

Content-Based Shares

http://www.controversiesofscience.com/arp/worldview/text#short-space-quote-twitter-share

Possible?

Annotation Hash Links

An interesting question is where #annotations takes a person, since they are distributed across the page. And should there be an option to turn the annotations off?

http://www.controversiesofscience.com/arp/worldview/text?annotations=off

That could be useful in some situations.

Username Hash Links

http://www.controversiesofscience.com/arp/worldview/comments#juancalsiano

Ideally, this would scroll to that first of that particular user's comments, while graying out all others. And perhaps once it gets there, change the URL to ...

http://www.controversiesofscience.com/arp/worldview/comments#juancalsiano-1

All of this could be tricky to do since the person can of course have more than one comment, and yet we should only assign one single id on a page. It might be better to implement the content tagging as classnames, and see if I can interpret the hash link using React Router.

Rebuttal Hash Links

http://www.controversiesofscience.com/arp#best-rebuttals
http://www.controversiesofscience.com/arp#rebuttals
worldviewer commented 7 years ago

https://reacttraining.com/react-router/ https://github.com/ReactTraining/react-router/issues/394 https://github.com/rafrex/react-router-hash-link/blob/master/src/index.js