danielo515 / obsidian-modal-form

Define forms for filling data that you will be able to open from anywhere you can run JS
https://danielorodriguez.com/obsidian-modal-form/
MIT License
208 stars 18 forks source link

[Feature request] Designate "Parent Folder" for narrowing folder search options with Folder Type Fields #305

Open AucklandIO opened 3 months ago

AucklandIO commented 3 months ago

Describe the solution you'd like

I would like to be able to designate a parent folder from which the "Folder" list is populated.

When selecting the "Folder" option, I would like to be able to select a parent folder that populates the folder list with all "next level" folders found within the parent.

image

Here is an example of the current functionality.

Additional context

As an example:

Folder structure

Personal/ | - Health/ | | - Projects/ | | - Tasks/ | - Household/ | | - Projects/ | | - Tasks/ | - Interests/ | | - Projects/ | | - Tasks/ | _ Resources/

Using this folder structure. I could create the following Folder Fields:

Name: Area Label: Area Description: Select Area Type: Folder Parent Folder: Personal

Options within selection modal: Personal/Health Personal/Household Personal/Interests Personal/ Resources

Here is a quick series of mockups I made to demonstrate how I would Imagine it would fit into the workflow:

  1. Select Type: Folder
    • a. Select Parent Folder Designation Icon
    • b. Select Parent Folder: Personal

image

  1. Parent Folder Selected

image

  1. Subfolder Selection Preview Modal with Parent Icon Indication (and possible reselection button?)

image

PLEASE NOTE: I would like this to omit subdirectories of the parent directory by default when the parent folder is selected. If a user would like to include subfolders, perhaps you could add a checkbox to allow that functionality like so:

image

AucklandIO commented 3 months ago

Thank you for your time and consideration for this feature request!

AucklandIO commented 3 months ago

I think this would work well with your conditional selection toggle for designating a default path for files within templater.

For example I intend to use this modal to set properties across a number of different "Project Files" that all require identical properties, but that I would only like to set once.

This is my ideal workflow:

New Project Management
  1. Call New Project Modal Form:
    • Request Project Domain: Personal/Professional
    • Request Project Area: Select Area list based on Domain selection subfolders
    • Request Project Name: {{Project Name}}
  2. Quick add New Project Macro
    • Insert as properties into frontmatter:
      • Domain: {{Selection Result}}
      • Area: {{Selection Result}}
      • Project Name: {{Project Name}}
  3. Create {{Project Name}} Management Files within {{Project Name}} - Management within {{Project Name}} parent directory folder:
    1. Using Project Management File templates containing <% tp.file.move ("/" tp.frontmatter["Domain"] + "/" + tp.frontmatter["Area"] + "/" + tp.frontmatter["Area"] + "Projects" + tp.frontmatter["Project Name"] + "/" + tp.frontmatter["Project Name"] + " - Management" + "/" %>:
      • "Project Dashboard" Template
      • "Project Task File" Template
      • "Project Activity Log" Template
      • "Project Planning File" Template
    2. New Project Management Files are created based on Template instructions within /Domain/Area/Area Projects/{{Project Name}}/{{Project Name}} - Management Files/
New Project Working File
  1. Create {{Project Name}} - Working Files directory in {{Project Name}} directory
    1. Using Project Note Toolbar "Create New Project File" button
    2. Call New Project Note Form:
      • Request Project Note Name:
    3. Create new Project Working File using "Project Working File" Template containing: <% tp.file.move ("/" tp.frontmatter["Domain"] + "/" + tp.frontmatter["Area"] + "/" + tp.frontmatter["Area"] + "Projects" + tp.frontmatter["Project Name"] + "/" + tp.frontmatter["Project Name"] + " - Working Files" + "/" %>
    4. New Project Working File is created based on Template instructions within /Domain/Area/Area Projects/{{Project Name}}/{{Project Name}} - Working Files/
New Project Resource File
  1. Create {{Project Name}} - Resource Files directory in {{Project Name}} directory
    1. Using Project Note Toolbar "Create New Project Resource" button
    2. Call New Project Note Form
    3. Create Project Resource using "Project Resource" Template containing: <% tp.file.move ("/" tp.frontmatter["Domain"] + "/" + tp.frontmatter["Area"] + "/" + tp.frontmatter["Area"] + "Projects" + tp.frontmatter["Project Name"] + "/" + tp.frontmatter["Project Name"] + " - Working Files" + "/" %>
    4. New Project Resource is created based on Template instructions within /Domain/Area/Area Projects/{{Project Name}}/{{Project Name}} - Resources/
danielo515 commented 3 months ago

Have you tried the note input? It allows you to select a parent/root folder. Does that work as you expect? Just for reference, not saying it is a workaround

AucklandIO commented 3 months ago

What I'm trying to do is select the names of the folders as the select list items. I want to create properties with the names of those folders so I can dynamically create the list of directories, inject them into commands based on your templating function and automatically populate templated project directories.