-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filetable rewrite hooks #342
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In order to prepare the use of different layouts for the main view (now FileView), these interfaces have been renamed: - File -> FileDescriptor (should have been done a long time ago since File it conflicts with built-in File node object) - TableRow -> FileViewItem (more generic) - FileTable -> FileView Also, moved DraggedObject interface from RowRenderer to main types file.
A new useLayout hook has been added and returns the layout for the fileview contents. Lots of code will be moved from FileView into this layout: this will not only reduce the size of FileView but also allow to have different layouts (eg. IconView,...) for the FileView :) Lots of events are not implemented yet: this will need more work and a lot of testing but should worth the pain ;)
- added react-virtual (more work needed: header,...) to replace react-virtualized - cleaned-up selection (state only modified in fileState) - files sorted on fileState object - removed flickering on StatusBar + SideView when changing directory
Also: refactored sameID utility to receive id and not File as input.
Also removed stupid reactions/useEffect from SideView: we now use proper observer() instead. This not only fixes missed updates when switching tabs but should also speed up some updates.
Check that files are visually selected/not selected instead.
This will allow to remove lots of mocks Cypress tests.
Since lots of changes have been made, most tests were broken. This PR fixes most of them and disable some that will be enabled once the new FileView is ready. This allows to fix some bugs: - closing a tab would trigger an out of bound mobx read - Overlay component would not get active after it has been activated once - React-Virtual would render every items because its ref was incorrectly set
389605c
to
a0d2c02
Compare
Also cleaned-up FileCache: scrollTop property should not be needed anymore.
Most cases should be handled now, including extending selection from top/bottom.
Also added new useAccelerator hook to handle accelerators.
Also added 'SHELL_OPEN_FAILED' to the list of known errors.
The placeholder is displayed when current folder is empty or an error ocurred. Note: maybe this could be used into the parent FileView instead? I guess this shouldn't change when changing layouts.
Also: do not move selection if an input has focus
Need to work on the preview element when multiple files are selected.
Note: need to select leftpart and rename file.
This allows us to not opt out of React lifecycle
Also removed react-virtualized package + cleanup unused files/code.
Also added Row integration tests
Also fixed useLayout so that ref is always defined (it wasn't defined in jest unless the component was rerendered).
Fixes broken tests in Cypress.
Prior to this change, clicking on the size column of a selected element would enable inline edit. This would save current change if the file was already being editing.
Also added missing test for contextMenu in FileView.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR rewrites the FileView/FileTable component using
useVirtual
hook with the following benefits:This PR also adds the following hooks:
Only drawback is that some end to end tests have been removed for now: I have no time to fix them and we'll be moving to Playwright soon anyway.