Rename folders through contextual menu
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3566555. --> Reported by: [vipin.mittal18](https://www.drupal.org/user/319716) Related to !455 >>> <p>This ticket introduces the ability for users to rename a folder using the three-dot (contextual) menu. The feature must ensure that duplicate folder names are not allowed during the renaming process. The rename action should only be committed when the user explicitly confirms it by pressing Enter.</p> <h3>Proposed Solution</h3> <ol> <li>Add a Rename option to the folder&rsquo;s contextual (three-dot) menu.</li> <li>When the user selects Rename, the folder name switches to an editable state (inline edit mode).</li> <li>The system validates the new folder name to ensure the same name folder name doesn't exist.</li> <li>The rename operation is finalized only when the user presses Enter.</li> <li>If the user types a new name but clicks elsewhere (outside) the rename action is cancelled, and the folder retains its original name.</li> </ol> <h3>User Interface Changes</h3> <ol> <li>Add a Rename option in the folder&rsquo;s contextual (three-dot) menu.</li> <li>On selecting Rename: <ul> <li>The folder name becomes an editable text input.</li> <li>The existing folder name is pre-selected to allow quick editing.</li> </ul> </li> <li>Inline validation feedback: <ul> <li>If a duplicate name is entered, show an error message (e.g., &ldquo;A folder with this name already exists&rdquo;).</li> <li>No visual change should persist unless the rename is successfully confirmed.</li> </ul> </li> </ol> <p><img src="https://www.drupal.org/files/issues/2026-01-09/rename%20folders%20through%20contextual%20menu_0.png" alt="Rename folders through contextual menu"></p> <h3>Acceptance Criteria</h3> <p><strong>Functional</strong></p> <ol> <li>The Rename option is available in the folder&rsquo;s contextual menu.</li> <li>Clicking Rename enables inline editing of the folder name.</li> <li>The folder name is updated only when the user presses Enter.</li> <li>If the user clicks outside the input field without pressing Enter, the rename action is cancelled.</li> <li>An appropriate error message is displayed for duplicate names.</li> <li>The original folder name remains unchanged if validation fails.</li> </ol> <p><strong>Validation &amp; Edge Cases</strong></p> <ol> <li>Folder names are trimmed for leading/trailing spaces before validation.</li> <li>Folder name comparison for duplicates is case-insensitive (e.g., Folder vs folder).</li> <li>Empty folder names are not allowed.</li> </ol>
issue