theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Add bookmarks to scripts #751

Closed jdanish closed 1 year ago

jdanish commented 1 year ago

The challenge is that it can be really hard to quickly scroll to the planned set of code that we want kids to look at. So, the idea was that if we could somehow "bookmark" the code and then populate a list above the script editor with the bookmarks, selecting one would make it fast to hop to that section of the code, similar to an html anchor. Something like # BOOKMARK EditWorms or # TAG Bookmark Worms or something like that? Ideally these would be editable in the wizard as well so we could use the wizard to add them.

benloh commented 1 year ago

Cool idea!

I'm guessing we wouldn't want it to unnecessarily detect pieces of code, so we wouldn't want to use TAG.

It should be easy enough to change. But perhaps we'll go with "BOOKMARK" for now.

jdanish commented 1 year ago

BMARK might be a good compromise? But I agree, let's go for BOOKMARK for now. Thanks!

jdanish commented 1 year ago

I can see some cases where we want an "end" to a section. Though maybe that's easier using a comment? I mention it here because the idea we had for museum use of GEM-STEP had included using some way of marking ranges of code to be editable, so would it be worth having a beginning and end now? Or a bmark and range where range is named? Thinking aloud.

Screenshot 2023-07-12 at 1 31 34 PM
benloh commented 1 year ago

@jdanish a few questions about bookmarks implementation:

jdanish commented 1 year ago

This sounds great. Yes to all 3.

On Aug 20, 2023, at 1:04 PM, benloh @.***> wrote:

@jdanish https://github.com/jdanish a few questions about bookmarks implementation:

I think combining custom comment styles with bookmarks could be a straightforward implementation. e.g. rather than creating a new bookmark keyword, we would implement a special bookmark comment. I assume that you'd want to comment on anything that students should be working on/paying attention to anyway. e.g. any '✏️ CHANGE' comment could be marked as a bookmark. You can define multiple comment types as being bookmarkable. I assume that you only want to bookmark the headers (e.g. "WHAT DOES THIS SECTION DO?" and "LETS CHANGE THIS"). Would you bookmark ALL the headers? Or just a few select comments? e.g. we could automatically bookmark any comment that is a header style (not body). I assume you would want the bookmarks to be always visible (e.g. if you scroll down the wizard view, the list of bookmarks is always immediately selectable, rather than forcing you to scroll to the top of the wizard view to see the bookmark list). — Reply to this email directly, view it on GitHub https://github.com/theRAPTLab/gsgo/issues/751#issuecomment-1685334757, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKGCKRT4CG5GB5FFWAVRY3XWI7TNANCNFSM6AAAAAAZSZOFQI. You are receiving this because you were mentioned.

benloh commented 1 year ago

@jdanish Come quick followups...there can be a LOT of bookmarks. Given the context of the UI, I think it makes the most sense to put the list at the top left of the full height wizard code view (as opposed to putting it in the right panel's line edit view). But you can easily end up with many bookmarks -- e.g. see the Beavers script, which has 7.

We could use a popup menu, but that makes it much more difficult to quickly view and select a bookmark.

This is obviously rough, but it gives you an idea of the spatial constraints: screenshot_1297

Do you have a sense of how many bookmarks you'd like to use/view? Do we just need to live with the popup menu? I can also introduce a vertical dragger to resize the bookmark panel, but then you run into the problem of bookmarks being hidden below the fold. I suppose we could also introduce a / button: so we show one bookmark at a time, and you click to move to the next one?

The whole ScriptEditor view probably needs a layout redo, but we can revisit that once we figure out the basic functionality.

jdanish commented 1 year ago

Could we do a drop-down like the script menu?

jdanish commented 1 year ago

I think we can / will do fewer than 7 but am not 100% sure as we need to test thus…. So if we can do a drop-down that’s likely idea. 

benloh commented 1 year ago

Implemented with #763.