Skip to content

Issue #17 - [FEATURE] Add "Duplicate File" Option to File Context Menu #20

@codepath-open-source-ci

Description

@codepath-open-source-ci

Current Behavior

There is no direct way to duplicate a file from the context menu. Users must use Copy (Ctrl+C) followed by Paste (Ctrl+V), which creates a copy but doesn't automatically generate a unique filename.

Reproduction Steps:

  1. Open Puter in a web browser
  2. Navigate to any folder and create a test file named document.txt
  3. Right-click on document.txt to open the context menu
  4. Observe: The menu shows options like Open, Rename, Copy, Delete, etc.

Expected Behavior

When right-clicking on a file, the context menu should include a "Duplicate" option that creates a copy of the file in the same directory with an automatically generated name that avoids conflicts.

Acceptance Criteria:

  • A "Duplicate" menu item appears in the file context menu (not for folders, only files)
  • Clicking "Duplicate" creates a copy in the same directory
  • The duplicated file has an automatically generated name (e.g., document copy.txt or document (1).txt)
  • If a file with the generated name already exists, the system adds a number suffix (e.g., document (2).txt, document (3).txt)
  • The newly duplicated file appears in the file list immediately without requiring a refresh

Steps To Test

Manual Testing:

  1. Open Puter and create a test file test.txt with some content
  2. Right-click on test.txt and select "Duplicate"
  3. Verify a new file appears named test copy.txt
  4. Verify the content of both files is identical
  5. Right-click on test.txt again and select "Duplicate" again
  6. Verify a new file appears with a unique name like test (2).txt or test copy 2.txt

Submission

Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.

Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions