-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Allow typing event arguments for autocomplete #1180
Conversation
Your Render PR Server URL is https://toolpad-pr-1180.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cd7uq7la4993hvueojlg. |
@bytasv Was running into limitations with global scope explorer. My fix also removes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good ✅
Few minor suggestions to consider:
- with "virtual scroll" initially UI looks a bit "broken" - maybe it would be worth to consider something that could hint this is scrollable, i.e. using some scroll component that always shows "virtual type" scrollbars. Alternatively maybe add a shadow on the right side which could be hidden upon first scroll
- I'm wondering if we need all that space for expression editor, maybe we could make scope explorer at least a bit wider (I tried setting it to 250px) and also reduce font size a bit so that more info fits into the same area (I tried with 12px)
- Maybe we could also render object's content below it's name, so we would get even more space upon expanding it (might not need to make width of the container itself bigger)
|
Context: #1105 is blocked on supplying autocomplete to arguments passed to event handlers
This PR adds an option
arguments
tocreateComponent
argument type of'event'
that allows specifying a TS interface, to be used for autocomplete. A special typeThisComponent
will be available that allows you to use live values of other props. See https://github.com/mui/mui-toolpad/pull/1180/files#diff-b355b8b4105dc88c343f9bef59352a13b361f2f4152c6b77d58bbb6815361f3eR384 for an exampleAdditionally I had to tweak the global scope explorer to allow for displaying additional global variables. Currently they don't have any extra information on their content.
In order for that to work I had to change a few things and it now looks like:
I propose we avoid expanding the scope of this PR and defer further refinement to #497