{"action":"created","comment":{"url":"https://api.github.com/repos/desktop/desktop/pulls/comments/177513014","pull_request_review_id":107397300,"id":177513014,"diff_hunk":"@@ -124,9 +124,17 @@ export class ChangesSidebar extends React.Component<IChangesSidebarProps, {}> {\n     )\n   }\n \n-  private onFileSelectionChanged = (row: number) => {\n-    const file = this.props.changes.workingDirectory.files[row]\n-    this.props.dispatcher.changeChangesSelection(this.props.repository, file)\n+  private onFileSelectionChanged = (rows: number | number[]) => {\n+    if (rows instanceof Array) {\n+      const files: WorkingDirectoryFileChange[] = []","path":"app/src/ui/changes/sidebar.tsx","position":9,"original_position":9,"commit_id":"741ddfdee077846a9cff15309ba663c52310966b","original_commit_id":"0c793a8d9151614c7864c03df66a246457bf907f","user":{"login":"icosamuel","id":5400332,"avatar_url":"https://avatars0.githubusercontent.com/u/5400332?v=4","gravatar_id":"","url":"https://api.github.com/users/icosamuel","html_url":"https://github.com/icosamuel","followers_url":"https://api.github.com/users/icosamuel/followers","following_url":"https://api.github.com/users/icosamuel/following{/other_user}","gists_url":"https://api.github.com/users/icosamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/icosamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icosamuel/subscriptions","organizations_url":"https://api.github.com/users/icosamuel/orgs","repos_url":"https://api.github.com/users/icosamuel/repos","events_url":"https://api.github.com/users/icosamuel/events{/privacy}","received_events_url":"https://api.github.com/users/icosamuel/received_events","type":"User","site_admin":false},"body":"I gotta use `map` more. its a very nice tool :heavy_check_mark: ","created_at":"2018-03-27T17:46:35Z","updated_at":"2018-03-27T17:46:35Z","html_url":"https://github.com/desktop/desktop/pull/4188#discussion_r177513014","pull_request_url":"https://api.github.com/repos/desktop/desktop/pulls/4188","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/desktop/desktop/pulls/comments/177513014"},"html":{"href":"https://github.com/desktop/desktop/pull/4188#discussion_r177513014"},"pull_request":{"href":"https://api.github.com/repos/desktop/desktop/pulls/4188"}},"in_reply_to_id":176530192},"pull_request":{"url":"https://api.github.com/repos/desktop/desktop/pulls/4188","id":173279285,"html_url":"https://github.com/desktop/desktop/pull/4188","diff_url":"https://github.com/desktop/desktop/pull/4188.diff","patch_url":"https://github.com/desktop/desktop/pull/4188.patch","issue_url":"https://api.github.com/repos/desktop/desktop/issues/4188","number":4188,"state":"open","locked":false,"title":"add support for multiple selection in changes list","user":{"login":"icosamuel","id":5400332,"avatar_url":"https://avatars0.githubusercontent.com/u/5400332?v=4","gravatar_id":"","url":"https://api.github.com/users/icosamuel","html_url":"https://github.com/icosamuel","followers_url":"https://api.github.com/users/icosamuel/followers","following_url":"https://api.github.com/users/icosamuel/following{/other_user}","gists_url":"https://api.github.com/users/icosamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/icosamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icosamuel/subscriptions","organizations_url":"https://api.github.com/users/icosamuel/orgs","repos_url":"https://api.github.com/users/icosamuel/repos","events_url":"https://api.github.com/users/icosamuel/events{/privacy}","received_events_url":"https://api.github.com/users/icosamuel/received_events","type":"User","site_admin":false},"body":"## New feature ##\r\nAdded the ability to select multiple lines in the changes-list. Usable with shift and ctrl, as you would expect it from any other software.\r\n\r\n#### Multi-selection with Shift and Cmd/Ctrl ####\r\n![screenshot from 2018-03-08 17-15-55](https://user-images.githubusercontent.com/5400332/37210933-5848e9c2-2378-11e8-91c5-c7c4dc50c2cd.png)\r\n\r\nYou can toggle the checkboxes (for later commiting) or use the contextual menu to ignore or discard the selected changes.\r\n\r\n#### Discard selection ####\r\n![screenshot from 2018-03-06 15-50-37](https://user-images.githubusercontent.com/5400332/37057902-dde35b0e-2156-11e8-9d38-12caf7fcf2cf.png)\r\n\r\nThis PR closes  #1712 \r\n\r\n### Impact ###\r\n**`list.tsx`**\r\nAll components using List must encapsulate their `selectedRow` in a single-element array if they are not using the multiple-selection feature. The `onSelectionChanged(selectedItem: number): void` is now split into tree distinct callbacks which you can choose to use depending on the situation:\r\n```js\r\nonSelectedRowChanged(index: number): void\r\nonSelectedRangeChanged(start: number, end: number): void\r\nonSelectionChanged(selectedItems: ReadonlyArray<number>): void\r\n```\r\nTheir usage (as well as the possible selection mechanism) are governed by the new property which is assumed to be`'single'` by default\r\n```js\r\nselectionMode: 'single' | 'range' | 'multi'\r\n```\r\n**`changes-list.tsx`**\r\nis not working with the list in `'multi'`mode and stores its selection in `this.props.selectedFilesID: string[]`\r\n\r\nSome features (like the diff pannel, or the \"show in your file manager\") use only _one_ file-change as their source. For those, I have them set up to get the last selected Item (wich will also be the focused one)\r\n\r\n**`app-state.ts`**\r\nin the app store, the selection is also stored as an array of ids `readonly selectedFilesID: string[]`\r\n","created_at":"2018-03-06T20:58:33Z","updated_at":"2018-03-27T17:46:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d2df901465bec69daf75e701937d305a3fddd4b","assignee":{"login":"shiftkey","id":359239,"avatar_url":"https://avatars2.githubusercontent.com/u/359239?v=4","gravatar_id":"","url":"https://api.github.com/users/shiftkey","html_url":"https://github.com/shiftkey","followers_url":"https://api.github.com/users/shiftkey/followers","following_url":"https://api.github.com/users/shiftkey/following{/other_user}","gists_url":"https://api.github.com/users/shiftkey/gists{/gist_id}","starred_url":"https://api.github.com/users/shiftkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiftkey/subscriptions","organizations_url":"https://api.github.com/users/shiftkey/orgs","repos_url":"https://api.github.com/users/shiftkey/repos","events_url":"https://api.github.com/users/shiftkey/events{/privacy}","received_events_url":"https://api.github.com/users/shiftkey/received_events","type":"User","site_admin":true},"assignees":[{"login":"shiftkey","id":359239,"avatar_url":"https://avatars2.githubusercontent.com/u/359239?v=4","gravatar_id":"","url":"https://api.github.com/users/shiftkey","html_url":"https://github.com/shiftkey","followers_url":"https://api.github.com/users/shiftkey/followers","following_url":"https://api.github.com/users/shiftkey/following{/other_user}","gists_url":"https://api.github.com/users/shiftkey/gists{/gist_id}","starred_url":"https://api.github.com/users/shiftkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiftkey/subscriptions","organizations_url":"https://api.github.com/users/shiftkey/orgs","repos_url":"https://api.github.com/users/shiftkey/repos","events_url":"https://api.github.com/users/shiftkey/events{/privacy}","received_events_url":"https://api.github.com/users/shiftkey/received_events","type":"User","site_admin":true},{"login":"niik","id":634063,"avatar_url":"https://avatars2.githubusercontent.com/u/634063?v=4","gravatar_id":"","url":"https://api.github.com/users/niik","html_url":"https://github.com/niik","followers_url":"https://api.github.com/users/niik/followers","following_url":"https://api.github.com/users/niik/following{/other_user}","gists_url":"https://api.github.com/users/niik/gists{/gist_id}","starred_url":"https://api.github.com/users/niik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niik/subscriptions","organizations_url":"https://api.github.com/users/niik/orgs","repos_url":"https://api.github.com/users/niik/repos","events_url":"https://api.github.com/users/niik/events{/privacy}","received_events_url":"https://api.github.com/users/niik/received_events","type":"User","site_admin":true}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/desktop/desktop/pulls/4188/commits","review_comments_url":"https://api.github.com/repos/desktop/desktop/pulls/4188/comments","review_comment_url":"https://api.github.com/repos/desktop/desktop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/desktop/desktop/issues/4188/comments","statuses_url":"https://api.github.com/repos/desktop/desktop/statuses/741ddfdee077846a9cff15309ba663c52310966b","head":{"label":"icosamuel:feature/multiple-file-selection","ref":"feature/multiple-file-selection","sha":"741ddfdee077846a9cff15309ba663c52310966b","user":{"login":"icosamuel","id":5400332,"avatar_url":"https://avatars0.githubusercontent.com/u/5400332?v=4","gravatar_id":"","url":"https://api.github.com/users/icosamuel","html_url":"https://github.com/icosamuel","followers_url":"https://api.github.com/users/icosamuel/followers","following_url":"https://api.github.com/users/icosamuel/following{/other_user}","gists_url":"https://api.github.com/users/icosamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/icosamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icosamuel/subscriptions","organizations_url":"https://api.github.com/users/icosamuel/orgs","repos_url":"https://api.github.com/users/icosamuel/repos","events_url":"https://api.github.com/users/icosamuel/events{/privacy}","received_events_url":"https://api.github.com/users/icosamuel/received_events","type":"User","site_admin":false},"repo":{"id":123973153,"name":"desktop","full_name":"icosamuel/desktop","owner":{"login":"icosamuel","id":5400332,"avatar_url":"https://avatars0.githubusercontent.com/u/5400332?v=4","gravatar_id":"","url":"https://api.github.com/users/icosamuel","html_url":"https://github.com/icosamuel","followers_url":"https://api.github.com/users/icosamuel/followers","following_url":"https://api.github.com/users/icosamuel/following{/other_user}","gists_url":"https://api.github.com/users/icosamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/icosamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icosamuel/subscriptions","organizations_url":"https://api.github.com/users/icosamuel/orgs","repos_url":"https://api.github.com/users/icosamuel/repos","events_url":"https://api.github.com/users/icosamuel/events{/privacy}","received_events_url":"https://api.github.com/users/icosamuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/icosamuel/desktop","description":"Simple collaboration from your desktop","fork":true,"url":"https://api.github.com/repos/icosamuel/desktop","forks_url":"https://api.github.com/repos/icosamuel/desktop/forks","keys_url":"https://api.github.com/repos/icosamuel/desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/icosamuel/desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/icosamuel/desktop/teams","hooks_url":"https://api.github.com/repos/icosamuel/desktop/hooks","issue_events_url":"https://api.github.com/repos/icosamuel/desktop/issues/events{/number}","events_url":"https://api.github.com/repos/icosamuel/desktop/events","assignees_url":"https://api.github.com/repos/icosamuel/desktop/assignees{/user}","branches_url":"https://api.github.com/repos/icosamuel/desktop/branches{/branch}","tags_url":"https://api.github.com/repos/icosamuel/desktop/tags","blobs_url":"https://api.github.com/repos/icosamuel/desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/icosamuel/desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/icosamuel/desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/icosamuel/desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/icosamuel/desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/icosamuel/desktop/languages","stargazers_url":"https://api.github.com/repos/icosamuel/desktop/stargazers","contributors_url":"https://api.github.com/repos/icosamuel/desktop/contributors","subscribers_url":"https://api.github.com/repos/icosamuel/desktop/subscribers","subscription_url":"https://api.github.com/repos/icosamuel/desktop/subscription","commits_url":"https://api.github.com/repos/icosamuel/desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/icosamuel/desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/icosamuel/desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/icosamuel/desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/icosamuel/desktop/contents/{+path}","compare_url":"https://api.github.com/repos/icosamuel/desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/icosamuel/desktop/merges","archive_url":"https://api.github.com/repos/icosamuel/desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/icosamuel/desktop/downloads","issues_url":"https://api.github.com/repos/icosamuel/desktop/issues{/number}","pulls_url":"https://api.github.com/repos/icosamuel/desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/icosamuel/desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/icosamuel/desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/icosamuel/desktop/labels{/name}","releases_url":"https://api.github.com/repos/icosamuel/desktop/releases{/id}","deployments_url":"https://api.github.com/repos/icosamuel/desktop/deployments","created_at":"2018-03-05T20:14:53Z","updated_at":"2018-03-23T14:35:57Z","pushed_at":"2018-03-27T16:08:37Z","git_url":"git://github.com/icosamuel/desktop.git","ssh_url":"git@github.com:icosamuel/desktop.git","clone_url":"https://github.com/icosamuel/desktop.git","svn_url":"https://github.com/icosamuel/desktop","homepage":"https://desktop.github.com","size":21415,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"desktop:master","ref":"master","sha":"e32b3db2f019ae4a2226e3ae8671f311514a078f","user":{"login":"desktop","id":13171334,"avatar_url":"https://avatars0.githubusercontent.com/u/13171334?v=4","gravatar_id":"","url":"https://api.github.com/users/desktop","html_url":"https://github.com/desktop","followers_url":"https://api.github.com/users/desktop/followers","following_url":"https://api.github.com/users/desktop/following{/other_user}","gists_url":"https://api.github.com/users/desktop/gists{/gist_id}","starred_url":"https://api.github.com/users/desktop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desktop/subscriptions","organizations_url":"https://api.github.com/users/desktop/orgs","repos_url":"https://api.github.com/users/desktop/repos","events_url":"https://api.github.com/users/desktop/events{/privacy}","received_events_url":"https://api.github.com/users/desktop/received_events","type":"Organization","site_admin":false},"repo":{"id":58559694,"name":"desktop","full_name":"desktop/desktop","owner":{"login":"desktop","id":13171334,"avatar_url":"https://avatars0.githubusercontent.com/u/13171334?v=4","gravatar_id":"","url":"https://api.github.com/users/desktop","html_url":"https://github.com/desktop","followers_url":"https://api.github.com/users/desktop/followers","following_url":"https://api.github.com/users/desktop/following{/other_user}","gists_url":"https://api.github.com/users/desktop/gists{/gist_id}","starred_url":"https://api.github.com/users/desktop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desktop/subscriptions","organizations_url":"https://api.github.com/users/desktop/orgs","repos_url":"https://api.github.com/users/desktop/repos","events_url":"https://api.github.com/users/desktop/events{/privacy}","received_events_url":"https://api.github.com/users/desktop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/desktop/desktop","description":"Simple collaboration from your desktop","fork":false,"url":"https://api.github.com/repos/desktop/desktop","forks_url":"https://api.github.com/repos/desktop/desktop/forks","keys_url":"https://api.github.com/repos/desktop/desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/desktop/desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/desktop/desktop/teams","hooks_url":"https://api.github.com/repos/desktop/desktop/hooks","issue_events_url":"https://api.github.com/repos/desktop/desktop/issues/events{/number}","events_url":"https://api.github.com/repos/desktop/desktop/events","assignees_url":"https://api.github.com/repos/desktop/desktop/assignees{/user}","branches_url":"https://api.github.com/repos/desktop/desktop/branches{/branch}","tags_url":"https://api.github.com/repos/desktop/desktop/tags","blobs_url":"https://api.github.com/repos/desktop/desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/desktop/desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/desktop/desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/desktop/desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/desktop/desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/desktop/desktop/languages","stargazers_url":"https://api.github.com/repos/desktop/desktop/stargazers","contributors_url":"https://api.github.com/repos/desktop/desktop/contributors","subscribers_url":"https://api.github.com/repos/desktop/desktop/subscribers","subscription_url":"https://api.github.com/repos/desktop/desktop/subscription","commits_url":"https://api.github.com/repos/desktop/desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/desktop/desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/desktop/desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/desktop/desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/desktop/desktop/contents/{+path}","compare_url":"https://api.github.com/repos/desktop/desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/desktop/desktop/merges","archive_url":"https://api.github.com/repos/desktop/desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/desktop/desktop/downloads","issues_url":"https://api.github.com/repos/desktop/desktop/issues{/number}","pulls_url":"https://api.github.com/repos/desktop/desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/desktop/desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/desktop/desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/desktop/desktop/labels{/name}","releases_url":"https://api.github.com/repos/desktop/desktop/releases{/id}","deployments_url":"https://api.github.com/repos/desktop/desktop/deployments","created_at":"2016-05-11T15:59:00Z","updated_at":"2018-03-27T17:10:14Z","pushed_at":"2018-03-27T16:56:04Z","git_url":"git://github.com/desktop/desktop.git","ssh_url":"git@github.com:desktop/desktop.git","clone_url":"https://github.com/desktop/desktop.git","svn_url":"https://github.com/desktop/desktop","homepage":"https://desktop.github.com","size":21669,"stargazers_count":4535,"watchers_count":4535,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1582,"mirror_url":null,"archived":false,"open_issues_count":332,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1582,"open_issues":332,"watchers":4535,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/desktop/desktop/pulls/4188"},"html":{"href":"https://github.com/desktop/desktop/pull/4188"},"issue":{"href":"https://api.github.com/repos/desktop/desktop/issues/4188"},"comments":{"href":"https://api.github.com/repos/desktop/desktop/issues/4188/comments"},"review_comments":{"href":"https://api.github.com/repos/desktop/desktop/pulls/4188/comments"},"review_comment":{"href":"https://api.github.com/repos/desktop/desktop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/desktop/desktop/pulls/4188/commits"},"statuses":{"href":"https://api.github.com/repos/desktop/desktop/statuses/741ddfdee077846a9cff15309ba663c52310966b"}},"author_association":"NONE"}}
{"actor":{"display_login":"icosamuel"}}