web icon indicating copy to clipboard operation
web copied to clipboard

fix: disable rename action in password-protected folder view

Open ubermensch19 opened this issue 10 months ago • 5 comments

Description

Disables the Rename action in the breadcrumb context menu when viewing a password-protected folder (public link context).

Related Issue

Fixes #12365

Motivation and Context

When renaming a folder from inside a password-protected folder view, the action operates in the public link context. This causes the rename to create a duplicate folder instead of renaming the original.

The fix aligns with:

  • The existing pattern in useFileActionsDelete.ts which already disables delete in public links
  • The README documentation stating "Moving or renaming a link file is prevented by the webUI"

How Has This Been Tested?

  • [x] Unit tests pass (17 tests)
  • [x] Manual: Verified rename option is hidden inside PPF view
  • [x] Manual: Verified rename still works in normal folder views

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)

ubermensch19 avatar Jan 22 '26 12:01 ubermensch19

@LukasHirt PTAL, could you please review this and confirm whether this approach looks correct?

ubermensch19 avatar Jan 22 '26 12:01 ubermensch19

Hey! The doc reference is in packages/web-app-password-protected-folders/README.md on line 59:

"Moving or renaming a link file is prevented by the webUI..."

Though I realize it refers to the link file itself, not actions inside the modal.

The main reason for this fix: renaming from inside the PPF modal (public link iframe) operates on the wrong context, causing the folder to fork instead of rename. Hiding it follows the same pattern as useFileActionsDelete (line 50) which already disables delete in public links.

Let me know if you'd prefer a different approach!

ubermensch19 avatar Jan 23 '26 12:01 ubermensch19

Alternative fix (more complex): Instead of hiding, we could intercept the rename action and make it update both:

  • The destination folder path
  • The .psec link file content But this would require backend changes too.

ubermensch19 avatar Jan 23 '26 12:01 ubermensch19

The main problem is with the shared context for PPF and public links in general. Since PPF "abuses" the public link functionality, simply preventing renaming breaks the regular links.

Regarding backend changes, as of now, this is only frontend feature. This was done on purpose to leave backend out of this topic. If it would need to be touched, it would probably be better to do a real PPF implementation on the backend.

LukasHirt avatar Feb 09 '26 07:02 LukasHirt