zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.11k stars 224 forks source link

BUG: Types Programattically Added When Not Used #2002

Closed itsonlyjames closed 1 month ago

itsonlyjames commented 1 month ago

Have you searched for existing issues (including closed ones)?

Does this bug persist in a new vault with only Excalidraw installed?

Your environment

SYSTEM INFO: Obsidian version: v1.6.7 Installer version: v1.6.3 Operating system: Darwin Kernel Version 24.0.0: Mon Aug 12 21:27:51 PDT 2024; root:xnu-11215.1.10~5/RELEASE_ARM64_T6020 24.0.0 Login status: not logged in Insider build toggle: off Live preview: on Base theme: dark Community theme: none Snippets enabled: 6 Restricted mode: off Plugins installed: 10 Plugins enabled: 1 1: Excalidraw v2.4.1

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug

Types are added on plugin load and reinstantiate even after deleting.

{
  "types": {
    "excalidraw-export-transparent": "checkbox",
    "excalidraw-mask": "checkbox",
    "excalidraw-export-dark": "checkbox",
    "excalidraw-export-padding": "number",
    "excalidraw-export-pngscale": "number",
    "excalidraw-export-embed-scene": "checkbox",
    "excalidraw-link-prefix": "text",
    "excalidraw-url-prefix": "text",
    "excalidraw-link-brackets": "checkbox",
    "excalidraw-onload-script": "text",
    "excalidraw-linkbutton-opacity": "number",
    "excalidraw-default-mode": "text",
    "excalidraw-font": "text",
    "excalidraw-font-color": "text",
    "excalidraw-border-color": "text",
    "excalidraw-css": "text",
    "excalidraw-autoexport": "text",
    "excalidraw-embeddable-theme": "text",
    "excalidraw-open-md": "checkbox"
  }
}

Comes from the object FRONTMATTER_KEYS.

Steps to reproduce

Remove types. Reload Obsidian.

Expected behavior

Should not be added without requirement, especially when they're not being used. If they are added when they're needed, this would be better.

Additional context

No response

zsviczian commented 1 month ago

not a bug, but a feature. with the introduction of the properties editor people no longer edit YAML frontmatter in source mode. As a consequence you are not aware of the available forntmatter switches to control Excalidraw behavior. These frontmatter switches are super powerful, I couldn't imagine using the full potential of excalidraw without having them available. Registering these properties is a deliberate step. If you don't want to see these there is a plugin setting to disable it, however, then you are going to be in the dark about these frontmatter switches. See the setting at the bottom of this screenshot.

image
itsonlyjames commented 1 month ago

Makes total sense and thanks for the info. For me, I use excalidraw so simplistically that the myriad features are cumbersome. I appreciate there is a setting however—my apologies for not having found this prior to opening this ticket. Thanks!