🐛(front) fix "+ New" menu in read-only folders and virtual tabs#667
Open
PanchoutNathan wants to merge 2 commits intomainfrom
Open
🐛(front) fix "+ New" menu in read-only folders and virtual tabs#667PanchoutNathan wants to merge 2 commits intomainfrom
PanchoutNathan wants to merge 2 commits intomainfrom
Conversation
fd2f859 to
5243bca
Compare
The "+ New" dropdown used to hide all its entries when the user lacked children_create on the current folder, leaving an empty popover. On virtual tabs (Recent, My Files, Shared with me, Starred) there is no real current folder either, so the same empty state could be reached. Always populate the menu and, when the user cannot create in place, fall back to creating the item in "My Files" (no parent). After a fallback creation we redirect: - into the new folder for folder creation - to the My Files view for file creation, since a file is not a navigable route The new item is pre-selected in both cases.
Cover the four scenarios of the new "+ New" behavior: - folder creation from a read-only shared folder redirects into the newly created folder under My Files - document creation from a read-only shared folder redirects to the My Files view with the new file listed - folder creation from the Recent / Shared with me / Starred virtual tabs creates in My Files - folder creation in a writable folder still happens in place, with no fallback redirect
|
This file contains hidden or 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
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.


Summary
read-only or we're on a virtual tab (Recent, My Files, Shared with me,
Starred). Previously the popover was empty because every entry was
hidden on
!children_create.in My Files (no parent). After a fallback creation:
route), new file pre-selected in the listing
behavior (folder + file fallback from a read-only shared folder,
folder creation from virtual tabs, and a sanity check that writable
folders still create in place).
Fixes #577.
Test plan
check you land inside the new folder under My Files.
/explorer/items/my-fileswith the new doc listed.with no redirect.
cd src/frontend/apps/e2e && yarn test create-fallback-to-my-files.spec.ts