JBrowseDesktopRootModel
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. View source.
note: 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
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
jobsManagerjobsManager: types.optional(JobsManager, {}) | JBrowseDesktopRootModel | |
jbrowsejbrowse: jbrowseModelType | jbrowse is a mapping of the config.json into the in-memory state tree | BaseRootModel |
sessionsession: types.maybe(sessionModelType) | session encompasses the currently active state of the app, including views open, tracks open in those views, etc. | BaseRootModel |
sessionPathsessionPath: types.stripDefault(types.string, '') | BaseRootModel | |
| assemblyManager | BaseRootModel | |
| internetAccounts | InternetAccountsMixin | |
| history | used for undo/redo | HistoryManagementMixin |
Volatiles
| Member | Description | Defined by |
|---|---|---|
versionversion: packageJSON.version | JBrowseDesktopRootModel | |
adminModeadminMode: true | JBrowseDesktopRootModel | |
detachDisposersdetachDisposers: [] as (() => 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. | JBrowseDesktopRootModel |
| openNewSessionCallback | JBrowseDesktopRootModel | |
| openLinkCallback | JBrowseDesktopRootModel | |
| returnToStartScreenCallback | JBrowseDesktopRootModel | |
| rpcManager | BaseRootModel | |
errorerror: undefined as unknown | BaseRootModel | |
textSearchManagertextSearchManager: new TextSearchManager(pluginManager) | BaseRootModel | |
pluginManagerpluginManager | BaseRootModel | |
mutableMenuActions: [] as MenuAction[] | RootAppMenuMixin |
Methods
| Member | Description |
|---|---|
() => Menu[] |
Actions
| Member | Description | Defined by |
|---|---|---|
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. | JBrowseDesktopRootModel |
detach() => void | The Loader has let go of this root: stop everything of ours that reaches outside the tree — the worker pool and the autosave autorun — and leave the tree itself alone. Half the teardown. The caller destroys the tree on a later task ( scheduleDetachedDestroy), which is what runs the beforeDestroy hooks in it — a plugin-facing contract, so skipping it is not an option. What this action does is take everything reaching outside the tree off that deferral, so nothing keeps running in between. ADR-069. | JBrowseDesktopRootModel |
setOpenNewSessionCallback(cb: (arg: string) => Promise<void>) => void | JBrowseDesktopRootModel | |
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). | JBrowseDesktopRootModel |
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). | JBrowseDesktopRootModel |
saveSession(val: SessionSnap) => Promise<void> | JBrowseDesktopRootModel | |
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). | JBrowseDesktopRootModel |
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. | JBrowseDesktopRootModel |
setError(error: unknown) => void | BaseRootModel | |
setSession(sessionSnapshot?: any) => void | Sets the active session. Remaps any legacy display type names (e.g. LinearPileupDisplay → LinearAlignmentsDisplay), drops nodes whose pluggable type this build has no plugin for (see pruneUnbuildableNodes), then walks the resulting MST tree to drop open tracks whose config can't hydrate so shared sessions still load when referencing tracks that no longer exist. Both kinds of drop are surfaced to the user via a snackbar. If filtering throws, the previous session is restored. | BaseRootModel |
setDefaultSession() => void | BaseRootModel | |
setSessionPath(path: string) => void | BaseRootModel | |
renameCurrentSession(newName: string) => void | BaseRootModel | |
| initializeInternetAccount | InternetAccountsMixin | |
| createEphemeralInternetAccount | InternetAccountsMixin | |
findAppropriateInternetAccount(location: UriLocation) => any | InternetAccountsMixin | |
(newMenus: MenuDefinition[]) => void | Replace the menu bar wholesale. Item contributions recorded before this one are dropped along with the menus they targeted, so a plugin adding to the existing bar wants appendToMenu instead. | RootAppMenuMixin |
(menuName: string) => void | Add a top-level menu, if the app bar does not already have one with this name. | RootAppMenuMixin |
(menuName: string, position: number) => void | Insert a top-level menu, if the app bar does not already have one with this name. | RootAppMenuMixin |
(menuName: string, menuItem: MenuItem) => void | Add a menu item to a top-level menu, creating the menu if it does not exist. | RootAppMenuMixin |
(menuName: string, menuItem: MenuItem, position: number) => void | Insert a menu item into a top-level menu, creating the menu if it does not exist. | RootAppMenuMixin |
(menuPath: string[], menuItem: MenuItem) => void | Add a menu item to a sub-menu, creating any part of the path that does not exist. | RootAppMenuMixin |
| Insert a menu item into a sub-menu, creating any part of the path that does not exist. | RootAppMenuMixin |