nand2tetris / web-ide

A web-based IDE for https://nand2tetris.org
https://nand2tetris.github.io/web-ide
Other
38 stars 11 forks source link

[feature]: Save UI settings when switching between modes #356

Closed Arcadonauts closed 3 days ago

Arcadonauts commented 2 weeks ago

Tool

None

Interface

Website (https://nand2tetris.github.io/web-ide)

Contact Details

No response

What feature are you proposing?

When switching between modes (e.g. from the assembler to the CPU Emulator), all settings are lost. I'm worried this is unclear, so here's an example:

When writing assembly code, my work flow was something along the lines of:

Actions marked with **asterisks could be skipped if the Web IDE remembered that I wanted the CPU Emulator to be fast and in asm.

The above is just an example, every tool "forgets" its settings as soon as you switch away. I lost a lot of work in the Bitmap Editor and switching between the Jack Compiler and the CPU Emulator when writing Jack code is a similar process.

Additional Comments

This seems like a minor QoL request, but as I am not an especially good assembly programmer, I probably switched back and forth between these tools hundreds of times while hunting down errors, and having to make those same UI changes every time was very unpleasant.

Do you want to try to add this feature?

Code of Conduct

netalondon commented 1 week ago

@DavidSouther how do you propose we handle state preservation of the bitmap editor? Is there a better way than rewriting the entire page in React?

DavidSouther commented 1 week ago

Looks like it wouldn't be too bad to store grid to localstorage in DisplayGrid, and read it in InitGrid?

DavidSouther commented 1 week ago

"store" would be... well, it could be JSON.stringify the 2d-array of bools! At some point, we could bring it up to date with React and our Screen implementation.