Commit 2091f48
Support multi-selection in file lists (#1136)
* enable multiple selection with control-click without functionality
* Implemented multiple file selection with control-click
* Remove handling this.state.selectedFiles is null in FileList selectFile method
* Enable toggle select/deselect files with control-click
* Implement Shift-Click file selection
Shift-click behaviour is not ideal. Failed to simulate shift-click behaviour on Google Drive.
Issues:
1. Can't deselect when shift click direction changes
Other issues:
1. IStatusFile object equality checking leads to a lot of duplicate codes
2. File status changes is not immediately reflected in FileList state, leading to invalid commands in context menu
* extract file comparison logic and remove duplicate selected files due to shift click
* limit multiple file selection by control-click to within the same category (git status)
* rename replaceSelectedFile to selectOnlyOneFile for better comprehension
* shift-click on a file with a different category (git status) becomes a simple click, handle partially staged files for shift clicks
* Make FileItem action commands (open, diff and stage file) apply to selected files
* Make FileItem action commands (open, diff and unstage file) apply to selected files
* Make FileItem action commands (discarding changes and staging file) apply to selected files
* fix bug - open correct files on clicking action button
* fix bug - diff correct files on clicking action button
* fix bug - unstage correct files on clicking action button
* fix bug - stage correct files on clicking action button
* fix bug - discard changes on correct files on clicking action button
* fix FileItem test
* Rename function filesAreEqual to areFilesEqual
Use _isSelectedFile where appropriate
* Remove selectedFileStatus from state
* change _openDiffViews function to async and await the execute command
* Remove unnecessary code in openContextMenu
* Ensure selectFiles arrives at correct state
* implement single selection callback 'setSelection'
* rework _selectUntilFile to index in sub array
* fix FileItem test
* implement advanced shift-click behaviours
* Added label to wrap around div object to allow click on whole div element to control checkbox
* Fixed label placement issue
* Styled filename div
* Fixed styling issue by importing and applying fileLabelStyle to the appropriate label container
* tried implementing shiftclick but unsuccessful:
* Fixed issue with shift click when clicking in reverse order
* Implement markedFile getter in gitModel
* implement shift click
problem: the clicked file is not selected
* Fix bug for shift-click for simple staging
* Clean up
* remove console logs
* insert in FileItemStyle.ts
* added simple ui tests for ctlr and shift click on file selection for normal staging
* Add skeleton code for implementing de/select all button for simple staging
* Fix original ui tests
* Changed file name in ui-tests README and have the select all in simple staging selecting all files
* Changed name of variables and function from markAllFile to toggleAllFiles for clarity
* Added the ability to deselect items using select all
* Simplified code in toggleAllFiles to use state and removed redundant code.
* Improve mark-all button behaviour - sync checked state of the box to reflect if all files are marked
* Fix ui tests
* Add ui tests for simple staging
* Clear all signal connections when unmounting FileList
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
* Delete commented code in GitPanel
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
* Delete unused prop from interface (GitStage)
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
* Improve consistency and fix bug
* fix ui test readme
* Change control-click ui test to expect exactly 2 selected items
* Stop propagation when users click on action buttons on FileItem
* Add doc strings for functions
* Document helper functions
Co-authored-by: iflinda <informlinda@gmail.com>
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>1 parent 2eabf94 commit 2091f48
File tree
10 files changed
+746
-168
lines changed- src
- components
- style
- tests/test-components
- ui-tests/tests
- data
10 files changed
+746
-168
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
135 | 145 | | |
136 | 146 | | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
141 | 171 | | |
142 | 172 | | |
143 | 173 | | |
| |||
190 | 220 | | |
191 | 221 | | |
192 | 222 | | |
| 223 | + | |
| 224 | + | |
193 | 225 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 226 | + | |
198 | 227 | | |
199 | 228 | | |
200 | 229 | | |
| |||
205 | 234 | | |
206 | 235 | | |
207 | 236 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
231 | 267 | | |
232 | 268 | | |
233 | 269 | | |
| |||
0 commit comments