nextcloud-libraries / nextcloud-libraries/nextcloud-dialogs

FilePicker: add an option to specify also the file name

Open
#2,491 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
19
Forks
8
Avg merge
2d 5h
Merged PRs (30d)
37

Description

FilePicker misses an option to replicate a "Save As" functionality, in which the user can specify not only a path but also a (new) file name.

Probably this can be done with a new prop for the Vue component, fileName. If it is false (the default), just do nothing more than now. If it is a string, display a new editable text input field inited with the specified string.

It is debatable now to pass this new information to the buttons callback. Existing implementations with allowPickDirectory = true expect just a Folder item, and of course this cannot be broken; perhaps the callback can be called as callback(nodes, filename) (using the value of the new text input) when fileName != false.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the FilePicker Vue component and its buttons callback, then read how allowPickDirectory currently passes Folder items. Confirm the existing behavior when no fileName option is provided and decide how the new filename value can be exposed without breaking that callback. Done means the optional editable filename input and callback behavior are specified and covered by the component's existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.