-
Notifications
You must be signed in to change notification settings - Fork 323
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
Sort assets #7540
Sort assets #7540
Conversation
This prevents `AssetRow`s from losing state when hidden and re-shown
Missing UI and filter function
ok so this is currently freezing when sorting new entries, since there is no folder with a key matching the asset's parent id. not sure what's the best way to solve this - there is no way to get the child's parent's key, since the asset table does not store the parent's current value (it has access to the initial value of the item, with the placeholder id - aka the key.) |
i think (?) this isn't really high priority or anything, so i think i'll try refactoring from an assets list to an assets tree here. it will be a lot of changes to have to test ( :( ) but unfortunately i think it may be the simplest solution |
post-refactor testing:
|
Note: I think this refactor also makes it possible (or I guess, easy) to show the "this folder is empty" placeholder row instead of collapsing the folder. However, it would only show after a delay, after all children have been actually deleted - this is why the current behavior is just to silently collapse the folder. |
Sorting works fine but the logic needs a bit more improvements. The sort by name or modification date should mix the asset types if it results from sorting order. Now the group takes precedence Screen.Recording.2023-08-18.at.12.19.17.mov |
fixed locally, but i just realized that sorting currently uses the initial item - so after renaming, it will still use the initial name, and after running a project, it will still use the creation date (or original "last modified" date) not the last modified date |
should be fixed now - also fixed creating new assets (e.g. "New Project" button) |
- Closes #7463 - Makes table header sticky - Clips table body so it does not overlap table header Other changes: - Clip table header row so it does not overlap extra columns selector - Hide extra columns selector on local backend (PM backend) - Focus search bar if the keypress will type regular text - Change row height from 40px to 32px - Add "Share" button when the editor is open - Make entire area of backend selector (Cloud <-> Local) clickable (previously, the padding was not clickable) - Remove the up-arrow icon to open a project. Projects are now opened by switching to the project tab using the tab selector on the top left (or by double clicking the row). - Fix opening newly created folder (previously its entries were appended to the end, rather than under the folder) - Indent background of "name" column (the first column) - Minor code style changes - Add background back to "change password" modal (oops) - Hide "open" context menu entry and show "stop" entry, when a project is currently running - ℹ️ It might be a good idea to support the "open" action on directories as well, however it is difficult without the assets table refactor in #7540. As such, this functionality will not be added in this PR. - Fix horizontal padding on "sign in" user menu entry - Hide email/password validation when using oauth logins More fixes for assets list: - Project is inserted at start of list when there are no existing projects - Project is inserted at start of children when there are no existing children - Deleting a folder collapses it (hides its descendants) - Adding children to a newly created folder puts them at the correct depth, rather than depth 1 # Important Notes None
- Remove unused `forceCreate` parameter from backend requests - Also undo bad change to behavior of sorting assets: - #7540 (comment) - Fix enso-org/cloud-v2#910 - Closing a project now doesn't close other projects. - Unable to properly test, as I cannot get the second project to open - Fix enso-org/cloud-v2#908 - Use the `download` module that already exists to download the app... - Add correct arrow icon for collapsing/expanding folders - Turns out this icon had always existed, and I just didn't see it for the longest time - Hide irrelevant parts of search bar on Local Backend - The row of labels - `no:`, `has:`, `label:`, `-label:`, `description:`, `-description:` (and their corresponding autocomplete entries) - Also change text to say "Type to search for projects." because the other asset types mentioned do not (and will never) exist on the Local Backend. - Fix search bar eating up `"` and ` ` keypresses - Fix icons for Data Links and Secrets being swapped in `AssetIcon` # Important Notes - The fix for enso-org/cloud-v2#908 has not been tested on Safari (I don't have a macOS machine.)
Pull Request Description
Important Notes
The sort arrows have a slightly thicker border (changed from 2px to 2.14px), to remove the (very small) internal hole in the Figma design. It is possible to make the shape more accurate to the original design by using a polygon (or a path) that traces around the original outline instead, but I figured it's not worth spending the extra time on a fix that may not be correct.
ℹ️ The comparison function for sorting is quite complicated. I think this is the least intrusive change for now, but it is worth considering changing
AssetsTable
to store items internally as a tree instead, and do a preorder traversal to flatten it into an array when needed.Screencast
screen-recorder-thu-aug-10-2023-16-41-50.webm
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
The documentation has been updated, if necessary.Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Unit tests have been written where possible.If GUI codebase was changed, the GUI was tested when built using./run ide build
.