Skip to content

🐛(front) fix "+ New" menu in read-only folders and virtual tabs#667

Open
PanchoutNathan wants to merge 2 commits intomainfrom
fix/577
Open

🐛(front) fix "+ New" menu in read-only folders and virtual tabs#667
PanchoutNathan wants to merge 2 commits intomainfrom
fix/577

Conversation

@PanchoutNathan
Copy link
Copy Markdown
Contributor

Summary

  • Always populate the "+ New" dropdown, even when the current folder is
    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.
  • When the user cannot create in place, fall back to creating the item
    in My Files (no parent). After a fallback creation:
    • folder → redirect into the new folder
    • file → redirect to the My Files view (a file is not a navigable
      route), new file pre-selected in the listing
  • Add Playwright e2e tests covering the four branches of the new
    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

  • Open a folder shared with you as Reader, click + New → Folder,
    check you land inside the new folder under My Files.
  • Same folder, + New → Text document, check you land on
    /explorer/items/my-files with the new doc listed.
  • Repeat from the Recent / Shared with me / Starred tabs.
  • In a folder you own, + New → Folder still creates in place
    with no redirect.
  • cd src/frontend/apps/e2e && yarn test create-fallback-to-my-files.spec.ts

@PanchoutNathan PanchoutNathan force-pushed the fix/577 branch 2 times, most recently from fd2f859 to 5243bca Compare April 14, 2026 12:55
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
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
10.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@PanchoutNathan PanchoutNathan self-assigned this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty dropdown when clicking on New in read only folder

1 participant