{"action":"created","comment":{"url":"https://api.github.com/repos/hypothesis/h/pulls/comments/26936506","id":26936506,"diff_hunk":"@@ -118,6 +121,9 @@ class AppController\n     $scope.clearSelection = ->\n       $scope.search.query = ''\n       annotationUI.clearSelectedAnnotations()\n+      crossframe.notify","path":"h/static/scripts/controllers.coffee","position":38,"original_position":38,"commit_id":"4d9f3459d2cbe9b4891a1bee694f8b2fd435e1b5","original_commit_id":"4d9f3459d2cbe9b4891a1bee694f8b2fd435e1b5","user":{"login":"csillag","id":2093792,"avatar_url":"https://avatars.githubusercontent.com/u/2093792?v=3","gravatar_id":"","url":"https://api.github.com/users/csillag","html_url":"https://github.com/csillag","followers_url":"https://api.github.com/users/csillag/followers","following_url":"https://api.github.com/users/csillag/following{/other_user}","gists_url":"https://api.github.com/users/csillag/gists{/gist_id}","starred_url":"https://api.github.com/users/csillag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csillag/subscriptions","organizations_url":"https://api.github.com/users/csillag/orgs","repos_url":"https://api.github.com/users/csillag/repos","events_url":"https://api.github.com/users/csillag/events{/privacy}","received_events_url":"https://api.github.com/users/csillag/received_events","type":"User","site_admin":false},"body":"> Something about this seems wrong to me. Specifically, the `annotationUI` service is supposed to be the canonical source of the annotation UI state. That means that we shouldn't have to call two different methods to call in order to clear the selection in both frames.\r\n\r\nI agree that it would be nicer if we should only talk to a single component.\r\n\r\n> Perhaps the right thing to do is to move the `annotationUI` mutator method into a listener in `annotationUISync`, so that only the crossframe call is here.\r\n\r\nTo make that work, we would have to teach the host side to echo these messages back to the sidebar. I would evaluate other approaches, too. What about teaching `AnnotatorUI` to transmit the selection info the the host side using the crossframe service?","created_at":"2015-03-23T13:42:11Z","updated_at":"2015-03-23T13:42:11Z","html_url":"https://github.com/hypothesis/h/pull/2036#discussion_r26936506","pull_request_url":"https://api.github.com/repos/hypothesis/h/pulls/2036","_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments/26936506"},"html":{"href":"https://github.com/hypothesis/h/pull/2036#discussion_r26936506"},"pull_request":{"href":"https://api.github.com/repos/hypothesis/h/pulls/2036"}}},"pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/2036","id":31127870,"html_url":"https://github.com/hypothesis/h/pull/2036","diff_url":"https://github.com/hypothesis/h/pull/2036.diff","patch_url":"https://github.com/hypothesis/h/pull/2036.patch","issue_url":"https://api.github.com/repos/hypothesis/h/issues/2036","number":2036,"state":"open","locked":false,"title":"Add emphasis to selected annotations","user":{"login":"csillag","id":2093792,"avatar_url":"https://avatars.githubusercontent.com/u/2093792?v=3","gravatar_id":"","url":"https://api.github.com/users/csillag","html_url":"https://github.com/csillag","followers_url":"https://api.github.com/users/csillag/followers","following_url":"https://api.github.com/users/csillag/following{/other_user}","gists_url":"https://api.github.com/users/csillag/gists{/gist_id}","starred_url":"https://api.github.com/users/csillag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csillag/subscriptions","organizations_url":"https://api.github.com/users/csillag/orgs","repos_url":"https://api.github.com/users/csillag/repos","events_url":"https://api.github.com/users/csillag/events{/privacy}","received_events_url":"https://api.github.com/users/csillag/received_events","type":"User","site_admin":false},"body":"### Current behavior:\r\n\r\nCurrently, we have the following methods for selecting a specific set of annotations:\r\n - Click on the highlight (when always-on mode is on)\r\n - Click on the bar on the bucket bar.\r\n\r\nWhen a set of annotations is selected, their cards will be visible in the sidebar,\r\nand everything else will be hidden. The contents of the sidebar doesn't change,\r\neven if the user scrolls the document.\r\n\r\n### Proposed change:\r\n\r\nThis PR adds the following extra behavior:\r\n\r\nThe highlights belonging to the selected annotations stays visible in the document,\r\neven if always-on mode is off, and even if the pointer is not currently hovering\r\nover the annotation card.\r\n\r\n(As described in #800 )\r\n\r\n### Todo:\r\n\r\n - The styling is not intended to be final. Someone who cares about colors should\r\n   devise the best color scheme, taking into account all highlight states.\r\n   (focus, always-on mode, and selection.)\r\n - Maybe this could be extended to search, too.\r\n   (Currently, search is not impacted at all.)\r\n\r\n  * * *\r\n\r\nThe tests have been updated, and new tests have been added to cover the new functionality.\r\n\r\n","created_at":"2015-03-13T14:02:39Z","updated_at":"2015-03-23T13:42:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6489cc6f86d2cc81abd7666d7166d5a4c223db3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hypothesis/h/pulls/2036/commits","review_comments_url":"https://api.github.com/repos/hypothesis/h/pulls/2036/comments","review_comment_url":"https://api.github.com/repos/hypothesis/h/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/2036/comments","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/4d9f3459d2cbe9b4891a1bee694f8b2fd435e1b5","head":{"label":"hypothesis:800-fancy-selected-annotations","ref":"800-fancy-selected-annotations","sha":"4d9f3459d2cbe9b4891a1bee694f8b2fd435e1b5","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"The Internet, peer reviewed.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","created_at":"2012-04-02T19:56:59Z","updated_at":"2015-03-23T13:33:51Z","pushed_at":"2015-03-23T13:39:16Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":44867,"stargazers_count":397,"watchers_count":397,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":149,"forks":100,"open_issues":149,"watchers":397,"default_branch":"master"}},"base":{"label":"hypothesis:master","ref":"master","sha":"3ca71c6d7463d8d6f2986fa7f6079a6722b27d1f","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"The Internet, peer reviewed.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","created_at":"2012-04-02T19:56:59Z","updated_at":"2015-03-23T13:33:51Z","pushed_at":"2015-03-23T13:39:16Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":44867,"stargazers_count":397,"watchers_count":397,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":149,"forks":100,"open_issues":149,"watchers":397,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/2036"},"html":{"href":"https://github.com/hypothesis/h/pull/2036"},"issue":{"href":"https://api.github.com/repos/hypothesis/h/issues/2036"},"comments":{"href":"https://api.github.com/repos/hypothesis/h/issues/2036/comments"},"review_comments":{"href":"https://api.github.com/repos/hypothesis/h/pulls/2036/comments"},"review_comment":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hypothesis/h/pulls/2036/commits"},"statuses":{"href":"https://api.github.com/repos/hypothesis/h/statuses/4d9f3459d2cbe9b4891a1bee694f8b2fd435e1b5"}}}}