polar icon indicating copy to clipboard operation
polar copied to clipboard

Feature Request: Polar Widgets

Open crisdut opened this issue 1 year ago • 4 comments

Polar is a great project, and I like to use it to explain how LN works and show the possibilities of the network. However, sometimes I miss some features to help me, like "step-by-step guides" or "tutorials".

But extending Polar with these features will increase complexity and is out of scope.

Because of this, I start thinking about changing Polar to support Widgets.

How Works

I think exists two ways to make this works:

  1. Create a type of "react event bus hook" to nodes and actions commands to allow the widgets to intercept and process events.
  2. Change Sidebar to supports inject new "Actions".

Example:

Imagine a tutorial Widget called "My First Invoice", like a IntroJS.

To build this, I need to check if "Create Invoice" and "Pay Invoice" is called to my widget works.

Event Bus Example: here

Does make sense to you?

crisdut avatar Nov 08 '22 06:11 crisdut

I think I understand what you are trying to accomplish. You'd like some extensibility points added to Polar which would allow others to create widget-like plugins that add additional functionality, such as step-by-step tutorials. Are you imagining the widgets living in the same codebase as Polar, or external plugins that can be loaded in at runtime?

jamaljsr avatar Nov 09 '22 15:11 jamaljsr

I think I understand what you are trying to accomplish. You'd like some extensibility points added to Polar which would allow others to create widget-like plugins that add additional functionality, such as step-by-step tutorials. Are you imagining the widgets living in the same codebase as Polar, or external plugins that can be loaded in at runtime?

Hi @jamaljsr,

Yes, exactly.

Well, I think the best solution is external repos. The users install widgets by command line or with an interface with a list of widgets.

crisdut avatar Nov 09 '22 22:11 crisdut

This is an interesting idea. It's not something I can prioritize working on at the moment, but I would be fine reviewing a PR if someone else wants to work on implementing it.

jamaljsr avatar Nov 15 '22 15:11 jamaljsr

This is an interesting idea. It's not something I can prioritize working on at the moment, but I would be fine reviewing a PR if someone else wants to work on implementing it.

Ok, don't worry.

I opened the PR to share some ideas.

Next week, I will start the implementation.

Thanks for feedback!

crisdut avatar Nov 15 '22 16:11 crisdut