{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/114108279","pull_request_review_id":35549447,"id":114108279,"diff_hunk":"@@ -0,0 +1,93 @@\n+/**\n+ * External dependencies\n+ */\n+import { map, orderBy } from 'lodash';\n+import React, { PureComponent, PropTypes } from 'react';\n+import { connect } from 'react-redux';\n+import classNames from 'classnames';\n+\n+/**\n+ * Internal dependencies\n+ */\n+import QueryPostRevisions from 'components/data/query-post-revisions';\n+import EditorRevisionsListHeader from './header';\n+import {\n+\tgetPostRevision,\n+\tgetPostRevisions,\n+\tnormalizeForDisplay,\n+\tnormalizeForEditing,\n+} from 'state/posts/revisions/selectors';\n+import EditorRevisionsListItem from './item';\n+\n+class EditorRevisionsList extends PureComponent {\n+\tconstructor() {\n+\t\tsuper();\n+\t\tthis.loadRevision = this.loadRevision.bind( this );\n+\t}\n+\n+\tloadRevision() {\n+\t\tthis.props.loadRevision( this.props.selectedRevision );\n+\t}\n+\n+\tcomponentWillMount() {\n+\t\tif (\n+\t\t\tthis.props.selectedRevisionId === null &&\n+\t\t\tthis.props.revisions.length > 0\n+\t\t) {\n+\t\t\tthis.props.toggleRevision( this.props.revisions[ 0 ].id );\n+\t\t}\n+\t}\n+\n+\trender() {\n+\t\treturn (\n+\t\t\t<div>\n+\t\t\t\t<QueryPostRevisions siteId={ this.props.siteId } postId={ this.props.postId } />\n+\t\t\t\t<EditorRevisionsListHeader loadRevision={ this.loadRevision } />\n+\t\t\t\t<ul className=\"editor-revisions-list__list\">\n+\t\t\t\t\t{ map( this.props.revisions, revision => (\n+\t\t\t\t\t\t<li\n+\t\t\t\t\t\t\tclassName={ classNames(\n+\t\t\t\t\t\t\t\t'editor-revisions-list__revision',\n+\t\t\t\t\t\t\t\t{ selected: revision.id === this.props.selectedRevisionId }","path":"client/post-editor/editor-revisions-list/index.jsx","position":null,"original_position":51,"commit_id":"9346e71ca050cf1c9b7ec9da9595a8ba2746d1ca","original_commit_id":"a5ec9b718fc08929893791c7f6f7e0ad3e2349c1","user":{"login":"bperson","id":1145270,"avatar_url":"https://avatars3.githubusercontent.com/u/1145270?v=3","gravatar_id":"","url":"https://api.github.com/users/bperson","html_url":"https://github.com/bperson","followers_url":"https://api.github.com/users/bperson/followers","following_url":"https://api.github.com/users/bperson/following{/other_user}","gists_url":"https://api.github.com/users/bperson/gists{/gist_id}","starred_url":"https://api.github.com/users/bperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bperson/subscriptions","organizations_url":"https://api.github.com/users/bperson/orgs","repos_url":"https://api.github.com/users/bperson/repos","events_url":"https://api.github.com/users/bperson/events{/privacy}","received_events_url":"https://api.github.com/users/bperson/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2017-05-01T08:19:36Z","updated_at":"2017-05-01T08:19:36Z","html_url":"https://github.com/Automattic/wp-calypso/pull/13367#discussion_r114108279","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/114108279"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/13367#discussion_r114108279"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367","id":117454981,"html_url":"https://github.com/Automattic/wp-calypso/pull/13367","diff_url":"https://github.com/Automattic/wp-calypso/pull/13367.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/13367.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/13367","number":13367,"state":"open","locked":false,"title":"WIP: Post Editor: Revisions sidebar","user":{"login":"bperson","id":1145270,"avatar_url":"https://avatars3.githubusercontent.com/u/1145270?v=3","gravatar_id":"","url":"https://api.github.com/users/bperson","html_url":"https://github.com/bperson","followers_url":"https://api.github.com/users/bperson/followers","following_url":"https://api.github.com/users/bperson/following{/other_user}","gists_url":"https://api.github.com/users/bperson/gists{/gist_id}","starred_url":"https://api.github.com/users/bperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bperson/subscriptions","organizations_url":"https://api.github.com/users/bperson/orgs","repos_url":"https://api.github.com/users/bperson/repos","events_url":"https://api.github.com/users/bperson/events{/privacy}","received_events_url":"https://api.github.com/users/bperson/received_events","type":"User","site_admin":false},"body":"**WIP for the editor's Post Revisions UI.**\r\n\r\n- [x] \"child\" sidebar support\r\n- [x] listing revisions (still need to figure out how to get the author name instead of his ID)\r\n- [x] view revision (tap on one of the revisions in the sidebar)\r\n- [x] load revision in editor\r\n- [ ] raw HTML diff\r\n\r\n### Current issues\r\n- [ ] mobile: icon change in the top toolbar to the \"go back in time\" icon\r\n- [ ] mobile: sidebar header should be visible (and cover the editor's action bar) to make it possible to dismiss the revisions child sidebar.\r\n- [ ] first load: auto-select the first revision when data is available (instead of at mount) + placeholders in the revisions list / diff viewer\r\n- [ ] If you're scrolled in the editor, open the revisions sidebar and close it, you will loose your scroll position. (this scroll issue creates misplacement issues with TinyMCE's toolbar)\r\n- [ ] author ID but no author name\r\n\r\n### Open questions\r\n- Diff Viewer: display normalization for title remove html tags. If the revision is loaded in the editor, there isn't a 1:1 matching between what was shown in the diff viewer and what's then displayed in the editor.\r\n- When loading raw content into TinyMCE in html mode, some tags are visible (`<p>`, `<br />`). A double-switch -> \"Visual\" -> \"HTML\" will clear those tags. Is this an issue?\r\n- Loss of content when loading a revision in the editor:\r\n    - local autosave(s)?\r\n    - popup making sure the user is fine with \"loosing\" content not yet saved?\r\n\r\n### Further down the line (in subsequent PRs)\r\n- updated \"status\" sidebar accordion based on @folletto's design\r\n- support for pages / custom post types\r\n- \"rendered\" HTML diff (not sure)\r\n- display word count in the diff viewer and \"update\" it to the number of word in the revision currently being displayed\r\n\r\n### Screenshot\r\n![screen shot 2017-04-27 at 18 52 47](https://cloud.githubusercontent.com/assets/1145270/25494593/6f6adb20-2b7a-11e7-8327-4045faa5c4ca.png)","created_at":"2017-04-25T10:49:30Z","updated_at":"2017-05-01T08:19:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ad439cf87443a824069b6897e6fe49135855865","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/13367/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/9346e71ca050cf1c9b7ec9da9595a8ba2746d1ca","head":{"label":"Automattic:add/post-revisions-sidebar","ref":"add/post-revisions-sidebar","sha":"9346e71ca050cf1c9b7ec9da9595a8ba2746d1ca","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-05-01T02:16:07Z","pushed_at":"2017-05-01T08:19:26Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":61695,"stargazers_count":8700,"watchers_count":8700,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1124,"mirror_url":null,"open_issues_count":1915,"forks":1124,"open_issues":1915,"watchers":8700,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"8e55faf05833a22a3f95fce2209f83f87ef8b0ff","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-05-01T02:16:07Z","pushed_at":"2017-05-01T08:19:26Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":61695,"stargazers_count":8700,"watchers_count":8700,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1124,"mirror_url":null,"open_issues_count":1915,"forks":1124,"open_issues":1915,"watchers":8700,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/13367"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/13367"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/13367/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/13367/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/9346e71ca050cf1c9b7ec9da9595a8ba2746d1ca"}}}}
{"actor":{"display_login":"bperson"}}