Skip to content

[Bug]: Templater code flashes for a split second on new note creation #19

Closed
@greetclammy

Description

@greetclammy

Issue validation

  • I checked the issue to prevent duplicate
  • I checked my configurations files and the documentation

Describe the bug

When I create a new note w/ a Templater template attached below, its source code flashes for a second before being applied. This only happens when I use Create Note in Folder. This doesn't happen when the template is applied w/ Templater only, without using Create Note in Folder. Everything functions fine, the problem is purely visual: it's unsightly. I just wish the source code didn't flash like this 😢

Note: to circumvent this, I also attempted to use QuickAdd instead, and ran into the same problem: the source code flashes just the same when using it! But given that that plugin has hundreds of open (and more pressing) GitHub issues, I don't think they will ever get around to fixing this...

How to reproduce ?

  1. Create command w/ the configuration below:
Screen Shot 2024-10-31 at 13 36 59
  1. Create new note w/ Create Note in Folder command:
Screen.Recording.2024-10-31.at.12.46.35.mov

Minimal Reproducible Example

Templater template:

---
created: <% moment(tp.file.creation_date()).format("YYYY.MM.DD HH:mm") %>
modified: <% moment().format("YYYY.MM.DD HH:mm") %>
tags: []
---

Configuration

{
  "folder": [
    {
      "path": "~Inbox 📥",
      "commandName": "Create Inbox Note in New Tab",
      "template": {
        "type": "none",
        "format": "~Inbox 📥",
        "position": "append",
        "separator": "",
        "increment": true
      },
      "fileName": "Untitled",
      "opening": "newTab",
      "focused": true,
      "splitDefault": "horizontal",
      "alreadyExistOpening": {
        "opening": "newTab",
        "splitDefault": "horizontal",
        "focused": true
      },
      "fileMenu": false,
      "templater": "一Templates/x.New-Note-Template.md"
    },
    {
      "path": "~Inbox 📥",
      "commandName": "Create Inbox Note in Same Tab",
      "template": {
        "type": "none",
        "format": "",
        "position": "append",
        "separator": "",
        "increment": true
      },
      "fileName": "Untitled",
      "opening": "current",
      "focused": true,
      "splitDefault": "horizontal",
      "alreadyExistOpening": {
        "opening": "newTab",
        "splitDefault": "horizontal",
        "focused": true
      },
      "fileMenu": false,
      "templater": "一Templates/x.New-Note-Template.md"
    },
    {
      "path": "~Inbox 📥",
      "commandName": "Create Inbox Note to The Right",
      "template": {
        "type": "none",
        "format": "",
        "position": "append",
        "separator": "",
        "increment": true
      },
      "fileName": "Untitled",
      "opening": "split",
      "focused": true,
      "splitDefault": "horizontal",
      "alreadyExistOpening": {
        "opening": "newTab",
        "splitDefault": "horizontal",
        "focused": true
      },
      "fileMenu": false,
      "templater": "一Templates/x.New-Note-Template.md"
    }
  ],
  "customVariables": [],
  "timeOutForInlineTitle": 50,
  "enableAllFolder": false
}

Relevant log output

No response

Anything else?

No response

OS

IOS, MacOS

Obsidian information

SYSTEM INFO:
	Obsidian version: v1.7.4
	Installer version: v1.7.4
	Operating system: Darwin Kernel Version 20.6.0: Thu Jul  6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64 20.6.0

Plugin version

1.12.2

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions