mindofmatthew / text.management Goto Github PK
View Code? Open in Web Editor NEWExperimental Live Code Editor
License: GNU General Public License v3.0
Experimental Live Code Editor
License: GNU General Public License v3.0
I want to highlight a problem raised in the Tidal club forum. It can become quite messy to define all helper functions etc. in a single file. The standard pattern for Tidal seems to be to be to place reusable things in BootTidal.hs
. However, there appears to be a severe tradeoff where, if we want to go and work on those functions again while working on some Tidal project, we need to reboot the entirety of Tidal (specifically, the scheduler) which interrupts the interactive flow.
A thought of mine is that maybe it would be possible to address this in the editor? Perhaps it could work to split up one session into multiple files and if we want to change a function in a different file, we can reevaluate that whole file? Another possible solution might be to allow smaller "windows" in one file like in Jupyter or Livebook.
This would be better done on the hydra
branch, because the Code Mirror Javascript language mode is more sophisticated than the old Haskell one.
Anyway, a cool thing to do with better language support would be to actually grab the current statement on enter, rather than the current line. Naively evaluating the current line (even in a multi-line statement) is an annoying thing that multiple live code editors do. Right now, I don't know how feasible this is...
More reasonable would be trying to integrate some of the other features that I'm sure Code Mirror supports. For example, running the diagnostic system to catch JS syntax errors, and maybe also adding an autocomplete for Hydra functions (I can figure out how to pull that list of function names).
For Tidal/GHCi (and future REPL-based livecode systems), use the presence of a prompt to signal that a discrete amount of output (or an error) has been printed. Use this for splitting console output into individual messages.
A couple use-cases (which may get punted to future issues):
Keyboard shortcuts for tabs:
Mod-W
to close tabs?Mod-Left/Right
to navigate between tabs? Mod-Tab
?Esc
for showing/hiding console (probably Mod-`
)When evaluating a line of code, the editor should display a highlight decoration for the given line for a second. I attempted this in the tidal-highlights branch, but didn't get far, and Caleb mentioned that he wasn't able to get it to trigger a re-render either.
The first decoration example here seems to be exactly what I've described, so we need to figure out what's missing from there.
The question of how these decorations get removed is still pretty open. Ideally, it would be cool if they stayed around and applied some subtle styling (after a bright initial flash) to indicate evaluated lines vs non-evaluated lines. Then, they could get grayed out if they no longer have an effect (eg, after evaluating a different line of code that takes over some output or something), but that's a very speculative thing that would need a level of integration with code environments that (I believe) doesn't exist yet.
In multi-user mode, show cursors to indicate where everybody is
File actions on desktop:
The goal with this project is to create an environment that can support a wide variety of programming languages. Eventually, language packages will be well-defined and other people can contribute their own, but for now, I'm going to focus on incubating some language packages within this repository to guide development.
That said, what should I focus on? I'll add some comments for individual languages—reach with an emoji to the ones that you're most interested in seeing, or post comments suggesting others that you'd like to see.
Integrate the collaborative editing mode (and web editor) back into the Electron app
If the user selects multiple lines and then hits the evaluate key, the editor should get the lines containing the selection and then evaluate the entire range
The custom-styled scrollbars currently cover the scrolling content. Detect when a scrollbar is going to be shown and add some extra padding to the scroller on the right and/or bottom edges
first off, really great work!
what i would like to suggest is a display of the current cps and bpm and possibly also of the current cycle modulo a editable parameter (so if we are on cycle 400 and the modulo is set to 8 it will show 0)
i think the cps can already be queried from the running tidal stream, i'm not completely sure about the current cycle (might have to be implemented on the tidal side or the tidal-listener side)
then, what would be really awesome is to have a tap tempo to set the cps triggered via a shortcut key!
Mac OS and Windows have support for an auto-update mechanism. It should be pretty easy to implement—it uses GitHub releases by default, and just requires hooking into a few lifecycle events.
Blocked by #44
There are various issues and cross-browser inconsistencies when using screen readers. Some of these might need to be upstream bugs filed against CodeMirror, and some might just be browser bugs, but I'm capturing them here for further experimentation and diagnosis:
Was trying to test it out but couldn't find it :)
Support Feedforward/Strudel-style event highlighting. This involves injecting some metadata into the program before running it. Alex explained how this works in Feedforward.
This mostly depends on #18, but it would be good to get some basic idiomatic Tidal auto-indentation working. I got a rough indentation service set up, but it needs to handle more cases and, in particular, I've yet to figure out how auto-indentation when pressing enter between brackets works
There was a GSoC project to develop a CodeMirror 6 language mode for Haskell. The project seems somewhat defunct, so I think it makes sense to fork it for now and continue developing it as a package within this repo.
The Squirrel installer allows you to have a custom loading animation. Work on that.
I'm bad at using keyboard shortcuts when I write code, so I don't have a good sense of what's useful to folks. What are your favorite keybindings?
The root of the repository should have a src
folder with core text-management source code
Typing ...
then deleting one character causes the ..
ligature to disappear. A vanilla content-editable div doesn't have this problem, so it's presumably a CodeMirror (or extension) bug. I'll file an issue against CodeMirror once I have more information.
Finesse the theme a bit. Make a "dark" (white text on dark highlights) and "light" (black text on white highlights) variant, test both with a variety of background colors and inherit the operating system's preferred mode.
Undo and redo are supposed to be supported, but they don't work well at all in the current version of the editor.
The node CLI should print the generated URL to the console
Set up GitHub actions for automatically building Electron binaries and attaching them to releases
So something that I find I do quite regularly is begin typing a big idea, then realise I need to change something small somewhere else, make the change, forget about my big idea that I've begun writing then wind up at some point attempting to evaluate the incomplete code changes forgetting that they are there at all.
It would actually be really nice if the editor could highlight my not-yet-evaluated changes somehow, sort of like how you can get uncommitted git changes highlights - there is a whole other discussion on how it would look (eg how to highlight a deletion, or partial deletion change) but for myself at least this could be a really killer feature :)
An (overly simplistic) neovim example with the gitgutter plugin:
Instead, pick it at random and then pass it into GHCI as an environment variable
I think this is already at a point where it only does a few things, but does them well, with a minimum of bugs (mostly because CodeMirror is a mature project that works very well). So, it’s nearly time to start putting real version numbers on things. Here are a few outstanding features that I think are necessary for minimum viable text.management:
Add a GitHub action to run tests (and typechecks)
0.7.0 is great. Theme is 🥇
Tiny feature request, a visual indicator on hitting ctrl-s would be very helpful :)
Two parts: Strip the prompt off the first line and then remove the relevant :set
directives from any processed files (we don't want to allow users to set prompts because they're not actually in a REPL).
Nitpick: the default cursor is 2px wide, but both pixels are right of center.
Also see what (if anything) can/should be done about cursor height and vertical alignment.
Hey Matt, this is is really nice, thanks so much for making it!
One thing I'm finding is that after I evaluate something and an error is thrown, it sometimes confuses me for subsequent evaluationss because it is still there and red even though my code is fine after fixing the issue.
I was thinking that maybe it'd be good if it could just flash red and fade out, so you know it's an error now
Another option could be to change the background colour on a successful eval from red to something non-descript
Many possibilities I'm sure, don't have a particular preference but just looking for it to be easier to map errors to actions in time.
Thanks :)
Under the hood the request to get the version/establish that Tidal is installed is probably crashing due to single-quotes in Node child process commands. (A problem that I already solved elsewhere but forgot to fix here.)
We should have a status bar at the bottom that can host basic information about running livecode systems, etc. For now, proof of concept is a bar that displays the following information:
Tidal (1.9.4)
or whatever when runningTidal (Disconnected)
or something when Tidal isn't available in a web environmentTidal (Error)
or something when there's an error with GHCIOn the GHCI side, set up a slight delay so that multi-line messages (in particular error logs) can be sent to the interface as a single "message" object
Roadmap
Pull exposed functions from Tidal package via GHCi and enable a simple auto-completion extension
Currently an extra-wide editor can cause the page content to be greater than 100% width. Instead, set up editor to scroll on its own, which works with the graphics canvas and theoretically works with multiple columns of editors.
It would be good to actually do proper code signing on Mac & Windows. This passes certain OS-level security checks, and is necessary for auto-update.
This is just blocked by not wanting to spend money yet.
The "Mod-." keybinding seemed to not work on a MacBook. Might be a Mac-specific issue, or an issue with specifying the key as "." vs "Period" or something.
The editor is designed to have pretty backgrounds, so there should be a setting for changing the default background. Ideally this supports setting a background color and (in the absence of a fully-formed Hydra engine) an arbitrary URL for an iframe that can be embedded.
Is it even possible?
Icons on Linux don't seem to work quite right, presumably because of electron-userland/electron-builder#5294.
A hacky version of this exists, but it would be good to get it properly implemented. This means support for multiple documents, running in multiple systems, etc.
The default theme should handle high-contrast colors when the forced-colors
media query is in effect. Do some testing with Windows high contrast mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.