{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3918","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3918/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3918/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3918/events","html_url":"https://github.com/Automattic/wp-calypso/pull/3918","id":139694741,"number":3918,"title":"Framework/CPT: Track current page title in Redux state","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Custom%20Post%20Types%20(CPT)","name":"Custom Post Types (CPT)","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Framework","name":"Framework","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20In%20Progress","name":"[Status] In Progress","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-09T20:39:54Z","updated_at":"2016-03-31T21:21:12Z","closed_at":"2016-03-31T21:21:12Z","pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3918","html_url":"https://github.com/Automattic/wp-calypso/pull/3918","diff_url":"https://github.com/Automattic/wp-calypso/pull/3918.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/3918.patch"},"body":"This pull request seeks to implement new state behaviors and bindings for tracking the current page title in the global application state. Specifically, it includes a new action and reducer pair, a `<QueryTitle />` query component for assigning title, and bindings necessary to interoperate with the existing Flux-based [`screen-title` store](https://github.com/Automattic/wp-calypso/tree/master/client/lib/screen-title).\r\n\r\n__Background:__\r\n\r\nCustom post type labels can be localized. The localized label should be used in the `<title>` element of the page. The labels are accessed on the post types tracked in global application state. Rather than subscribe to state from the controller, it seems more reasonable to adopt our newer [query component pattern](https://github.com/Automattic/wp-calypso/blob/master/docs/our-approach-to-data.md#query-components) in assigning title to state via a rendered component at the top of the section render hierarchy.\r\n\r\n__Implementation notes:__\r\n\r\nSince many sections continue to rely on the `screen-title` Flux store, the title tracked in state may become inaccurate as the user navigates through the application, even with these changes. For example, after navigating from Types listing to stats, `state.ui.title` will continue to be assigned as \"Custom Post Type\". This issue will be alleviated if more sections adopt the Redux state approach introduced here.\r\n\r\n__Testing instructions:__\r\n\r\nEnsure that the title is updated correctly when navigating to the Custom Post Types route for a site. You must navigate to the URL directly in your development environment, as there are no navigable links yet available.\r\n\r\n1. Navigate to [Calypso custom post types listing](http://calypso.localhost:3000/types/jetpack-portfolio) (e.g. portfolio)\r\n2. Select a site\r\n3. Note that the tab title reflects both \"Custom Post Types\" and the title of the selected site\r\n4. Click Switch Sites in the sidebar navigation\r\n5. Select a site\r\n6. Note that the tab title reflects both \"Custom Post Types\" and the title of the selected site\r\n7. Navigate to another page in Calypso\r\n8. Note that the tab title reflects the section you chose"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/204134478","html_url":"https://github.com/Automattic/wp-calypso/pull/3918#issuecomment-204134478","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3918","id":204134478,"user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T21:21:12Z","updated_at":"2016-03-31T21:21:12Z","body":"Closing in favor of #4090 and #4396."}}