JBrowseDesktopRootModel
Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the developer guide for concepts. View source.
Holds JBrowse Desktop's top-level state: the loaded config, the session, internet accounts, undo history, the app menus and the text-indexing jobs.
Many properties of the root model are available through the session, and
we generally prefer using the session model (via e.g. getSession) over the
root model (via e.g. getRoot) in plugin code.
Each section ends with the members a composed model contributes, linked to the page that documents them.
Properties
| Member | Description |
|---|---|
jobsManagerjobsManager: types.optional(JobsManager, {}) |
6 inherited properties from 3 models
From BaseRootModel: jbrowse, session, sessionPath, assemblyManager
Volatiles
| Member | Description |
|---|---|
versionstring | |
adminModeboolean | |
detachDisposers(() => void)[] | What has to stop the moment the Loader lets go of this root — here, the autosave autorun, which writes to disk over IPC. Not addDisposer, which fires only on destroy, and the destroy is now a task later than the swap. An autosave left running in that gap writes the outgoing session to sessionPath, which the replacement has already been loaded from. See detach. |
openNewSessionCallback(_path: string) => Promise<void> | |
openLinkCallback(_link: string) => Promise<void> | |
returnToStartScreenCallback() => void |
5 inherited volatiles from 2 models
From BaseRootModel: rpcManager, error, textSearchManager, pluginManager
From RootAppMenuMixin:
Methods
| Member | Description |
|---|---|
() => Menu[] |
Actions
| Member | Description |
|---|---|
addDetachDisposer(disposer: () => void) => void | Register something that must stop when the Loader detaches this root. See the detachDisposers volatile for why this is not addDisposer. |
detach() => void | Called when the Loader releases this root. Stops everything the root runs outside the tree (the worker pool and the autosave autorun) and leaves the tree itself alone. The caller destroys the tree on a later task ( scheduleDetachedDestroy), which runs the beforeDestroy hooks in it; plugins rely on those hooks, so the destroy cannot be skipped. This action stops the outside work immediately, so none of it runs between detach and destroy. ADR-069. |
setOpenNewSessionCallback(cb: (arg: string) => Promise<void>) => void | |
setOpenLinkCallback(cb: (arg: string) => Promise<void>) => void | Wired by the Loader to open a JBrowse Web link as a new session (the Loader owns plugin-manager lifecycle, as with openNewSessionCallback). |
setReturnToStartScreenCallback(cb: () => void) => void | Wired by the Loader to tear down this plugin manager and show the start screen (the Loader owns plugin-manager lifecycle). |
saveSession(val: SessionSnap) => Promise<void> | |
| updateTrackBase | Replace a track's base config: its sessionTracks entry when the session owns the track, otherwise its jbrowse.tracks entry. |
setPluginsUpdated() => Promise<void> | Persist the session, then rebuild the plugin manager from disk so the changed plugin set takes effect (Loader wires openNewSessionCallback to reload from the session path). |
flushSession() => Promise<void> | Save now rather than waiting out the autosave's 1s debounce, so the last second of edits survives. Every path that tears the session down — quitting, returning to the start screen — has to call this first; Exit did not, and lost whatever was still inside the debounce window. |
14 inherited actions from 3 models
From BaseRootModel: setError, setSession, setDefaultSession, setSessionPath, renameCurrentSession
From InternetAccountsMixin: initializeInternetAccount, createEphemeralInternetAccount, findAppropriateInternetAccount
From RootAppMenuMixin: , , , , ,