ericaxu / gemmy

MIT License
51 stars 4 forks source link

Suggestion: Contextually relevant messages #2

Open Sirs0ri opened 1 year ago

Sirs0ri commented 1 year ago

This idea came from Gemmy's "You have plugins that you can update!" message, which coincidentally showed up just after I had updated my plugins, ie. at a time where I definitely didn't have any updates available.

It would be cool if there was an option to filter/populate the list of possible messages dynamically before selecting a message. Then it would for example be possible to start an update-check (app.plugins.checkForUpdates()), and only show the updates related message if there's actually any new updates.

This feature could also be extended to make Gemmy actually useful in certain conditions, some other (more or less helpful) contextually relevant suggestions could be:

Gemmy is probably my favorite April fools joke this year, I'd hope to see it grow over time! :)

ericaxu commented 1 year ago

Thank you for your feedback, will definitely consider it!

Sergei-Korneev commented 1 year ago

Hello, guys. BTW, is there any method to check for plugins/app updates which returns something like true/false/array? The app.plugins.checkForUpdates() only shows a notification and returns undefined.

Sirs0ri commented 1 year ago

Yes, there kinda is. app.plugins.updates is either an empty object, or it has info about outstanding updates. But I don't think the API exposes a method that checks for updates and returns the result right away. You'd have to call app.plugins.checkForUpdates(), await the result and then check app.plugins.updates.

I currently have outstanding updates and it looks like this:

{
  "obsidian-leaflet-plugin": {
    "repo": "valentine195/obsidian-leaflet-plugin",
    "version": "5.5.0",
    "manifest": {
      "id": "obsidian-leaflet-plugin",
      "name": "Obsidian Leaflet",
      "description": "Interactive maps inside your notes",
      "version": "5.5.0",
      "minAppVersion": "0.12.12",
      "author": "Jeremy Valentine",
      "repo": "valentine195/obsidian-leaflet-plugin",
      "isDesktopOnly": false
    }
  }
}