Whim
Whim copied to clipboard
Sector data store
This is a revised version of #859.
Overview
There is an IStore
which contains Whim's state. The IStore
has:
- a
Dispatch
method to perform updates to the state, usingTransform
implementations - a
Pick
method to retrieve data from the state
Mutability
The IStore
can only be updated via Transform
s being Dispatch
ed to it. Within the IStore
, all items are immutable.
Sectors
The IStore
will consist of the following sectors:
-
MonitorSector
-
WindowSector
-
MapSector
-
WorkspaceSector
-
CommandSector
-
RouterSector
-
FilterSector
Managers will remain to facilitate plugins and native calls.
External API
Transform
s and Picker
s will use handles or IDs. Result
s will be used to return errors.
Internal API
Defaults will be preferred over nullables for IDs:
public void BobTransform(WorkspaceId id = default)
{
id = id.OrActiveWorkspace();
}
Transition
During the transition, Whim classes like Workspace
, WorkspaceManager
, Monitor
etc. will deprecate methods as Transform
s and Picker
s become available. These classes will also become immutable over time.
Threading
The IStore
will be protected by a reader-writer lock - see #849
Events
Events will be triggered at the end of each transform. DoLayout
will be triggered at the end of the first transform to be called, before any events are triggered.
Follow-ups
- Set a router to open a window in a workspace and open it in the correct monitor (see discussion 883).
Plan
- [x] Create new minor release
- [x] #890
- [x] #893
- [ ] #895
- [ ] #900
- [ ]
WorkspaceSector
(we need workspace events) - [ ]
CommandSector
- [ ]
RouterSector
- [ ]
FilterSector
- [ ] Threading
- [ ] Remove
DeferWorkspacePosManager
etc. - [ ] Ensure that the
LayoutPreviewPlugin
works
- [ ] Remove
- [ ] Deprecate methods
- [ ] Store docs
- [ ] Docs on
Result
- [ ] Investigate using
struct
where possible - [ ] Remove deprecated methods