Skip to content

Menu items have no text on macOS #314

Closed
@Taitava

Description

@Taitava

Discussed in #313

Originally posted by breaker-of-stone January 4, 2023
(dup. from Obsidian forum)

Issue, or lack of understanding?: I am using Obs. 1.1.9 on a Mac Pro under MacOS Ventura.

I have one shell command registered and it functions correctly, however where the alias should appear in the file context menu is a blank item:

image

...

I suspect that the bug only happens on macOS (not 100% certain, though). I suspect the problem is that menu title generation takes too long, and by the time the title is generated (i.e. variables parsed), the title text is set too late to the menu item, and so it doesn't appear visually in the menu on some systems.

TODO:

  • If 0.18.0 doesn't fix the bug, remove this issue from CHANGELOG.md.
  • Fix the bug by setting the menu item title as soon as possible. This means setting the title before {{variables}} are parsed in the title, so the menu might show unparsed {{variable}} texts. After variable parsing finishes a few milliseconds later, the menu title should be updated so that actual variable values will show instead of {{variable}} texts.
  • Create a feature request for Obsidian so that Menu.addItem() would support asynchronous callback functions. This is for improving the menu item title generation later. The first version of the fix should not need this. Edit: Here: https://forum.obsidian.md/t/menu-additem-support-asynchronous-callback-functions/52870/2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions