JBrowseWebRootModel
Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the developer guide for concepts. View source.
Holds JBrowse Web's top-level state: the loaded config, the session, internet accounts, undo history, the app menus and the saved sessions kept in the browser.
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 |
|---|---|
configPathconfigPath: types.maybe(types.string) |
6 inherited properties from 3 models
From HistoryManagementMixin: history
From InternetAccountsMixin: internetAccounts
From BaseRootModel: jbrowse, session, sessionPath, assemblyManager
Volatiles
| Member | Description |
|---|---|
adminModeboolean | |
sessionDBSessionDBHandle | undefined | |
versionstring | |
gitCommitstring | |
pluginsUpdatedboolean | |
savedSessionMetadataSessionMetadata[] | undefined | |
| reloadPluginManagerCallback |
6 inherited volatiles from 2 models
From RootAppMenuMixin:
From BaseRootModel: rpcManager, error, textSearchManager, pluginManager, detachDisposers
Methods
| Member | Description |
|---|---|
() => Menu[] |
Actions
| Member | Description |
|---|---|
setSavedSessionMetadata(sessions: SessionMetadata[]) => void | |
fetchSessionMetadata() => Promise<void> | Re-reads the whole metadata store. For anything that changes rows this model didn't just write itself (first load, pruning, favorite, rename, delete) — the autosave path uses upsertSessionMetadata instead. |
upsertSessionMetadata(meta: SessionMetadata) => void | Merges a row this model has just written into the in-memory list. The autosave autorun writes exactly one row on every throttled session edit — every 400ms for as long as you keep panning — and already holds its contents, so re-reading every session's metadata to learn what it just stored is the expensive way to move one row to the top. |
setSessionDB(sessionDB: SessionDBHandle | undefined) => void | |
setPluginsUpdated() => void | |
| setReloadPluginManagerCallback | |
activateSession(id: string) => Promise<void> | |
openSessionCopy(snap: Record<string, unknown>) => Promise<void> | Opens a session snapshot under a fresh id, so it autosaves beside the session it came from rather than over it. |
setSavedSessionFavorite(id: string, favorite: boolean) => Promise<void> | |
deleteSavedSession(id: string) => Promise<void> | |
deleteSavedSessions(ids: string[]) => Promise<number> | Deletes a batch of saved sessions in ONE transaction, and re-reads the metadata once at the end. Looping deleteSavedSession instead is both N transactions and N full getAll('metadata') scans, and — because those interleave — leaves savedSessionMetadata holding whichever scan happened to resolve last, so already-deleted rows stay on screen until something else refreshes the list.The open session is skipped rather than reported on, since a bulk delete is not aimed at any one row (see deleteSavedSession). Resolves to the number deleted: 0 when the transaction failed, which has already been reported. |
renameSavedSession(id: string, name: string) => Promise<void> |
16 inherited actions from 3 models
From RootAppMenuMixin: , , , , ,
From InternetAccountsMixin: initializeInternetAccount, createEphemeralInternetAccount, findAppropriateInternetAccount
From BaseRootModel: setError, addDetachDisposer, detach, setSession, setDefaultSession, setSessionPath, renameCurrentSession