Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Knob #538

Open
patou opened this issue Mar 1, 2023 · 5 comments
Open

Action Knob #538

patou opened this issue Mar 1, 2023 · 5 comments
Labels
m: knobs p: core Related to `widgetbook` package t: feat New feature or request

Comments

@patou
Copy link

patou commented Mar 1, 2023

Description
It can be a good new feature to have an action panel to log event from the onPressed of a button, for example.
It can be a function action with a name like this :
image

You can see a sample in storybook :
https://microsoft.github.io/vscode-webview-ui-toolkit/?path=/story/library-button--default
image

@jenshor jenshor changed the title Proposition : Add an action panel for log actions feat: action panel for log actions Mar 2, 2023
@jenshor jenshor added the t: feat New feature or request label Mar 2, 2023
@jenshor
Copy link
Member

jenshor commented Mar 2, 2023

Hey @patou. Thanks for opening this feature request. I already had a similar idea and we are looking forward to implementing this 👍🏻

@YoussefRaafatNasry YoussefRaafatNasry changed the title feat: action panel for log actions Action Knob Sep 20, 2023
@YoussefRaafatNasry YoussefRaafatNasry added p: core Related to `widgetbook` package m: knobs labels Sep 20, 2023
@geisterfurz007
Copy link
Contributor

Is this by any chance up for grabs (I know, it isn't labeled hacktoberfest but I made a promise to try and redeem myself)?

My understanding is that there are two parts to this:

  • An additional knob function that returns a varargs function logging all parameters thrown into it
  • A new panel or section in the existing sidebar (or possibly a new panel in the bottom?) where those things would be logged. Alternatively, to save on screen real estate, these logs could also go into the console of the running process but that's probably less desirable 🤔

@YoussefRaafatNasry
Copy link
Member

@geisterfurz007 This issue needs a lot of planning to be implemented properly. At the surface, it might look like an easy issue, but deep down there a lot of other aspects that need to be taken in consideration.

One of the primary aspects will be "Widgetbook Cloud". Widgetbook OSS is rendered as a WebView inside the React app of Widgetbook Cloud, thus this WebView must notify the host app with all the actions being fired as well. We have solved this issue with Knobs by creating the "Fields API" that uses postMessage API. We would like to create another API called "Signals API" to send events to any host app, in fact we might rename actions to signals as well if needed.

If you still wanna work on this feature, we will have to communicate more about it.

@geisterfurz007
Copy link
Contributor

I am still down! I am not sure what works best in terms of communication for you. Alternatively if you say that this needs to be fleshed out a bit more and think there is some other issue better suited for me, I'll happily pick that up too! I saw one about setting category and folder for Usecases for example that I would both love to work on and love to have in Widgetbook :)

@YoussefRaafatNasry
Copy link
Member

YoussefRaafatNasry commented Oct 8, 2023

@geisterfurz007 I prefer if you worked on the category/folder issue first. It will be a good start to get yourself familiar with the code. Please add a comment there so I can assign it to you.
I will also come back to you once I have a better design document for this issue, and you can also work on it once it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m: knobs p: core Related to `widgetbook` package t: feat New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants