{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/74471019","id":74471019,"diff_hunk":"@@ -39,38 +34,17 @@ export function getUnreadCount( state ) {\n  * @return {?String}        Formatted title\n  */\n export function getFormattedTitle( state ) {\n-\tconst unreadCount = getUnreadCount( state );\n-\tconst titleAndSiteName = getTitleAndSiteName( state );\n-\n-\tconst titleParts = [];\n+\tlet title = '';\n \n+\tconst unreadCount = getUnreadCount( state );\n \tif ( unreadCount ) {\n-\t\ttitleParts.push( '(' + unreadCount + ')' );\n-\t}\n-\n-\tif ( titleAndSiteName ) {\n-\t\ttitleParts.push( titleAndSiteName );\n+\t\ttitle += `(${ unreadCount }) `;\n \t}\n \n-\tconst leftTitlePart = titleParts.join( ' ' );\n-\treturn [ decodeEntities( leftTitlePart ), 'WordPress.com' ].join( ' — ' );\n-}\n-\n-function getTitleAndSiteName( state ) {\n-\tconst siteSpecificGroups = [ 'sites', 'editor' ];\n-\tconst title = getTitle( state );\n-\tconst siteId = getSelectedSiteId( state );\n-\tconst siteTitle = getSiteTitle( state, siteId );\n-\tconst titleParts = [];\n-\n-\tif ( title ) {\n-\t\ttitleParts.push( title );\n-\t}\n-\n-\t// Display site name as title part only if we're in 'My Sites'\n-\tif ( includes( siteSpecificGroups, getSectionGroup( state ) ) && siteId ) {\n-\t\ttitleParts.push( siteTitle );\n-\t}\n+\ttitle += [\n+\t\tgetTitle( state ),\n+\t\tisSiteSection( state ) && getSiteTitle( state, getSelectedSiteId( state ) )\n+\t].filter( Boolean ).join( ' ‹ ' );","path":"client/state/document-head/selectors.js","position":null,"original_position":57,"commit_id":"2816fbe55218ded02015d7d779000d4ef69984e0","original_commit_id":"2816fbe55218ded02015d7d779000d4ef69984e0","user":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"body":"Oh wow, didn't know that `.filter( Boolean )` trick. Love it. Much more concise now than with all the `if`s and `push`es.","created_at":"2016-08-11T17:58:27Z","updated_at":"2016-08-11T17:58:27Z","html_url":"https://github.com/Automattic/wp-calypso/pull/7224#discussion_r74471019","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/74471019"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/7224#discussion_r74471019"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224","id":79760840,"html_url":"https://github.com/Automattic/wp-calypso/pull/7224","diff_url":"https://github.com/Automattic/wp-calypso/pull/7224.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/7224.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/7224","number":7224,"state":"open","locked":false,"title":"Framework: Dump `lib/screen-title` in favor of its Redux counterpart","user":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"body":"Or, in more detail:\r\n\r\n* Add `getTitle`, `getUnreadCount`, and `getFormattedTitle` selectors (and tests) to `state/document-head`.\r\n* Add `getSectionGroup` selector to `state/ui` (for use by `getFormattedTitle`).\r\n* Remove `document-head` middleware.\r\n* Remove `TitleStore` listener from `client/boot`.\r\n* Instead, `subscribe` a `document.title` setter to the Redux store.\r\n* Replace `lib/screen-title`'s actions with their Redux counterpart (along with a `FIXME` note advising to use `DocumentHead`)\r\n* Remove the `options` parameter from `setTitle` calls. **This is the most critical change here.** Theoretically, `document-head` will fall back to the currently selected site, but since `options` was in some cases used... creatively to set that part of the title to arbitrary strings, this might have broken in cases that want the title to reflect something else (e.g. domains).\r\n* Reader is a bit of a special case because of its  `setPageTitle` helper. I opted to add a `context` arg to that function so it could `context.store.dispatch` the Redux action when called from within a controller; in JSX files, I replaced `this.props.setPageTitle` by `<DocumentHead>` components except for one instance (`FullPost`) where I `connect`ed `setTitle` instead, which seemed easier there.\r\n* Remove `components/data/screen-title`\r\n* Remove `lib/screen-title`\r\n\r\nTo test:\r\n* In a section you're familiar with, verify that clicking around between different screens updates the title as on `master`. (Maybe open two tabs, one with this branch, and one with wpcalypso, and perform the same actions in both.)\r\n* In mobile mode, check that the `SidebarNavigation` header is updated correctly as well (displaying the correct section title in `/me`  and `/my-sites`).\r\n\r\nCC'ing for review:\r\n- [ ] @aduth \r\n- [ ] @blowery for Reader\r\n- [ ] @klimeryk for Domains\r\n- [ ] @scottsweb for VIP\r\n\r\nCloses #3796.\r\n\r\nTest live: https://calypso.live/?branch=remove/screen-title-flux-lib","created_at":"2016-08-02T15:54:48Z","updated_at":"2016-08-11T17:58:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09fe83ca40c7f4251493ba36f4431d6ae30b2f5b","assignee":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"assignees":[{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224/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/7224/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/2816fbe55218ded02015d7d779000d4ef69984e0","head":{"label":"Automattic:remove/screen-title-flux-lib","ref":"remove/screen-title-flux-lib","sha":"2816fbe55218ded02015d7d779000d4ef69984e0","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.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://avatars.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":"2016-08-11T11:50:05Z","pushed_at":"2016-08-11T17:57:15Z","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":84428,"stargazers_count":7685,"watchers_count":7685,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":968,"mirror_url":null,"open_issues_count":1431,"forks":968,"open_issues":1431,"watchers":7685,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"80c79a9915dc3b6450557b4651cbc64708530338","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.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://avatars.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":"2016-08-11T11:50:05Z","pushed_at":"2016-08-11T17:57:15Z","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":84428,"stargazers_count":7685,"watchers_count":7685,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":968,"mirror_url":null,"open_issues_count":1431,"forks":968,"open_issues":1431,"watchers":7685,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/7224"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/7224"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/7224/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/7224/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/7224/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/2816fbe55218ded02015d7d779000d4ef69984e0"}}}}
{"actor":{"display_login":"ockham"}}