mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
965 stars 244 forks source link

Create a UI for Actions #1953

Open prakhargupta1 opened 1 year ago

prakhargupta1 commented 1 year ago

Duplicates

Latest version

Summary 💡

In the current Toolpad, there are a few actions that can be triggered through event handler props like onClick. Some of these actions are:

  1. Running a query
  2. Changing state of a component
  3. Setting local storage
  4. Navigating to a page
  5. Navigating to a URL

We support all of this but it involves writing code. The DX can be improved if there was a UI for this.

Also, as a beginner I would get confused between query.call(), query.fetch(), query.refetch(). Making these available through the UI and a helper icon explaining which one to use in what scenario would be great.

Examples 🌈

Retool

Screenshot 2023-05-02 at 1 09 54 PM

Appsmith (has more actions)

Screenshot 2023-05-02 at 1 19 36 PM Screenshot 2023-05-02 at 1 19 43 PM

Superblocks

Screenshot 2023-05-02 at 1 21 03 PM Screenshot 2023-05-02 at 1 21 10 PM

Motivation 🔦

No response

bharatkashyap commented 1 year ago

@prakhargupta1 I feel like

The DX can be improved if there was a UI for this.

this might be the case for beginners, but more developers (including myself) would prefer if we could move all of the client side code we currently write to the IDE.

For example, can we just write all of the client side code inside resources/client/functions.ts and use a special useClient() so that we can bind to the runtime values of client-side variables? We could then simply connect UI elements to code written in the editor. I see two advantages to this:

I've expanded on the above thought in the Toolpad product topics Notion document

prakhargupta1 commented 1 year ago

Can we just write all of the client side code inside resources/client/functions.ts and use a special useClient()

If we could have an AI copilot to help write these actions faster in pro-code, then this approach would be good as this will give customizability without compromising on speed. It will also ensure that the developer learns and that Toolpad isn't a blackbox. This would be quite like Interval.