{"action":"created","issue":{"url":"https://api.github.com/repos/desktop/desktop/issues/4188","repository_url":"https://api.github.com/repos/desktop/desktop","labels_url":"https://api.github.com/repos/desktop/desktop/issues/4188/labels{/name}","comments_url":"https://api.github.com/repos/desktop/desktop/issues/4188/comments","events_url":"https://api.github.com/repos/desktop/desktop/issues/4188/events","html_url":"https://github.com/desktop/desktop/pull/4188","id":302863420,"number":4188,"title":"[Feature] Multiple file-changes selection","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},"labels":[],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":null,"comments":9,"created_at":"2018-03-06T20:58:33Z","updated_at":"2018-03-13T20:28:35Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/desktop/desktop/pulls/4188","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"},"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"},"comment":{"url":"https://api.github.com/repos/desktop/desktop/issues/comments/372807235","html_url":"https://github.com/desktop/desktop/pull/4188#issuecomment-372807235","issue_url":"https://api.github.com/repos/desktop/desktop/issues/4188","id":372807235,"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},"created_at":"2018-03-13T20:28:35Z","updated_at":"2018-03-13T20:28:35Z","author_association":"NONE","body":"I see, @tierninho . Thanks for the tests\r\nLooks like this is not new behaviour, but it is now misleading since the rows are shown to be selected, even if the focus in on the list's frame.\r\n\r\nI will have to also bind the list's key input event to toggle the selected elements."}}
{"actor":{"display_login":"icosamuel"}}