Developer-Mike / obsidian-advanced-canvas

⚡ Supercharge your Obsidian.md canvas experience! Create presentations, flowcharts and more!
GNU General Public License v3.0
365 stars 17 forks source link

[FR] Auto-Append "Canvas Name" to New Markdown Files #85

Closed Pixel3ro closed 4 months ago

Pixel3ro commented 4 months ago

Example Use Case: Consider an example where you have a canvas named "ApplePieRecipe.canvas". When creating new markdown files within this canvas, one might use short names such as "ingredients.md" "steps-to-follow.md" etc. However, when searching through the entire Obsidian vault, files such as "ingredients.md" would have counterparts in other recipe canvases. Because these file-names lack sufficient context, it becomes difficult to distinguish between multiple files with the same name.

Feature: Auto-Append ParentCanvasName to new .md files created within Canvas If a new markdown file is created within a canvas named "ApplePieRecipe.canvas", the file name will be automatically set to "NewFileName - ApplePieRecipe.md". Appending the ParentCanvasName to the file name provides necessary context, making it easier to navigate while searching for files in a large Vault. This feature is intuitive to adopt many common use cases, like "todo.md", "log.md" created in any Project-canvas.

Considerations: - describing the finer details

  1. Default Behavior of Auto-Append Importing existing files - In most use-cases adding CanvasContext to a File which is made elsewhere would lead to confusions. _Eg. DailyNotes.md, grocerylist.md So Auto-Append is disabled for imported files by default. Only newly created files within a Canvas are Auto-Appended with the name of the ParentCanvas.
  2. On/Off - Per-Canvas: There should be a way to allow the user to manually enable/disable Auto-Append feature to individual Canvases. Note: This configuration is retained even after an app restart.
  3. On/Off - Canvas(Global): In plugin options, a toggle called "Global Default" decides if Auto-Append is enabled/disabled for All-the-Canvases in the Vault. Note: Toggling this back and forth should NOT affect manual configs made in pt.2
  4. On/Off - Files: add/remove CanvasContext to individual FileNames
    • For singe files - A button to "add/remove" the selected file's CanvasContext. Note1: The current state of CanvasContext of the file (obtained by checking the FileName if CanvasContext is already appended or not) is indicated via button state. This helps the interaction intuitive. Note2: users editing the file-name directly to manually-modify CanvasContext should be recognized and not cause bugs/conflicts.
    • For multiple files - Upon Multi-selecting files in Canvas and a button to bulk-add/remove CanvasContext
  5. On/Off - while creating a new file: While adding files to the Canvas by typing the name of a file, Enter-key would import an existing file from the search results dropdown, Shift+Enter would create a new file. Similarly a shortcut /+Enter for example could give finer control over Auto-Append while creating a new file.
    • if Auto-Append is enabled (Per-Canvas/Global) - shortcut Disables it only for the currently created file.
    • if Auto-Append is disabled (Per-Canvas/Global) - shortcut Enables it only for the currently created file.
  6. Auto-Append to include GroupName formatted as "FileName - GroupName - ParentCanvasName.md"
  7. For users who use Portal feature (Canvas-Embeds) similar Auto-Append features for Canvases that are newly created within the CurrentCanvas would be useful. [ I add .canvas at the end of FileName to create EmbeddedCanvas within currentCanvas Eg. _KindleHighlights.canvas]
  8. An API or similar functionality to allow the "Canvas-File relationship" to be used by other tools like Templater, where one can add {ParentCanvasName} to YAML metadata, etc. (I understand this could be overkill. I am only describing how I had imagined the bigger picture without cutting short. I totally understand if some of these features are to be ignored for the time being. personally I think pts. 5, 7, 8 can be ignored if need be)
Developer-Mike commented 4 months ago

1-7: While I do understand your particular use case, I've personally never missed a feature like this one. And considering the effort needed to implement such a feature and regarding the other planned features, this feature is at the bottom of the priority list. 8: This could be added for #16

Due to those circumstances, I'll close this issue as not planned for now.