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   as an alternative Permalink URL. It meets a lot of what users mean by "friendlier URLs".
 * unclear whether to show this on the page somewhere
 * unclear whether you see this as the URL or it redirects to the current Flow board?parameters URL.
 * The link from a topic back to its Flow board should paginate that topic into view
 * it's harder to make this a friendly URL
 * There are 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 but there's no easy syntax to do so.
 * 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" permalink URL?
Users say they 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
 * , plus optional

Brandon specified something like this in early Flow/LQT 3.0 discussions.

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 . That link should try to load the topic in context.

Fortunately we already have the machinery to support this, the pagination URL parameters in the _More topics_ link that you normally only follow if you disable JavaScript and 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. You can omit some parameters, I think you have to specify offset-dir=fwd, but there are so many parameters it's hard to fit it into a wiki link.
 * Maybe showing a Flow board starting at a topic could be another parameter to Special:Flow, e.g. Special:Flow/topic-in-board/ would do the right thing, or redirect to the pagination URL above.

Possible additions

 * investigate writing the scroll position/pagination/magic into the URL hash as you interact with a Flow board, 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.
 * 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