{"action":"created","comment":{"url":"https://api.github.com/repos/loomio/loomio/pulls/comments/31110626","id":31110626,"diff_hunk":"@@ -10,24 +10,23 @@ angular.module('loomioApp').directive 'activityCard', ->\n     $scope.lastLoadedSequenceId = 0\n     $scope.newActivitySequenceId = $scope.discussion.reader().lastReadSequenceId + 1\n     visibleSequenceIds = []\n-    rollback = 2\n \n     $scope.init = ->\n       $scope.discussion.markAsRead(0)\n \n       target = _.parseInt($location.hash())\n-      if target >= $scope.discussion.firstSequenceId and target < $scope.discussion.lastSequenceId \n-        # valid sequence id is specified in url\n-        $scope.initialLoaded  = _.max [target - rollback, 0]\n-        $scope.initialFocused = target\n-      else if $scope.discussion.isUnread()\n+      # if target >= $scope.discussion.firstSequenceId and target < $scope.discussion.lastSequenceId \n+      #   # valid sequence id is specified in url\n+      #   $scope.initialLoaded  = _.max [target - rollback, 0]\n+      #   $scope.initialFocused = target\n+      if $scope.discussion.isUnread()\n         # discussion is unread\n-        $scope.initialLoaded  = _.max [$scope.discussion.reader().lastReadSequenceId - rollback, 0]\n-        $scope.initialFocused = $scope.initialLoaded + rollback\n+        $scope.initialLoaded  = _.max [$scope.discussion.reader().lastReadSequenceId - 1, 0]\n+        $scope.initialFocused = $scope.discussion.reader().lastReadSequenceId + 1\n       else\n         # discussion is read\n         $scope.initialLoaded  = _.max [$scope.discussion.lastSequenceId - $scope.pageSize + 1, 0]\n-        $scope.initialFocused = _.max [$scope.discussion.lastSequenceId - rollback, 0]\n+        $scope.initialFocused = $scope.discussion.lastSequenceId","path":"lineman/app/components/thread_page/activity_card/activity_card.coffee","position":29,"original_position":29,"commit_id":"a364552992eb61b613cf781436e4c32565017c51","original_commit_id":"a364552992eb61b613cf781436e4c32565017c51","user":{"login":"gdpelican","id":750477,"avatar_url":"https://avatars.githubusercontent.com/u/750477?v=3","gravatar_id":"","url":"https://api.github.com/users/gdpelican","html_url":"https://github.com/gdpelican","followers_url":"https://api.github.com/users/gdpelican/followers","following_url":"https://api.github.com/users/gdpelican/following{/other_user}","gists_url":"https://api.github.com/users/gdpelican/gists{/gist_id}","starred_url":"https://api.github.com/users/gdpelican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdpelican/subscriptions","organizations_url":"https://api.github.com/users/gdpelican/orgs","repos_url":"https://api.github.com/users/gdpelican/repos","events_url":"https://api.github.com/users/gdpelican/events{/privacy}","received_events_url":"https://api.github.com/users/gdpelican/received_events","type":"User","site_admin":false},"body":"The  newActivitySequenceId actually has the same problem at the moment:\r\n\r\n```\r\n  $scope.newActivitySequenceId = $scope.discussion.reader().lastReadSequenceId + 1\r\n```\r\n\r\n```\r\n  .activity-card__new-activity{ng-if: 'event.sequenceId == newActivitySequenceId'}\r\n```","created_at":"2015-05-27T07:58:33Z","updated_at":"2015-05-27T07:58:33Z","html_url":"https://github.com/loomio/loomio/pull/2198#discussion_r31110626","pull_request_url":"https://api.github.com/repos/loomio/loomio/pulls/2198","_links":{"self":{"href":"https://api.github.com/repos/loomio/loomio/pulls/comments/31110626"},"html":{"href":"https://github.com/loomio/loomio/pull/2198#discussion_r31110626"},"pull_request":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2198"}}},"pull_request":{"url":"https://api.github.com/repos/loomio/loomio/pulls/2198","id":36276404,"html_url":"https://github.com/loomio/loomio/pull/2198","diff_url":"https://github.com/loomio/loomio/pull/2198.diff","patch_url":"https://github.com/loomio/loomio/pull/2198.patch","issue_url":"https://api.github.com/repos/loomio/loomio/issues/2198","number":2198,"state":"open","locked":false,"title":"Ensure page load thread position","user":{"login":"gdpelican","id":750477,"avatar_url":"https://avatars.githubusercontent.com/u/750477?v=3","gravatar_id":"","url":"https://api.github.com/users/gdpelican","html_url":"https://github.com/gdpelican","followers_url":"https://api.github.com/users/gdpelican/followers","following_url":"https://api.github.com/users/gdpelican/following{/other_user}","gists_url":"https://api.github.com/users/gdpelican/gists{/gist_id}","starred_url":"https://api.github.com/users/gdpelican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdpelican/subscriptions","organizations_url":"https://api.github.com/users/gdpelican/orgs","repos_url":"https://api.github.com/users/gdpelican/repos","events_url":"https://api.github.com/users/gdpelican/events{/privacy}","received_events_url":"https://api.github.com/users/gdpelican/received_events","type":"User","site_admin":false},"body":"\r\n- Ensure page scroll happens after events & proposals are loaded\r\n- Take out support for location hashes for now\r\n- Ensure record is in clientside db before scrolling","created_at":"2015-05-27T07:36:03Z","updated_at":"2015-05-27T07:58:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec07b1ecb294518bdee1e907db0bb52d2434f906","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/loomio/loomio/pulls/2198/commits","review_comments_url":"https://api.github.com/repos/loomio/loomio/pulls/2198/comments","review_comment_url":"https://api.github.com/repos/loomio/loomio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/loomio/loomio/issues/2198/comments","statuses_url":"https://api.github.com/repos/loomio/loomio/statuses/a364552992eb61b613cf781436e4c32565017c51","head":{"label":"loomio:ensure-thread-load-position","ref":"ensure-thread-load-position","sha":"a364552992eb61b613cf781436e4c32565017c51","user":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"repo":{"id":2731301,"name":"loomio","full_name":"loomio/loomio","owner":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/loomio/loomio","description":"Loomio is an open-source web application that helps groups make better decisions together.","fork":false,"url":"https://api.github.com/repos/loomio/loomio","forks_url":"https://api.github.com/repos/loomio/loomio/forks","keys_url":"https://api.github.com/repos/loomio/loomio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loomio/loomio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loomio/loomio/teams","hooks_url":"https://api.github.com/repos/loomio/loomio/hooks","issue_events_url":"https://api.github.com/repos/loomio/loomio/issues/events{/number}","events_url":"https://api.github.com/repos/loomio/loomio/events","assignees_url":"https://api.github.com/repos/loomio/loomio/assignees{/user}","branches_url":"https://api.github.com/repos/loomio/loomio/branches{/branch}","tags_url":"https://api.github.com/repos/loomio/loomio/tags","blobs_url":"https://api.github.com/repos/loomio/loomio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loomio/loomio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loomio/loomio/git/refs{/sha}","trees_url":"https://api.github.com/repos/loomio/loomio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loomio/loomio/statuses/{sha}","languages_url":"https://api.github.com/repos/loomio/loomio/languages","stargazers_url":"https://api.github.com/repos/loomio/loomio/stargazers","contributors_url":"https://api.github.com/repos/loomio/loomio/contributors","subscribers_url":"https://api.github.com/repos/loomio/loomio/subscribers","subscription_url":"https://api.github.com/repos/loomio/loomio/subscription","commits_url":"https://api.github.com/repos/loomio/loomio/commits{/sha}","git_commits_url":"https://api.github.com/repos/loomio/loomio/git/commits{/sha}","comments_url":"https://api.github.com/repos/loomio/loomio/comments{/number}","issue_comment_url":"https://api.github.com/repos/loomio/loomio/issues/comments{/number}","contents_url":"https://api.github.com/repos/loomio/loomio/contents/{+path}","compare_url":"https://api.github.com/repos/loomio/loomio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loomio/loomio/merges","archive_url":"https://api.github.com/repos/loomio/loomio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loomio/loomio/downloads","issues_url":"https://api.github.com/repos/loomio/loomio/issues{/number}","pulls_url":"https://api.github.com/repos/loomio/loomio/pulls{/number}","milestones_url":"https://api.github.com/repos/loomio/loomio/milestones{/number}","notifications_url":"https://api.github.com/repos/loomio/loomio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loomio/loomio/labels{/name}","releases_url":"https://api.github.com/repos/loomio/loomio/releases{/id}","created_at":"2011-11-08T03:27:12Z","updated_at":"2015-05-25T10:42:15Z","pushed_at":"2015-05-27T07:56:41Z","git_url":"git://github.com/loomio/loomio.git","ssh_url":"git@github.com:loomio/loomio.git","clone_url":"https://github.com/loomio/loomio.git","svn_url":"https://github.com/loomio/loomio","homepage":"www.loomio.org","size":164966,"stargazers_count":907,"watchers_count":907,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"open_issues_count":78,"forks":292,"open_issues":78,"watchers":907,"default_branch":"master"}},"base":{"label":"loomio:master","ref":"master","sha":"51e6a3e344ab371175eb63750b2f4d82b882b9b8","user":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"repo":{"id":2731301,"name":"loomio","full_name":"loomio/loomio","owner":{"login":"loomio","id":1896739,"avatar_url":"https://avatars.githubusercontent.com/u/1896739?v=3","gravatar_id":"","url":"https://api.github.com/users/loomio","html_url":"https://github.com/loomio","followers_url":"https://api.github.com/users/loomio/followers","following_url":"https://api.github.com/users/loomio/following{/other_user}","gists_url":"https://api.github.com/users/loomio/gists{/gist_id}","starred_url":"https://api.github.com/users/loomio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loomio/subscriptions","organizations_url":"https://api.github.com/users/loomio/orgs","repos_url":"https://api.github.com/users/loomio/repos","events_url":"https://api.github.com/users/loomio/events{/privacy}","received_events_url":"https://api.github.com/users/loomio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/loomio/loomio","description":"Loomio is an open-source web application that helps groups make better decisions together.","fork":false,"url":"https://api.github.com/repos/loomio/loomio","forks_url":"https://api.github.com/repos/loomio/loomio/forks","keys_url":"https://api.github.com/repos/loomio/loomio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loomio/loomio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loomio/loomio/teams","hooks_url":"https://api.github.com/repos/loomio/loomio/hooks","issue_events_url":"https://api.github.com/repos/loomio/loomio/issues/events{/number}","events_url":"https://api.github.com/repos/loomio/loomio/events","assignees_url":"https://api.github.com/repos/loomio/loomio/assignees{/user}","branches_url":"https://api.github.com/repos/loomio/loomio/branches{/branch}","tags_url":"https://api.github.com/repos/loomio/loomio/tags","blobs_url":"https://api.github.com/repos/loomio/loomio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loomio/loomio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loomio/loomio/git/refs{/sha}","trees_url":"https://api.github.com/repos/loomio/loomio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loomio/loomio/statuses/{sha}","languages_url":"https://api.github.com/repos/loomio/loomio/languages","stargazers_url":"https://api.github.com/repos/loomio/loomio/stargazers","contributors_url":"https://api.github.com/repos/loomio/loomio/contributors","subscribers_url":"https://api.github.com/repos/loomio/loomio/subscribers","subscription_url":"https://api.github.com/repos/loomio/loomio/subscription","commits_url":"https://api.github.com/repos/loomio/loomio/commits{/sha}","git_commits_url":"https://api.github.com/repos/loomio/loomio/git/commits{/sha}","comments_url":"https://api.github.com/repos/loomio/loomio/comments{/number}","issue_comment_url":"https://api.github.com/repos/loomio/loomio/issues/comments{/number}","contents_url":"https://api.github.com/repos/loomio/loomio/contents/{+path}","compare_url":"https://api.github.com/repos/loomio/loomio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loomio/loomio/merges","archive_url":"https://api.github.com/repos/loomio/loomio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loomio/loomio/downloads","issues_url":"https://api.github.com/repos/loomio/loomio/issues{/number}","pulls_url":"https://api.github.com/repos/loomio/loomio/pulls{/number}","milestones_url":"https://api.github.com/repos/loomio/loomio/milestones{/number}","notifications_url":"https://api.github.com/repos/loomio/loomio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loomio/loomio/labels{/name}","releases_url":"https://api.github.com/repos/loomio/loomio/releases{/id}","created_at":"2011-11-08T03:27:12Z","updated_at":"2015-05-25T10:42:15Z","pushed_at":"2015-05-27T07:56:41Z","git_url":"git://github.com/loomio/loomio.git","ssh_url":"git@github.com:loomio/loomio.git","clone_url":"https://github.com/loomio/loomio.git","svn_url":"https://github.com/loomio/loomio","homepage":"www.loomio.org","size":164966,"stargazers_count":907,"watchers_count":907,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"open_issues_count":78,"forks":292,"open_issues":78,"watchers":907,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2198"},"html":{"href":"https://github.com/loomio/loomio/pull/2198"},"issue":{"href":"https://api.github.com/repos/loomio/loomio/issues/2198"},"comments":{"href":"https://api.github.com/repos/loomio/loomio/issues/2198/comments"},"review_comments":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2198/comments"},"review_comment":{"href":"https://api.github.com/repos/loomio/loomio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/loomio/loomio/pulls/2198/commits"},"statuses":{"href":"https://api.github.com/repos/loomio/loomio/statuses/a364552992eb61b613cf781436e4c32565017c51"}}}}