ImperialCollegeLondon / ImperialCollegeLondon/Visual2
Tabs module (and update module): rationalise mutable state
- Dominant language
- F#
- Stars
- 49
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
To keep things clean all mutable state should be in one place. The DOM makes mutable state, but using it as is done now to store extra info about files loaded is not good.
I suggest: keep master copy of all the tab state in F# mutable variables. Have a single update function that will render all current state correctly - creating or changing tab content as needed. When changing state alter the F# mutables then call the update function. Redo the code using functional abstraction to compress it. It will be easier to do this than write a lot of separate "change DOM state" code in response to various state changes.
Nearly all state can be handled like this but the buffer _contents_ have to be kept with the master copy in the editor.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Tabs and update modules and reviewing how the DOM currently stores tab and file information. Trace how the editor keeps buffer contents, then assess the proposed single F# state model and update function. Done means mutable tab state is centralized, state changes trigger rendering, and buffer contents remain in the editor’s master copy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100