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

Future Ideas for additional features #20

Open
makermelissa opened this issue Sep 14, 2022 · 19 comments
Open

Future Ideas for additional features #20

makermelissa opened this issue Sep 14, 2022 · 19 comments
Labels
enhancement New feature or request

Comments

@makermelissa
Copy link
Collaborator

makermelissa commented Sep 14, 2022

This issue will mostly serve as a thread that other can contribute to with some ideas for future functionality with the CircuitPython Code Editor. Here's an initial list I came up with based on taking a look at https://python.microbit.org/v/beta:

  • Some code snippets which could be cool. For snippets, perhaps either we could make use of Read The Docs or include some code snippets in the repository of the library and have some kind of interface where it grabs the code snippets we have there
    • We could also possibly use Read The Docs to display some integrated documentation
    • The tricky part would be having it know which docs went with specific library functions
  • Maybe we could do something like Pyleap and load code from a learn guide in the future, though the details would need to be worked out.
  • Adding some tabs and just displaying the active document in the serial terminal and editor
    • This would also be a bit tricky with juggling and transferring between URLs, but not impossible
  • Adding additional language support
  • Font sizing is a great idea
  • Perhaps some color themes for people who don’t like the dark look of the editor
  • Adding something like CircUp to the Editor as well like has been discussed in various places
  • Deployment to Devices has been discussed
  • Perhaps adding some kind of Self Signed Certificate generator may be an option along with deployment so we can do HTTPs for Web Workflow.

Feel free to contribute your own ideas.

@makermelissa
Copy link
Collaborator Author

Another idea I had was to support additional language color coding based on file extension that was opened. This would be fairly easy to add.

@makermelissa
Copy link
Collaborator Author

This is more of a "way out there" idea and is probably impractical.

A GUI that allowed a person to create a program interface and add code to the widgets kinda like Visual Basic or Hypercard and it generates a CircuitPython program that somebody could download to a device. Maybe something for PyPortal to start with. Maybe it could make use of the displayio layout library and various UI elements we already have done.

@makermelissa makermelissa added the enhancement New feature or request label Oct 19, 2022
@urfdvw
Copy link

urfdvw commented Oct 19, 2022

In USB workflow.
Opening a folder instead of a file is going to make many interesting features possible.
For example, instead of creating a new file, download it and drag it into the CIRCUITPY drive,
having a directory handle will allow you to directly create a new file on the CIRCUITPY drive edit it.
Many other functions like reading the CPY version number from boot_out.txt are also possible in that way.

@makermelissa
Copy link
Collaborator Author

In USB workflow. Opening a folder instead of a file is going to make many interesting features possible. For example, instead of creating a new file, download it and drag it into the CIRCUITPY drive, having a directory handle will allow you to directly create a new file on the CIRCUITPY drive edit it. Many other functions like reading the CPY version number from boot_out.txt are also possible in that way.

