-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make console interactive #667
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
Make console interactive #667
Conversation
This is looking great. I've been digging into the CodeSandbox code to figure out how to fix the |
@shinytang6 any update on this? do you need any help or guidance? |
Sorry for the delay @catarak, I’ve been a little busy in recent weeks,but I will come back to finish it in next week! |
no worries! just wanted to make sure you weren't waiting on anything from me 😄 |
it's working, this is so cool!!!! anything you still have yet to solve? one thing i noticed is that the cursor appears if the sketch is not running, and you can execute code. i assume it's running within the context of the web editor itself, but i think this should be disabled if the sketch is not running. i will also do an in-depth review of the design and give feedback in that area. |
I referred to the chrome console, so I made the cursor focused when the page is ready, but that is easy to change:) |
Comment line actually works in Chrome developer tools, so maybe it's fine to leave? I also think the start sketch shortcut is fine to leave, if you think about it more like a "refresh sketch" shortcut. But yes, I think it's important to consider all of the shortcuts and make sure it makes sense to leave the all. Also I noticed that there's no syntax highlighting—is this because you haven't implemented it yet or do you need help with that? |
I haven't implemented the syntax highlighting yet, I tried to configure the auto-completion and syntax highlight before but failed lol. @catarak Have you ever configured that before? |
the syntax highlighting is implemented in the web editor—see https://github.com/processing/p5.js-web-editor/blob/master/client/modules/IDE/components/Editor.jsx for reference, but basically you just need to include the syntax highlight file, which is already part of the web editor repo. i don't know how to do autocomplete—@kaganjd and i had worked on it but we got stuck, and maybe we weren't taking the right approach. we can always come back to it later! |
👍 for this! |
@catarak l found the autocomplete that the codemirror provides is a bit annoying. There are some bugs l haven't solved if autocomplete is enabled. Do you think it's necessary for us to support it now? If necessary, I will continue to explore |
@shinytang6 i don't think you need to support autocomplete, and we can leave that for later! |
@shinytang6 I noticed that the syntax highlighting is working for the interactive input, but then, once you hit "enter", the syntax highlighting disappears. |
@catarak I took CodeSandBox as the reference, maybe the color of output should keep the same? |
got it! i was looking at the chrome developer tools for reference. upon thinking about it, keeping the syntax highlighting when entering code would be difficult to implement. one thing i see right now that's left to fix is disabling the console input if the sketch isn't running. the other thing is the position/styling of the input. since there's not a design for this, i would use codesandbox as reference. i like that the input is fixed to the bottom, and i like that it has a different background color from the console to differentiate it. let me know if you need more help with these design specifics! |
@shinytang6 do you need any help with these design changes? |
@catarak do you mean collapsing the console as default? And l met some trouble implementing the different background color of console, could you help me if you are free? |
I mean hiding the 'ConsoleInput' component if the sketch is not running. You can do this in React like (this is approximate code) {{ this.props.isPlaying &&
<ConsoleInput />
}}
Yes! So the background color of this input should be the same color as in the code editor, i.e. looking at the .cm-s-p5-<theme> {
background-color: <this color!!!!>
} In the SCSS theme map, I would change the variable .console__editor .CodeMirror {
...
@include themify() {
background-color: getThemifyVariable('console-background-color');
}
...
} And .console__input {
...
@include themify() {
background-color: getThemifyVariable('console-background-color');
}
...
} |
@catarak how about the current style? |
looking great! a couple things:
|
i've been really slowly working on this, and i think it's finally ready to be merged! woohoo! |
Before your pull request is reviewed and merged, please ensure that:
npm run lint
Fixes #123
Thank you!