{"action":"created","comment":{"url":"https://api.github.com/repos/ome/omero-iviewer/pulls/comments/218753872","pull_request_review_id":156757055,"id":218753872,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODc1Mzg3Mg==","diff_hunk":"@@ -480,35 +510,59 @@ export default class ThumbnailSlider extends EventSubscriber {\n     }\n \n     /**\n-     * Adds thumbnails to then be loaded.\n+     * Adds thumbnails with Image IDs to this.thumbnails array.\n+     * We create a new list from old, replacing the thumbnails (instead of\n+     * modifying the old list) to make sure the changes is observed and\n+     * UI updates.\n      *\n      * @param {Array.<Object>} thumbnails the thumbnails to be added\n-     * @param {boolean} append if true thumbnails are appended,\n-     *                         otherwise inserted at the beginning\n-     * @param {boolean} skip_decrement if true we don't decrement (first fetch)\n+     * @param {number} start_index Index to start replacing\n      * @memberof ThumbnailSlider\n      */\n-    addThumbnails(thumbnails, append = true, skip_decrement = false) {\n+    addThumbnails(thumbnails, start_index) {\n         // if we are remote we include the server\n         let thumbPrefix =\n             (this.context.server !== \"\" ? this.context.server + \"/\" : \"\") +\n-            this.gateway_prefix + \"/render_thumbnail/\";\n-        if (!append) thumbnails.reverse();\n-\n-        thumbnails.map((item) => {\n-            let id = item['@id'];\n-            let entry = {\n-                id: id,\n-                url: thumbPrefix + id + \"/\",\n-                title: typeof item.Name === 'string' ? item.Name : id,\n-                revision : 0\n-            }\n-            if (append) {\n-                this.thumbnails.push(entry);\n-                this.thumbnails_end_index++;\n+            this.webclient_prefix + \"/render_thumbnail/\";\n+\n+        let new_index = 0;\n+        this.thumbnails = this.thumbnails.map((thumb, idx) => {\n+            if ((idx === start_index + new_index) && (new_index < thumbnails.length)) {\n+                let t = thumbnails[new_index];\n+                new_index++;\n+                return {\n+                    id: t['@id'],\n+                    url: thumbPrefix + t['@id'] + \"/\",\n+                    title: typeof t.Name === 'string' ? t.Name : t['@id'],\n+                    revision : 0\n+                }\n             } else {\n-                this.thumbnails.unshift(entry);\n-                if (!skip_decrement) this.thumbnails_start_index--;\n+                return thumb;\n+            }\n+        });\n+    }\n+\n+    /**\n+     * Adds thumbnails with Image IDs to this.thumbnails array.\n+     * We create a new list from old, replacing the thumbnails (instead of\n+     * modifying the old list) to make sure the changes is observed and\n+     * UI updates.\n+     *\n+     * @param {Array.<Object>} thumbnails the thumbnails to be added","path":"src/app/thumbnail-slider.js","position":459,"original_position":459,"commit_id":"5ab99bebe1068e440367239fcae2487b7919b146","original_commit_id":"5ab99bebe1068e440367239fcae2487b7919b146","user":{"login":"jburel","id":1022396,"node_id":"MDQ6VXNlcjEwMjIzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1022396?v=4","gravatar_id":"","url":"https://api.github.com/users/jburel","html_url":"https://github.com/jburel","followers_url":"https://api.github.com/users/jburel/followers","following_url":"https://api.github.com/users/jburel/following{/other_user}","gists_url":"https://api.github.com/users/jburel/gists{/gist_id}","starred_url":"https://api.github.com/users/jburel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jburel/subscriptions","organizations_url":"https://api.github.com/users/jburel/orgs","repos_url":"https://api.github.com/users/jburel/repos","events_url":"https://api.github.com/users/jburel/events{/privacy}","received_events_url":"https://api.github.com/users/jburel/received_events","type":"User","site_admin":false},"body":"thumbnails not a parameter","created_at":"2018-09-19T10:40:58Z","updated_at":"2018-09-19T10:41:43Z","html_url":"https://github.com/ome/omero-iviewer/pull/207#discussion_r218753872","pull_request_url":"https://api.github.com/repos/ome/omero-iviewer/pulls/207","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ome/omero-iviewer/pulls/comments/218753872"},"html":{"href":"https://github.com/ome/omero-iviewer/pull/207#discussion_r218753872"},"pull_request":{"href":"https://api.github.com/repos/ome/omero-iviewer/pulls/207"}}},"pull_request":{"url":"https://api.github.com/repos/ome/omero-iviewer/pulls/207","id":211743839,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNzQzODM5","html_url":"https://github.com/ome/omero-iviewer/pull/207","diff_url":"https://github.com/ome/omero-iviewer/pull/207.diff","patch_url":"https://github.com/ome/omero-iviewer/pull/207.patch","issue_url":"https://api.github.com/repos/ome/omero-iviewer/issues/207","number":207,"state":"open","locked":false,"title":"Thumbnail scrolling","user":{"login":"will-moore","id":900055,"node_id":"MDQ6VXNlcjkwMDA1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/900055?v=4","gravatar_id":"","url":"https://api.github.com/users/will-moore","html_url":"https://github.com/will-moore","followers_url":"https://api.github.com/users/will-moore/followers","following_url":"https://api.github.com/users/will-moore/following{/other_user}","gists_url":"https://api.github.com/users/will-moore/gists{/gist_id}","starred_url":"https://api.github.com/users/will-moore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-moore/subscriptions","organizations_url":"https://api.github.com/users/will-moore/orgs","repos_url":"https://api.github.com/users/will-moore/repos","events_url":"https://api.github.com/users/will-moore/events{/privacy}","received_events_url":"https://api.github.com/users/will-moore/received_events","type":"User","site_admin":false},"body":"See https://trello.com/c/JLpfTbmW/4-improve-thumbnails-loading-display\r\n\r\nInstead of clicking up/down to load more thumbnails, the thumbnail panel is created at the full size (with only the visible thumbnails loaded) and more thumbnails are loaded when we scroll.\r\nThere are lots of different cases to handle and a lot has changed so everything needs testing:\r\n\r\n - Expected behaviour: any thumbnails that appear in the panel should be loaded (no empty grey squares).\r\n - While actually scrolling we don't load thumbnails, since that would load the whole dataset if you scroll fast from one end to the other. Instead, wait until scrolling slows / stops, then load thumbs for visible thumbnails.\r\n - You can see when loading is happening in the devtools Network tab.\r\n - In all scenarios below, check thumbs on load, then scroll about, then refresh thumbs (when scrollbar is in various locations).\r\n - Check that IE works.\r\n\r\n**Scenarios to test:**\r\n\r\n - Single image in 1 or more Datasets, double-clicked in webclient. url like ```/webclient/img_detail/4413/?dataset=1301```\r\n        - Check that thumbs loaded from *current* parent Dataset (not a different Dataset that the image is in)\r\n        - Try double-clicking images in webclient near the start of the Dataset and at the end. Thumb panel in iviewer should scroll to the show the selected image.\r\n        - Try with a small Dataset (< 5 images) and as large as possible.\r\n        - Remove the ```?datasets=ID``` from the URL and reload. If image is in single Dataset, thumbs should be loaded. If more than 1 Dataset, thumbnail panel hidden.\r\n - Multiple selected images > Open with iviewer. Url like ```/iviewer/?images=4402,4403,4404,4405 ```\r\n - Orphaned image, double-clicked in webclient. e.g. ```webclient/img_detail/57012/``` should hide thumbnail panel.\r\n - Well - openwith > iviewer.  Url ```/iviewer/?well=148``` First image should be selected.\r\n - Datasets - openwith > iviewer. ```/iviewer/?dataset=10480``` First image selected.","created_at":"2018-08-29T12:58:37Z","updated_at":"2018-09-19T10:41:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5395a8786aa713060c6737ea6aa976f2989fbab5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ome/omero-iviewer/pulls/207/commits","review_comments_url":"https://api.github.com/repos/ome/omero-iviewer/pulls/207/comments","review_comment_url":"https://api.github.com/repos/ome/omero-iviewer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ome/omero-iviewer/issues/207/comments","statuses_url":"https://api.github.com/repos/ome/omero-iviewer/statuses/5ab99bebe1068e440367239fcae2487b7919b146","head":{"label":"will-moore:thumbnail_scrolling","ref":"thumbnail_scrolling","sha":"5ab99bebe1068e440367239fcae2487b7919b146","user":{"login":"will-moore","id":900055,"node_id":"MDQ6VXNlcjkwMDA1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/900055?v=4","gravatar_id":"","url":"https://api.github.com/users/will-moore","html_url":"https://github.com/will-moore","followers_url":"https://api.github.com/users/will-moore/followers","following_url":"https://api.github.com/users/will-moore/following{/other_user}","gists_url":"https://api.github.com/users/will-moore/gists{/gist_id}","starred_url":"https://api.github.com/users/will-moore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-moore/subscriptions","organizations_url":"https://api.github.com/users/will-moore/orgs","repos_url":"https://api.github.com/users/will-moore/repos","events_url":"https://api.github.com/users/will-moore/events{/privacy}","received_events_url":"https://api.github.com/users/will-moore/received_events","type":"User","site_admin":false},"repo":{"id":75930952,"node_id":"MDEwOlJlcG9zaXRvcnk3NTkzMDk1Mg==","name":"omero-iviewer","full_name":"will-moore/omero-iviewer","private":false,"owner":{"login":"will-moore","id":900055,"node_id":"MDQ6VXNlcjkwMDA1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/900055?v=4","gravatar_id":"","url":"https://api.github.com/users/will-moore","html_url":"https://github.com/will-moore","followers_url":"https://api.github.com/users/will-moore/followers","following_url":"https://api.github.com/users/will-moore/following{/other_user}","gists_url":"https://api.github.com/users/will-moore/gists{/gist_id}","starred_url":"https://api.github.com/users/will-moore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-moore/subscriptions","organizations_url":"https://api.github.com/users/will-moore/orgs","repos_url":"https://api.github.com/users/will-moore/repos","events_url":"https://api.github.com/users/will-moore/events{/privacy}","received_events_url":"https://api.github.com/users/will-moore/received_events","type":"User","site_admin":false},"html_url":"https://github.com/will-moore/omero-iviewer","description":"An OMERO.web app allowing to view images","fork":true,"url":"https://api.github.com/repos/will-moore/omero-iviewer","forks_url":"https://api.github.com/repos/will-moore/omero-iviewer/forks","keys_url":"https://api.github.com/repos/will-moore/omero-iviewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/will-moore/omero-iviewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/will-moore/omero-iviewer/teams","hooks_url":"https://api.github.com/repos/will-moore/omero-iviewer/hooks","issue_events_url":"https://api.github.com/repos/will-moore/omero-iviewer/issues/events{/number}","events_url":"https://api.github.com/repos/will-moore/omero-iviewer/events","assignees_url":"https://api.github.com/repos/will-moore/omero-iviewer/assignees{/user}","branches_url":"https://api.github.com/repos/will-moore/omero-iviewer/branches{/branch}","tags_url":"https://api.github.com/repos/will-moore/omero-iviewer/tags","blobs_url":"https://api.github.com/repos/will-moore/omero-iviewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/will-moore/omero-iviewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/will-moore/omero-iviewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/will-moore/omero-iviewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/will-moore/omero-iviewer/statuses/{sha}","languages_url":"https://api.github.com/repos/will-moore/omero-iviewer/languages","stargazers_url":"https://api.github.com/repos/will-moore/omero-iviewer/stargazers","contributors_url":"https://api.github.com/repos/will-moore/omero-iviewer/contributors","subscribers_url":"https://api.github.com/repos/will-moore/omero-iviewer/subscribers","subscription_url":"https://api.github.com/repos/will-moore/omero-iviewer/subscription","commits_url":"https://api.github.com/repos/will-moore/omero-iviewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/will-moore/omero-iviewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/will-moore/omero-iviewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/will-moore/omero-iviewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/will-moore/omero-iviewer/contents/{+path}","compare_url":"https://api.github.com/repos/will-moore/omero-iviewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/will-moore/omero-iviewer/merges","archive_url":"https://api.github.com/repos/will-moore/omero-iviewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/will-moore/omero-iviewer/downloads","issues_url":"https://api.github.com/repos/will-moore/omero-iviewer/issues{/number}","pulls_url":"https://api.github.com/repos/will-moore/omero-iviewer/pulls{/number}","milestones_url":"https://api.github.com/repos/will-moore/omero-iviewer/milestones{/number}","notifications_url":"https://api.github.com/repos/will-moore/omero-iviewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/will-moore/omero-iviewer/labels{/name}","releases_url":"https://api.github.com/repos/will-moore/omero-iviewer/releases{/id}","deployments_url":"https://api.github.com/repos/will-moore/omero-iviewer/deployments","created_at":"2016-12-08T11:17:47Z","updated_at":"2016-12-08T11:17:48Z","pushed_at":"2018-09-19T10:36:35Z","git_url":"git://github.com/will-moore/omero-iviewer.git","ssh_url":"git@github.com:will-moore/omero-iviewer.git","clone_url":"https://github.com/will-moore/omero-iviewer.git","svn_url":"https://github.com/will-moore/omero-iviewer","homepage":"","size":9971,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ome:master","ref":"master","sha":"b07bf975cb66dcddab77f7cfda1f7fff991c2fe7","user":{"login":"ome","id":1831717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzE3MTc=","avatar_url":"https://avatars3.githubusercontent.com/u/1831717?v=4","gravatar_id":"","url":"https://api.github.com/users/ome","html_url":"https://github.com/ome","followers_url":"https://api.github.com/users/ome/followers","following_url":"https://api.github.com/users/ome/following{/other_user}","gists_url":"https://api.github.com/users/ome/gists{/gist_id}","starred_url":"https://api.github.com/users/ome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ome/subscriptions","organizations_url":"https://api.github.com/users/ome/orgs","repos_url":"https://api.github.com/users/ome/repos","events_url":"https://api.github.com/users/ome/events{/privacy}","received_events_url":"https://api.github.com/users/ome/received_events","type":"Organization","site_admin":false},"repo":{"id":75535262,"node_id":"MDEwOlJlcG9zaXRvcnk3NTUzNTI2Mg==","name":"omero-iviewer","full_name":"ome/omero-iviewer","private":false,"owner":{"login":"ome","id":1831717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzE3MTc=","avatar_url":"https://avatars3.githubusercontent.com/u/1831717?v=4","gravatar_id":"","url":"https://api.github.com/users/ome","html_url":"https://github.com/ome","followers_url":"https://api.github.com/users/ome/followers","following_url":"https://api.github.com/users/ome/following{/other_user}","gists_url":"https://api.github.com/users/ome/gists{/gist_id}","starred_url":"https://api.github.com/users/ome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ome/subscriptions","organizations_url":"https://api.github.com/users/ome/orgs","repos_url":"https://api.github.com/users/ome/repos","events_url":"https://api.github.com/users/ome/events{/privacy}","received_events_url":"https://api.github.com/users/ome/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ome/omero-iviewer","description":"An OMERO.web app allowing to view images","fork":false,"url":"https://api.github.com/repos/ome/omero-iviewer","forks_url":"https://api.github.com/repos/ome/omero-iviewer/forks","keys_url":"https://api.github.com/repos/ome/omero-iviewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ome/omero-iviewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ome/omero-iviewer/teams","hooks_url":"https://api.github.com/repos/ome/omero-iviewer/hooks","issue_events_url":"https://api.github.com/repos/ome/omero-iviewer/issues/events{/number}","events_url":"https://api.github.com/repos/ome/omero-iviewer/events","assignees_url":"https://api.github.com/repos/ome/omero-iviewer/assignees{/user}","branches_url":"https://api.github.com/repos/ome/omero-iviewer/branches{/branch}","tags_url":"https://api.github.com/repos/ome/omero-iviewer/tags","blobs_url":"https://api.github.com/repos/ome/omero-iviewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ome/omero-iviewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ome/omero-iviewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ome/omero-iviewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ome/omero-iviewer/statuses/{sha}","languages_url":"https://api.github.com/repos/ome/omero-iviewer/languages","stargazers_url":"https://api.github.com/repos/ome/omero-iviewer/stargazers","contributors_url":"https://api.github.com/repos/ome/omero-iviewer/contributors","subscribers_url":"https://api.github.com/repos/ome/omero-iviewer/subscribers","subscription_url":"https://api.github.com/repos/ome/omero-iviewer/subscription","commits_url":"https://api.github.com/repos/ome/omero-iviewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ome/omero-iviewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ome/omero-iviewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ome/omero-iviewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ome/omero-iviewer/contents/{+path}","compare_url":"https://api.github.com/repos/ome/omero-iviewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ome/omero-iviewer/merges","archive_url":"https://api.github.com/repos/ome/omero-iviewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ome/omero-iviewer/downloads","issues_url":"https://api.github.com/repos/ome/omero-iviewer/issues{/number}","pulls_url":"https://api.github.com/repos/ome/omero-iviewer/pulls{/number}","milestones_url":"https://api.github.com/repos/ome/omero-iviewer/milestones{/number}","notifications_url":"https://api.github.com/repos/ome/omero-iviewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ome/omero-iviewer/labels{/name}","releases_url":"https://api.github.com/repos/ome/omero-iviewer/releases{/id}","deployments_url":"https://api.github.com/repos/ome/omero-iviewer/deployments","created_at":"2016-12-04T12:13:15Z","updated_at":"2018-09-05T21:33:17Z","pushed_at":"2018-09-19T10:36:36Z","git_url":"git://github.com/ome/omero-iviewer.git","ssh_url":"git@github.com:ome/omero-iviewer.git","clone_url":"https://github.com/ome/omero-iviewer.git","svn_url":"https://github.com/ome/omero-iviewer","homepage":"","size":9916,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":13,"open_issues":3,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ome/omero-iviewer/pulls/207"},"html":{"href":"https://github.com/ome/omero-iviewer/pull/207"},"issue":{"href":"https://api.github.com/repos/ome/omero-iviewer/issues/207"},"comments":{"href":"https://api.github.com/repos/ome/omero-iviewer/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/ome/omero-iviewer/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/ome/omero-iviewer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ome/omero-iviewer/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/ome/omero-iviewer/statuses/5ab99bebe1068e440367239fcae2487b7919b146"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jburel"}}