Huh, ok. If you know how to to this, or could at least provide further information, that would be great. I tried to implement this using webkitdirectory (as I described in more detail in #15) and it just returned all of the files. Perhaps I didn't explore this option as thoroughly as I should have.

@makermelissa
Copy link
Collaborator Author

Is this what you're referring to? https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle

@makermelissa
Copy link
Collaborator Author

Is this what you're referring to? https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle

Ok, yeah, this looks very promising and is more in line with how I wanted USB workflow to work anyways. I will explore this option very soon. Thanks for the suggestion and pointing me in the right direction.

@urfdvw
Copy link

urfdvw commented Oct 19, 2022

Is this what you're referring to? https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle

Ok, yeah, this looks very promising and is more in line with how I wanted USB workflow to work anyways. I will explore this option very soon. Thanks for the suggestion and pointing me in the right direction.

No problem.
Just beware that some of the features are only available in https environment.
And even in https I didn't get renaming file working. If you know how please also let me know.

@makermelissa
Copy link
Collaborator Author

Thanks. The intention is to have the USB workflow only run from https://code.circuitpython.org, so #28 would probably need to be completed first.

@urfdvw
Copy link

urfdvw commented Oct 19, 2022

Thanks. The intention is to have the USB workflow only run from https://code.circuitpython.org, so #28 would probably need to be completed first.

Sorry, just want to know a little more. What do you mean by "run from https://code.circuitpython.org/"?
Are the workflows currently running somewhere else?

@makermelissa
Copy link
Collaborator Author

makermelissa commented Oct 19, 2022

Sorry, just want to know a little more. What do you mean by "run from https://code.circuitpython.org/"? Are the workflows currently running somewhere else?

Ah, to get around some browser security issues, Web Workflow loads from the device itself using http. The device loads https://github.com/circuitpython/web-editor/blob/main/assets/js/device.js which pulls in and loads the website. More information is available at https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor/usage.

@makermelissa
Copy link
Collaborator Author

I think the circup-like feature (as mentioned in the first post above) is what would be probably most useful. With Web Workflow, because the file system needs to have USB mass storage disabled, updating libraries becomes really inconvenient.

@makermelissa
Copy link
Collaborator Author

Something that could be built on top of the circ-up feature would be a code scanner that automatically detects the libraries you need and asks if you would like to update/install them.

@urfdvw
Copy link

urfdvw commented Feb 24, 2024

Something that could be built on top of the circ-up feature would be a code scanner that automatically detects the libraries you need and asks if you would like to update/install them.

curious to know what is the best way to pull the latest libraries from front end?

@urfdvw
Copy link

urfdvw commented Feb 24, 2024

One simple but helpful idea:

Open 2 directories

  • one is CIRCUITPY, as usual
  • the other is a local backup dir, say, a git directory.

At the moment saving file to CIRCUITPY, make the same update to the local directory.

This is useful for project backup.

@makermelissa
Copy link
Collaborator Author

makermelissa commented Feb 24, 2024

curious to know what is the best way to pull the latest libraries from front end?

Here's one way I've done it before: https://github.com/adafruit/Adafruit_Dynamic_Bundler, though it likely needs updating for more recent CP versions.

@s-light
Copy link

s-light commented Mar 25, 2024

i like the idea to program CP in a visual way

just some thoughts on this

i personally like the flow based version more than the blocky approach as its more of a real visual appealing design..

in general i think it would need a automagic system to parse the libraries and create components for them.
(maybe as a build job on the library builds...)
as otherwise you have no libs to use.. (its a to big burden for the lib maintainers to generate something special for the editor i think...)

what do you think about this?

would be a PR including some simple beginner friendly visual editor be an option?
i think it would make most sens to include this in the web-editor...
this way the visual editor is just a different representation of the normal code.
(and with this written down i think it will be difficult to follow the flow based approach - as it will be ?very difficult? to generate a flow out of some hand written code?!)

@urfdvw
Copy link

urfdvw commented Mar 25, 2024

i like the idea to program CP in a visual way

just some thoughts on this

i personally like the flow based version more than the blocky approach as its more of a real visual appealing design..

in general i think it would need a automagic system to parse the libraries and create components for them. (maybe as a build job on the library builds...) as otherwise you have no libs to use.. (its a to big burden for the lib maintainers to generate something special for the editor i think...)

what do you think about this?

would be a PR including some simple beginner friendly visual editor be an option? i think it would make most sens to include this in the web-editor... this way the visual editor is just a different representation of the normal code. (and with this written down i think it will be difficult to follow the flow based approach - as it will be ?very difficult? to generate a flow out of some hand written code?!)

Hi @s-light !

Have you checked https://make.playpiper.com/ before?
It provides a block based CPY editor and packages for components.
There you can ignore the python part, or open the tab to see the generated python code from the blocks.
I am not sure if you can edit some part of the python code directly.

@s-light
Copy link

s-light commented Mar 25, 2024

no i did not tried this..
as fare as i can tell it uses the blocky editor / MS make.
where did you find the packages ?
do you know if the editor implementation from them is opensourced?

just also found
https://think.cs.vt.edu/blockpy/blockpy/load

so to integrate blockly should be possible..

after more research on flow-based UIs i think there is no easy fitting framework/library out there..
(without writing all the code-generation myself)

so for now i thin blockly is the only option.

and found a good starting point for this:
https://github.com/blockpy-edu/BlockMirror

@s-light
Copy link

s-light commented Mar 26, 2024

i extracted this in its own featurerequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants