source-academy / frontend

Frontend of Source Academy, an online experiential environment for computational thinking (React, Redux, Saga, Blueprint)
https://sourceacademy.org
Apache License 2.0
101 stars 164 forks source link

Editor: default program should be language-specific #2947

Open martin-henz opened 2 months ago

martin-henz commented 2 months ago

The last Python program used in the editor should come back when switching to Python:

Screenshot 2024-04-18 at 10 01 34 AM

The browser cache needs to keep track of the programs for each language that can be chosen at the top right.

RichDom2185 commented 2 months ago

The browser cache needs to keep track of the programs for each language

I think this is a different issue altogether. I agree with both. Default program should be stored under language configuration. Separately, the browser should store multiple "programs" at the same time (maybe we can leverage the filesystem for this).

Should we keep track on a per-language basis or per-sublanguage basis?

martin-henz commented 2 months ago

I think it should be done on a per-language basis: Quite often we switch between sublanguages to get this or that language feature or tool to work. The program should not change in that case.

RichDom2185 commented 2 months ago

Ok, I'll work on a proposed design over the next few weeks.