Open amyjko opened 1 year ago
Hey @amyjko , would love some feedback on our design proposal when you get the chance!
Thanks for the good start @katieshi413! A few comments:
The current editing paradigm is that the cursor is either a single position in the source file or a single node in the program. Are you proposing to add an additional possible mode for the cursor? What would the specifications be for that mode? An arbitrary two positions in a source file? Only positions within the boundaries of a token? Given the examples in the problem description, it's not clear if you're proposing a conventional text editor's behavior, or something new, such as only allowing selections within a token boundary. It's okay to propose something new, I'm just not clear on what's being proposed.
When someone drags text, are you proposing that the text is removed from its location? That would necessarily introduce defects into a program, making conflicts appear in the margin. (That wouldn't happen for a copy, since copy doesn't edit). Is that an experience we want creators to have? (It's the same experience as in a text-based code editor, but those experiences can be very confusing for learners).
@katieshi413 Oh, and one more question: what would the selections look like? In a standard text editor, a simple highlight rectangle would suffice, but this is not a standard editor. We have node selections (e.g, press escape many times on some code to see them). And so introducing a second kind of selection into the design requires a choice about whether to use the same visual highlighting --- which could cause confusion, since it's a different type of selection --- or to use a different kind of highlighting --- which could cause confusion, because now there are two distinct kinds of highlighting to learn.
It's the end of Winter! Please provide an update on this issue, including:
If you do plan to continue work on it, carry on. Otherwise, thank you for your contributions!
No reply :( Unassigning @katieshi413 @emilychoi1.
What's the problem?
There are a variety of cases where it's helpful to edit a subpart of a text literal or name, and using text editor selection conventions would be helpful. For example, suppose someone wants to delete the extra
hello
in the text literal:'hello hello world
. They'd have to backspace over the letters individually rather than selectinghello
and pressing backspace. Instead, users only have the option to drag and drop (🐲) singular nodes of text. Users are not able to move to move multiple nodes at once which makes it inefficient when editing.What's the design idea?
We could define the
Caret
type to allow a range, and then apply restrictions on ranges to only allow selections up to text literal boundaries. That would prevent syntax errors, but also create a limitation that could be annoying.Our inspiration for the behavior of this feature comes from Visual Studio Code. We want the skills learned from wordplay to be applicable in professional/industry settings and vice versa. We want users to be able to highlight their desired amount of text literals and drag and drop that, instead of singular pre-defined nodes. Users should also have the option to delete the desired amount of text with this feature.
Who benefits?
Anyone wanting to do more efficient text editing. We want to make this universal as possible to lower the learning curve. Since users are familiar with highlighting on other websites, we want to implement something similar.
Design Specification
When the user clicks and highlights their desired length of text, the highlighted text will be shown in a different color to indicate that it has been selected. The user should then be able to copy, paste, and drag this selected text to another area or line in the stage. The nodes should not interfere with the ability to select text.
OnDrag, the dragon emoji will appear. Otherwise, it will not.