Flow/Architecture/URLs

Users are telling us "I want friendlier URLs". What does this mean, what can we do?

tl;dr
 * we should implement , plus optional
 * unclear whether to show this on the page somewhere
 * unclear whether you see this as the URL or it redirects to a Flow board URL
 * links from a topic back to its Flow board should paginate that topic into view
 * lots of other things we could do.

User wants

 * Users want to share URLs to topics and posts
 * Users want to wiki link to topics and posts, but query string parameters force them to insert http links.
 * Ideally something in the URL or the text of a permalink page would be copy-pasteable into  the same way the h1 heading of this page works as a wiki link.
 * More sophisticated users want to be able to work with UUIDs
 * If Flow is disabled for a page, the topics and posts for it remain in the system but there's no way to view them.
 * Users sometimes want to link to a particular version of a topic or post.

What's a "friendlier" URL?
Users want friendlier URLs than the current Permalink to a post:
 * https://www.mediawiki.org/w/index.php?title=Talk:Flow&workflow=050b94781344bd50ee7e782bcb087d2e#flow-post-050b97625481034818d4782bcb077299

There are several things people mean by this
 * UUIDs are long - Patches are coming to reduce this to 15 characters
 * Because of the query string, this has to be an external link
 * You can't paste this into
 * The /w/index.php? is noise, it could be /wiki/Flow board.
 * UUIDs are meaningless - "Other discussion systems have URLs like /topic/x/I-brought-some-kitties, do that!"
 * "Why isn't the topic heading a working wiki link?"
 * "The link should include the board" / "I don't care about the board"

The URL is actually and because a post is associated with a topic that is associated with the board on which it was created, it simplifies down to
 * blah blah Flow board blah blah topic UUID blah blah post UUID
 * "Show me Flow topic/post  in its natural context"

A relatively easy step that meets most of these wants is

Fancy Web 3.0 systems update the URL fragment (the part of the URL after the hash  symbol) as you move around. We could and probably will do that as well, but we want to work in non-JavaScript.

Postulates

 * In the database, a topic is associated with the page on which it was first created.
 * Topics can appear on more than one board (e.g. Feeds), but we haven't exercised this.
 * Topics need to be associated with a board, so that things like  and
 * Topics don't have a natural order within a page; because they can (some day) appear on multiple pages, because of infinite scroll, because of (some day) options to re-sort and filter board appearance.

Pagination URLs

 * When you view a topic, it has a link back to its Flow board, This topic was started on Sandbox  line. That link should try to load the topic in context.

You can render a Flow board starting at a particular topic. (This is usually hidden if you have JavaScript enabled, because of automatic infinite scroll) http://ee-flow.wmflabs.org/w/index.php ?title=Talk:Flow_bugs &topic_list[offset-id]=050adf7af4bff00fc8b1fa163e68c4ac &topic_list[offset-dir]=fwd &topic_list[limit]=10 &workflow=050a09d20c6b34dffb6efa163e68c4ac

Some users will want this URL to be "friendlier", in all the senses above.

It would be nice to be able to reduce this. I think you have to specify offset-dir=fwd.

Possible additions

 * investigate writing the scroll position/pagination/magic into the URL hash, the way Gmail and other Web 2.0 apps do.
 * So if you follow a link to a different URL (such as a permalink), then use the back button, you would be returned to more or less the state you were in.
 * - this would only works if JavaScript is enabled.
 * Implement Special:Flow/ that will load any UUID and show it appropriately, even if its page is no longer Flow-enabled.
 * What happens to and subpage links?
 * Would editing and replies work?
 * Would this work but redirect you to the longer URL?

Issues

 * Currently loading a topic loads all its posts. We may need eventually to incrementally load posts, so we have the same problem of ensuring a particular post is visible.
 * If we only indicate the post in the fragment hash, then it won't work in browsers with JavaScript disabled.
 * Suggests we should implement Special:Flow/post/ or even a "smart" Special:Flow/uuid/ that shows the item in the appropriate context.
 * Flow Portal/Functional Specifications/Boards and Topics specifies something more elaborate than the current permalink:
 * a modal dialog that will display several options for the user wherein they may obtain a permanent link to the Topic.
 * A full URL to the single Topic (good forever)
 * A full URL to the single Topic as it exists at that point in time
 * A local (wikitext) link to the single Topic (good forever)
 * A local (wikitext) link to the single Topic as it exists at that point in time