BaseWebSessionModel
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
Composable web session shared by jbrowse-web and react-app, before
finalizeWebSession (the snapshotProcessor can't be composed). jbrowse-web
composes WebSessionManagementMixin onto this; react-app uses it as-is.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
| sessionPlugins | BaseWebSessionModel | |
| views | MultipleViewsSessionMixin | |
| stickyViewHeaders | MultipleViewsSessionMixin | |
| useWorkspaces | enables the tabbed/tiled workspace layout for this session. Undefined means unspecified — read effectiveUseWorkspaces. | MultipleViewsSessionMixin |
idid: ElementId | BaseSessionModel | |
namename: types.string | BaseSessionModel | |
focusedViewIdfocusedViewId: types.maybe(types.string) | used to keep track of which view is in focus | BaseSessionModel |
highlightsVisiblehighlightsVisible: types.stripDefault(types.boolean, true) | one session-wide toggle for all region highlight bands (URL/view highlights and bookmark overlays) | BaseSessionModel |
| drawerPosition | DrawerWidgetSessionMixin | |
| drawerWidth | DrawerWidgetSessionMixin | |
widgetswidgets: types.stripDefault(types.map(widgetStateModelType), {}) | DrawerWidgetSessionMixin | |
| activeWidgets | DrawerWidgetSessionMixin | |
minimizedminimized: types.stripDefault(types.boolean, false) | DrawerWidgetSessionMixin | |
| sessionTracks | User-added session tracks (no matching admin config track). A non-admin's edits to an existing config track are stored as deltas (trackConfigDeltas), not here. | SessionTracksManagerSessionMixin |
| trackConfigDeltas | Per-track config overrides for a non-admin, keyed by trackId, stored as a delta against the admin-owned base config (jbrowse.tracks entry) rather than a full copy — so a later admin change to an untouched field still flows through (see trackConfigDelta.ts). Frozen (not a typed track array) on purpose: a typed create() would fill defaults, erasing the "unset vs default" distinction the delta merge relies on.stripDefault for the reason every other persisted prop beside it has it: without it the empty map is written into every snapshot and every share link, so a session that never overrode a track still ships "trackConfigDeltas":{}. It was the one prop added since that convention without it. | SessionTracksManagerSessionMixin |
| sessionAssemblies | AssembliesMixin | |
| temporaryAssemblies | AssembliesMixin | |
| sessionConnections | WebSessionConnectionsMixin | |
| connectionInstances | ConnectionManagementSessionMixin | |
| connectionTrackConfigs | Persisted configs of connection tracks the user has opened, keyed by trackId. Unlike connectionInstances (stripped from snapshots, holds the whole fetched hub), this holds only the tracks in use, so an open connection track resolves synchronously on session load without re-establishing the connection. | ConnectionManagementSessionMixin |
viewIdsviewIds: types.array(types.string) | WorkspaceLayoutMixin | |
titletitle: types.maybe(types.string) | set only by an explicit rename; otherwise the name is derived from views | WorkspaceLayoutMixin |
sizesize: types.optional(types.number, 1) | WorkspaceLayoutMixin | |
tabstabs: types.array(LayoutTab) | WorkspaceLayoutMixin | |
activeTabIdactiveTabId: types.maybe(types.string) | WorkspaceLayoutMixin | |
sizesize: types.optional(types.number, 1) | WorkspaceLayoutMixin | |
| direction | WorkspaceLayoutMixin | |
| children | WorkspaceLayoutMixin | |
layoutlayout: types.optional(LayoutNode, emptyPanel) | WorkspaceLayoutMixin | |
activePanelIdactivePanelId: types.maybe(types.string) | WorkspaceLayoutMixin | |
maximizedPanelIdmaximizedPanelId: types.maybe(types.string) | Show only this cell, at the size of the whole workspace. Deliberately HERE and not a maximized flag on PanelNode. On the node it would be inside tree.ts, the half that carries the risk and is proven by a randomised operation sequence asserting canonical form after every step — and every operation would then have to say what it does to the flag: a split of a maximized panel, a drag of its last tab out, a normalize that collapses it into its parent. Beside activePanelId it is the same class of thing as activePanelId, including its failure mode, which livePanelIds already repairs. | WorkspaceLayoutMixin |
Volatiles
| Member | Description | Defined by |
|---|---|---|
pendingFileHandleIdspendingFileHandleIds: [] as string[] | BaseWebSessionModel | |
sessionThemeNamesessionThemeName: localStorageGetItem('themeName') ?? 'default' | ThemeManagerSessionMixin | |
selectionselection: undefined as unknown | this is the globally "selected" object. can be anything. code that wants to deal with this should examine it to see what kind of thing it is. | BaseSessionModel |
hoveredhovered: undefined as unknown | this is the globally "hovered" object. can be anything. code that wants to deal with this should examine it to see what kind of thing it is. | BaseSessionModel |
| queueOfDialogs | BaseSessionModel | |
| preferencesOverrides | runtime user-preference overrides keyed by preference id, resolved by getPreference against the configuration.preferences admin defaults. Empty here (config-only); products that let users edit preferences load and persist these via localStorage. A runtime override map layered over config defaults, kept off the snapshot since prefs are local UI.An observable.map (not a plain object reassigned wholesale) so each preference is its own tracked key: writing one (setScrollZoom) can't invalidate a reader of another (getDisplayTypeDefault in a track's rpcProps). A single spread-replaced object made every setter wake every reader, so toggling scroll-to-zoom re-fetched every track. For the same reason each promoted per-display-type default is a flat composite key (see displayTypeDefaultKey), not a single nested displayTypeDefaults object — promoting one default can't wake readers of a different one.deep: false is load-bearing, not a micro-optimization. The default enhancer wraps an object/array value in a MobX Proxy on set, and a promoted default is handed straight back out by getConf — so an object-valued promotable slot (alignments colorBy) put a Proxy into rpcProps(), and V8's structured-clone serializer rejects a Proxy: worker.postMessage threw DataCloneError on the next fetch of any track following that default (electron IPC and structuredClone in the share bake likewise). The map still notifies per key on set, so shallow values lose no reactivity — and nothing can mutate a preference in place, because setPreferenceOverride freezes what it stores. | BaseSessionModel |
snackbarMessagessnackbarMessages: observable.array<SnackbarMessage>() | SnackbarModel | |
errorDialogerrorDialog: undefined as ErrorDialogState | undefined | the error currently shown in the stack-trace dialog. Kept off the dialog queue so it can stack on top of an already-open dialog (e.g. the one whose action raised the error) instead of waiting behind it | SnackbarModel |
poppedOutpoppedOut: false | true while the visible widget is shown in a modal dialog instead of the drawer. Volatile because a restored session that opened straight into a modal, with no drawer behind it, is disorienting | DrawerWidgetSessionMixin |
editableTrackConfigseditableTrackConfigs: new Map<string, EditableTrackConfig>() | Per-track private working copies (non-admin), keyed by trackId. A plain Map — not observable, not persisted — mirroring the pluginManager hydration cache: it holds the live MST config node a shown track's in-place quick-edits mutate, so the shared frozen base is never touched. See ADR-032. Not evicted: it's a pure memoization cache, bounded by the count of distinct tracks shown this session (each entry a lazily-hydrated config node), holding no authoritative state — the persisted delta is the source of truth, and reset/programmatic edits keep a retained copy in sync. Retention is volatile RAM only (never serialized), so it's not worth a reference-counted prune at every track-removal path. Each entry carries the delta it mirrors, so a delta replaced from outside this mixin invalidates it — see getEditableTrackConfig. | SessionTracksManagerSessionMixin |
Getters
| Member | Description | Defined by |
|---|---|---|
rootAbstractWebRootModel | BaseWebSessionModel | |
| connections | list of config connections and session connections | BaseWebSessionModel |
any | BaseWebSessionModel | |
textSearchManagerTextSearchManager | BaseWebSessionModel | |
themeNamestring | ThemeManagerSessionMixin | |
themeOptionsSerializableThemeArgs | ThemeManagerSessionMixin | |
paletteJBrowsePalette | Every color JBrowse renders, resolved to plain strings. This is what rendering reads: it needs no React context, it crosses the RPC worker boundary as itself, and it costs no UI toolkit. Prefer it over theme anywhere the answer wanted is a color rather than a Material UI component style. | ThemeManagerSessionMixin |
styleThemeJBrowseStyleTheme | The palette plus the sizing tokens makeStyles reads — spacing, corner radius, type scale. This is what a product mounts on StyleThemeProvider; it costs no UI toolkit, and it is derived from the same themeOptions as theme, so a config theme that sets spacing moves JBrowse's own styles and its Material components together. | ThemeManagerSessionMixin |
themeTheme | The Material UI theme, for the components that are Material UI. Its palette is spliced from the same resolvePalette call as palette above, so the two cannot disagree. | ThemeManagerSessionMixin |
effectiveUseWorkspacesboolean | resolved workspaces flag (never undefined): this session's value, else the user preference over the configuration.preferences.useWorkspaces admin default. Every consumer reads this, not the raw property — only sessions built from a snapshot or a spec layout set that, so the admin default is what reaches the arrivals that bypass defaultSession. | MultipleViewsSessionMixin |
defaultUseWorkspacesboolean | what effectiveUseWorkspaces becomes after resetUseWorkspaces — the admin default, with both this session's own value and the user's override out of the way. The Preferences reset diff needs this rather than the override map, which can't see a session-scoped value (a spec layout, a "move view to a tab") and so reported nothing to reset. | MultipleViewsSessionMixin |
jbrowseany | BaseSessionModel | |
rpcManagerRpcManager | BaseSessionModel | |
configurationInstance<JB_CONFIG_SCHEMA> | BaseSessionModel | |
adminModeboolean | BaseSessionModel | |
| assemblies | BaseSessionModel | |
DialogComponentDialogComponentType | BaseSessionModel | |
DialogPropsRecord<string, unknown> | BaseSessionModel | |
animationModeAnimationMode | resolved feature-layout animation mode (never undefined) | BaseSessionModel |
scrollZoomboolean | resolved scroll-to-zoom preference. Global and personal (never shared in a session snapshot); every wheel-zoom view reads this single value. | BaseSessionModel |
numberGroupingboolean | resolved thousand-separator preference. Read for display in the Preferences dialog; the formatter itself reads a plain module variable set at startup in each realm (see setNumberGrouping), because worker- built strings can't see a main-thread observable. | BaseSessionModel |
snackbarMessageSetMap<string, SnackbarMessage> | SnackbarModel | |
visibleWidgetWidget | undefined | DrawerWidgetSessionMixin | |
| tracks | User-added session tracks first, then each admin config track with its delta (trackConfigDeltas) merged over it. A base track without a delta is returned unchanged by identity to keep the hydration cache warm. | SessionTracksManagerSessionMixin |
assemblyNamesstring[] | names of the assemblies returned by the assemblies getter | AssembliesMixin |
versionstring | AppSessionMixin | |
gitCommitstring | undefined | AppSessionMixin | |
| history | AppSessionMixin | |
| assemblyManager | AppSessionMixin | |
treeLayoutTree | The plain tree the pure functions take.getSnapshot is a keepAlive computed, so this is cached and referentially stable — which also lets MST's reconcile short-circuit on identity when apply writes an untouched subtree back.Uncast on purpose: the models below and the interfaces in tree.ts are two spellings of one shape, and this assignment is the only thing that checks they agree. | WorkspaceLayoutMixin |
panelsPanelNode[] | WorkspaceLayoutMixin | |
tabsTabNode[] | WorkspaceLayoutMixin | |
visibleTreeLayoutTree | What to render: the maximized cell alone, or the whole tree. Sized to 1 rather than handed over as it sits. A pane's size is its share of its siblings, and CSS distributes free space by grow factor only up to a total of 1 — so a cell that was a third of a row, alone in the workspace with flexGrow: 0.33, draws a third of the window and leaves the rest blank. | WorkspaceLayoutMixin |
Methods
| Member | Description | Defined by |
|---|---|---|
canEditTrack(trackId: string) => boolean | whether the user may edit this track's config (admins may edit any; everyone else only their own session tracks) | BaseWebSessionModel |
isTrackOverride(trackId: string) => boolean | whether trackId has a non-admin config override (a delta stored in trackConfigDeltas against an admin-owned config track, see updateTrackConfiguration), rather than a standalone user-added session track. Drives the "Reset track settings" menu swap and the edited badge. | BaseWebSessionModel |
| getTrackActions | raw track actions (Settings, Copy, Delete) without submenu wrapper | BaseWebSessionModel |
getReferringMultiple(trackIds: string[]) => Map<string, ReferringNode[]> | Walk the tree once and map each requested trackId to the nodes holding a types.reference that resolves to it (a view's track entry, a config editor widget). Track configs are matched by trackId, not identity, so a frozen base and its hydrated MST node compare equal. | ReferenceManagementSessionMixin |
getReferring(trackId: string) => ReferringNode[] | The nodes currently referring to trackId (see getReferringMultiple). | ReferenceManagementSessionMixin |
allThemes() => ThemeMap | ThemeManagerSessionMixin | |
| getActiveThemeOptions | Raw ThemeOptions for the active theme, or a named override (used by the SVG-export theme picker). Unlike theme (a built, non-serializable MUI theme), this is the plain options object every view's SVG export threads into each display's renderSvg, which rebuilds the theme via createJBrowseTheme outside React context.The default entry is spliced with the config theme slot, because the preset is only half of what that entry means — the picker calls it "Default (from config)" and resolvePalette merges the two for every other consumer. Returning the bare preset made view.exportSvg() silently drop a host's configured palette: a config setting primary.main drew #123456 on screen and exported the stock #0D233F, with the export dialog reporting the theme it had not used. Every other named theme is a fixed preset that ignores config, which is the distinction this ternary keeps. | ThemeManagerSessionMixin |
getPreferenceDefault(key: string) => unknown | the admin/embedder configuration.preferences value for a key, ignoring any runtime override — i.e. what a reset falls back to. Exposed rather than inlined because "differs from the default" is a question the Preferences reset diff asks about settings this map doesn't hold (see defaultUseWorkspaces). | BaseSessionModel |
getPreference(key: string) => unknown | resolved value of a user preference: a runtime override if the user set one, otherwise the admin/embedder configuration.preferences default. The override map is empty unless the product loads it (web/desktop). | BaseSessionModel |
getDisplayTypeDefault(displayType: string, slot: string) => unknown | resolved value of a per-display-type slot default the user promoted (see setDisplayTypeDefault); undefined when nothing was promoted. | BaseSessionModel |
getDisplayTypeDefaults() => { displayType: string; slot: string; value: unknown; }[] | every per-display-type default the user has promoted, as { displayType, slot, value } — the inventory the Preferences dialog lists and clears one at a time (setDisplayTypeDefault(…, undefined)).Here rather than filtered out of getPreferenceChanges by the dialog, because the composite-key layout is this file's: a consumer that recognized these rows by matching the path head is exactly the coupling DISPLAY_TYPE_DEFAULTS_PATH_HEAD stopped being exported over, where a rename on one side alone silently no-ops the other. | BaseSessionModel |
getPreferenceChanges() => TrackConfigChange[] | every runtime preference-override that currently differs from its config/admin default, as { path, from, to } rows — the exact set clearPreferenceOverrides reverts. Backs the confirmation diff shown before "Reset to defaults" (mirrors the per-track changes dialog). A scalar pref (animationMode, scrollZoom) whose override equals the default is omitted (reverting it is a no-op); each promoted per-display-type default is always a difference from the un-promoted state, so from reads "(default)". | BaseSessionModel |
getTrackConfigChanges(trackId: string) => TrackConfigChange[] | The overridden slots for trackId (empty when it has no delta): each changed setting's path, its base/default value and the edited value. Drives the "view changes" dialog opened from the edited badge. | SessionTracksManagerSessionMixin |
| getEditableTrackConfig | A non-admin's private working copy of a track config, created on first access from the current frozen (base+delta) value and cached by trackId, so a shown track's in-place quick-edits (setSlot) mutate this copy and never the shared frozen base node (see ADR-032). Undefined in admin mode — there the base jbrowse.tracks entry is edited in place. Called by TrackConfigurationReference during lazy hydration. Cached against the delta it was built from, not by trackId alone. A delta this mixin wrote re-stamps the entry, so the copy an edit is still being typed into is never swapped out mid-keystroke; a delta replaced from outside — an undo's applySnapshot on the session, a session restore — cannot, so the next read rebuilds the copy from the delta that now exists. Reading trackConfigDeltas here is also what makes an undo re-resolve the reference at all: the resolver's caller is already subscribed to it through getTrackById. | SessionTracksManagerSessionMixin |
| getTrackById | Config for one trackId — a track, assembly sequence, or connection track — or undefined. Per-id reactive: every display resolves its config through this (via TrackConfigurationReference) and subscribes only to its own id, so one track's settings edit doesn't re-render the others. | TracksManagerSessionMixin |
| getTracksById | Every track config the session can resolve, keyed by trackId. Prefer the per-id reactive getTrackById(id): reading this whole map subscribes the caller to every track, so an edit to any one of them wakes it — the reason internal display config resolution moved off it. Kept for plugins that look up ids in a non-reactive context. | TracksManagerSessionMixin |
| findAssemblyConf | The assembly config already carrying name, from any of the three arrays the assemblyManager draws on, or undefined.One namespace, because name is the assembly config's MST identifier: a second config carrying a name one of the others already has doesn't fail at the add, it makes every assembly.configuration safeReference in the manager ambiguous, and MST then throws on every read of one — inside the manager's own autorun and inside assemblyNameMap, which takes the session down. So each add path checks all three, not just the array it pushes to. | AssembliesMixin |
() => Menu[] | AppSessionMixin | |
hasPanel(panelId: string) => boolean | WorkspaceLayoutMixin | |
findTab(tabId: string) => TabHome | undefined | WorkspaceLayoutMixin | |
tabContainingView(viewId: string) => TabHome | undefined | WorkspaceLayoutMixin | |
panelContainingView(viewId: string) => PanelNode | undefined | WorkspaceLayoutMixin | |
viewIdsForTab(tabId: string, order: string[]) => string[] | The views a tab renders: its members, in session.views order. | WorkspaceLayoutMixin |
activeTabOf(panelId: string) => TabNode | undefined | The tab a panel is showing, or its first. | WorkspaceLayoutMixin |
| flattened menu items for use in hierarchical track selector | TrackMenuItemsSessionMixin | |
| track menu with About + "Track actions" submenu for the in-view label | TrackMenuItemsSessionMixin |
Actions
| Member | Description | Defined by |
|---|---|---|
addAssemblyConf(conf: AnyConfiguration) => void | BaseWebSessionModel | |
addSessionPlugin(plugin: PluginDefinition & { name: string; }) => void | BaseWebSessionModel | |
removeSessionPlugin(pluginDefinition: PluginDefinition) => void | BaseWebSessionModel | |
setDefaultSession() => void | BaseWebSessionModel | |
setSession(sessionSnapshot: Record<string, unknown>) => void | BaseWebSessionModel | |
| editTrackConfiguration | opens the config editor for a track. Available for any track: a non-admin's edits to an admin-owned track persist as a delta (trackConfigDeltas) that rides along in the shared/saved session, rather than mutating the admin-owned config itself. | BaseWebSessionModel |
setPendingFileHandleIds(ids: string[]) => void | BaseWebSessionModel | |
dereferenceTrack(trackId: string, referring: ReferringNode[]) => void | Remove trackId from every view referring to it and close any config editor widget open on it. Runs immediately: the walk that produced referring has finished, so mutating those views here is safe. | ReferenceManagementSessionMixin |
setThemeName(name: string) => void | ThemeManagerSessionMixin | |
setThemeMode(mode: "dark" | "light") => void | Point the session at light or dark, for a host that follows its own dark-mode state rather than offering JBrowse's theme menu. Satisfies ThemeModeSession, so useSessionPalette works against an app session and an embedded one alike.Expressed as a write to the config theme slot plus a return to the default theme, not as setThemeName('darkStock'). Only the default theme merges configTheme.palette (see resolvePalette), so selecting a stock theme would discard whatever the host passed as configuration.theme — their brand primary, say — the first time their toggle fired. Merging at both levels for the same reason: theme is a frozen slot, and mode and primary are siblings under palette.One write, not two: themeOptions is derived from the same slot and is what ships to the RPC worker, so the labels baked into a rendered image follow the mode along with what React draws. | ThemeManagerSessionMixin |
moveViewDown(id: string, scopeIds?: string[] | undefined) => void | MultipleViewsSessionMixin | |
moveViewUp(id: string, scopeIds?: string[] | undefined) => void | MultipleViewsSessionMixin | |
moveViewToTop(id: string, scopeIds?: string[] | undefined) => void | MultipleViewsSessionMixin | |
moveViewToBottom(id: string, scopeIds?: string[] | undefined) => void | MultipleViewsSessionMixin | |
orderViews(ids: string[]) => void | Put the named views into the given relative order, leaving views not named in their own slots.session.views is the one ordering, so this is how a channel that states an order in some other vocabulary gets it applied: a session spec's layout names views per panel, top to bottom, and that used to be honoured by the panel assignment array's order. Now the assignment carries membership only, so the layout says it here instead, once. | MultipleViewsSessionMixin |
addView(typeName: string, initialState?: any) => any | MultipleViewsSessionMixin | |
| replaceView | swap view for a new view of typeName, in the slot it occupied.The launchers that build a view of a DIFFERENT type out of one you are already looking at — launch synteny view, read-vs-ref, split view — otherwise append, leaving the source view above the thing it produced and a stack of two views showing the same locus. This is the "replace" half of that offer, and a slot swap rather than remove-then-add so the new view lands where the reader was looking instead of at the bottom of the session. A launcher whose result is the SAME type as its source does not come here and should not: collapse introns offers "Replace current view" by navigating the view it was invoked on, which keeps the view's identity and so lets its snackbar offer an Undo. Swapping in a new node would leave nothing to undo onto. The slot is session.views, which is the order views render in under both layout modes (a tab's viewIds says which tab a view is in, not where in it), so the swap lands in place either way.WHICH panel is a separate question and this does not answer it: the new view arrives in no tab, and homeUnassignedViews puts it in the active panel — the same panel only when the replaced view was in the active one. In practice it is, since clicking into a view activates its panel, and the launch that offers a replace is a click on that view's own menu. | MultipleViewsSessionMixin |
removeView(view: IBaseViewModel) => void | MultipleViewsSessionMixin | |
takeOutViewsMissingFrom(snapshot: unknown) => void | Take out every view the given session snapshot will not keep, before a whole-tree applySnapshot destroys it where it stands.Undo and redo are applySnapshot on the session (core/util/TimeTraveller, which calls this), and every view carries an ElementId — so MST reconciles by identifier and destroys what the target lacks, inside the action, with the components still mounted. Measured on a redo across a closed view, with the restored view repainted first: 4 liveliness reads of its display before this, 0 after.A view that is present but has changed type is destroyed by that same reconciliation (areSame runs the type's is() before its id check), so identity here is the pair, not the id.Views, and deliberately not what is under them. A track or a display the snapshot drops is still destroyed in place, and that is not this door being worse than the others: hideTrackGeneric is a plain tracks.remove and measures louder (5 reads to undo's 4). Detaching one would be worse than the destroy it replaced — a detached display is a LIVE root, and getContainingView walks parents and throws when the walk finds no view, where a dead node only warns. At or above the view is the only place that walk still lands, which is why ADR-069's rule stops there. | MultipleViewsSessionMixin |
setStickyViewHeaders(sticky: boolean) => void | MultipleViewsSessionMixin | |
setUseWorkspaces(useWorkspaces: boolean) => void | set the workspaces layout for this session only, leaving the user's personal default untouched. For session-scoped intent — a spec carrying a layout, or an ad-hoc "move view to a tab/split" — where rewriting the visitor's global preference would be a surprise. The user-facing default toggle is setUseWorkspacesPreference. | MultipleViewsSessionMixin |
setUseWorkspacesPreference(useWorkspaces: boolean) => void | the user-facing workspaces toggle: applies to this session and becomes their default for sessions that don't specify one. Persisted only here, on an explicit toggle — an autorun mirroring the resolved value would bake the admin default into every visitor's localStorage on first load, so a later admin change could never reach them. | MultipleViewsSessionMixin |
resetUseWorkspaces() => void | drop both this session's explicit value and the user's override so workspaces falls back to the admin default | MultipleViewsSessionMixin |
setSelection(thing: unknown) => void | set the global selection, i.e. the globally-selected object. can be a feature, a view, just about anything A feature is unwrapped on the way in, so app state never holds a jexlFeatureProxy. isFeature accepts a proxy, but on one id is a data field rather than the method the Feature type promises — every consumer doing isFeature(selection) ? selection.id() : … would throw. | BaseSessionModel |
clearSelection() => void | clears the global selection | BaseSessionModel |
setHovered(thing: unknown) => void | BaseSessionModel | |
setHighlightsVisible(arg: boolean) => void | toggle all region highlight bands across every view | BaseSessionModel |
revealHighlights() => void | turn highlight bands back on, so a newly made highlight or bookmark is never silently swallowed by an earlier "highlights off" | BaseSessionModel |
setPreferenceOverride(key: string, value: unknown) => void | set a runtime user-preference override (see getPreference). Mutates volatile state; products persist these to localStorage. An undefined value deletes the key (rather than leaving a phantom entry that getPreference reads as absent) so the store never holds dead keys. | BaseSessionModel |
clearPreferenceOverrides() => void | clear every runtime preference override at once — scrollZoom, animationMode, and every promoted per-display-type default (see setDisplayTypeDefault) — so each falls back to its config/admin default. Backs the Preferences dialog "Reset to defaults" button. | BaseSessionModel |
clearPreferenceOverride(key: string) => void | clear a single runtime preference override (see getPreference) so it falls back to its config/admin default. Backs the per-entry reset in the Preferences dialog "Reset to defaults" confirmation. | BaseSessionModel |
resetPreferenceChange(path: string[]) => void | revert one row emitted by getPreferenceChanges, addressed by its display path. Backs the per-entry reset in the Preferences dialog's "Reset to defaults" confirmation.Lives here rather than in that dialog because this model owns both path shapes it has to undo: a promoted per-display-type default, whose row path is a readable label over a flat composite storage key, and every other override, whose path is its key. The dialog used to re-derive the first case from an exported path-head constant. | BaseSessionModel |
setScrollZoom(flag: boolean) => void | set the global scroll-to-zoom preference (see the scrollZoom getter) | BaseSessionModel |
setDisplayTypeDefault(displayType: string, slot: string, value: unknown) => void | promote (or, with value undefined, clear) a per-display-type slot default. Just a preference override under one flat composite key (see displayTypeDefaultKey), so it persists and independently tracks like any other pref, and clearing deletes only that key. | BaseSessionModel |
setName(str: string) => void | BaseSessionModel | |
setFocusedViewId(viewId: string | undefined) => void | undefined is "no view is focused", which the property has always been able to hold (types.maybe) and this had no way to spell. Nothing cleared it on teardown as a result: a view that was focused when it left the session left its id behind, and since every consumer compares focusedViewId === view.id, the id matched nothing, the focus ring vanished with nothing to say why, and the dead id persisted into a saved or shared session. takeOut clears it now. | BaseSessionModel |
removeActiveDialog() => void | BaseSessionModel | |
queueDialog(doneCallback: DoneCallback) => void | BaseSessionModel | |
| notify | SnackbarModel | |
| notifyError | SnackbarModel | |
setErrorDialog(state: ErrorDialogState | undefined) => void | SnackbarModel | |
| pushSnackbarMessage | SnackbarModel | |
popSnackbarMessage() => SnackbarMessage | undefined | SnackbarModel | |
removeSnackbarMessage(message: string) => void | SnackbarModel | |
setDrawerPosition(arg: string) => void | DrawerWidgetSessionMixin | |
updateDrawerWidth(drawerWidth: number) => number | DrawerWidgetSessionMixin | |
resizeDrawer(distance: number) => number | DrawerWidgetSessionMixin | |
| addWidget | DrawerWidgetSessionMixin | |
showWidget(widget: any) => void | DrawerWidgetSessionMixin | |
hideWidget(widget: any) => void | DrawerWidgetSessionMixin | |
minimizeWidgetDrawer() => void | DrawerWidgetSessionMixin | |
showWidgetDrawer() => void | DrawerWidgetSessionMixin | |
popoutWidget() => void | show the visible widget in a modal dialog, freeing the drawer column | DrawerWidgetSessionMixin |
returnWidgetToDrawer() => void | DrawerWidgetSessionMixin | |
hideAllWidgets() => void | DrawerWidgetSessionMixin | |
| editConfiguration | opens a configuration editor to configure the given thing, and sets the current task to be configuring it | DrawerWidgetSessionMixin |
addSessionTrackConf(trackConf: AnyConfiguration) => any | Add a track config to this session: it lands in sessionTracks, travels with the session when it is saved or shared, and never reaches the config.json the server hands every visitor.The default destination. Everything that is not an Add-track workflow wants this one, whoever is looking — a session spec's sessionTracks, a URL's &sessionTracks=, and every track a feature stands up on the user's behalf. Mirrors addSessionConnectionConf in the connections mixins. | SessionTracksManagerSessionMixin |
publishTrackConf(trackConf: AnyConfiguration) => any | Publish a track config to the shared catalog if this user can, and fall back to their session if they cannot: an admin's goes to jbrowse.tracks, which the admin server writes back into the config.json every visitor is served; everyone else's goes to sessionTracks.Only the "Add track" workflows. Those are where an admin adding a track means to add it for the whole site. A track a feature stands up on the user's behalf — a search result, a computed consensus, a reconstruction's segment labels — is not a catalog entry, and one admin click on this publishes it to every visitor, again on the next click, with a per-launch trackId that defeats the dedupe. addSessionTrackConf above is the destination for those.An admin's track still goes to the session when it names an assembly the config.json does not carry — a session spec's, a MAF sample's own genome, a comparative view's synthesized pair. The Add-track widget takes its assembly from the containing view, so an admin adding a track while looking at one of those arrives here with a name no visitor can resolve, and publishing it writes an entry the server hands everyone and nobody can draw. The session is the one destination where that track works, so the click keeps working and the dangling entry is never written; a snackbar says which assembly moved it. The snackbar names the assembly and not the track, which is what lets a batch collapse to one message: pushSnackbarMessage dedupes on the exact text, and BulkAddTracksWorkflow publishes in a loop, so interpolating the track name stacked one identical-but-for-a-name toast per file over an admin adding thirty. The assembly is the whole of what an admin has to act on anyway. | SessionTracksManagerSessionMixin |
addTrackConf(trackConf: AnyConfiguration) => any | Deprecated alias of addSessionTrackConf. Call that, or publishTrackConf. | SessionTracksManagerSessionMixin |
updateTrackConfiguration(trackConf: PlainTrackConfig) => void | Persist a non-admin's edited track config as a delta (trackConfigDeltas) against the admin-owned base — only the changed slots — so the edits persist and are shared while admin changes to untouched fields still flow through. A user-added session track (no base) is edited in place. Everything else (admin edits, opened connection tracks) defers to the base mixin, which routes connection tracks to connectionTrackConfigs and the rest to the jbrowse config. | SessionTracksManagerSessionMixin |
resetTrackConfiguration(trackId: string) => void | Drop a non-admin's delta (trackConfigDeltas) so the track reverts to its admin config (jbrowse.tracks) default. Unlike deleteTrackConf this does not dereference the track from open views — the base config re-resolves in place, so an open track stays open and simply reverts. | SessionTracksManagerSessionMixin |
| deleteTrackConf | SessionTracksManagerSessionMixin | |
| addSessionAssembly | AssembliesMixin | |
addAssembly(conf: AnyConfiguration) => void | AssembliesMixin | |
removeAssembly(name: string) => void | AssembliesMixin | |
removeSessionAssembly(assemblyName: string) => void | AssembliesMixin | |
| addTemporaryAssembly | used for read vs ref type assemblies. | AssembliesMixin |
removeTemporaryAssembly(name: string) => void | AssembliesMixin | |
renameCurrentSession(sessionName: string) => void | AppSessionMixin | |
addSessionConnectionConf(connectionConf: AnyConfiguration) => any | Add a connection config to this session: it lands in sessionConnections, travels with the session when it is saved or shared, and never reaches the config.json the server hands every visitor. Idempotent on connectionId.This is the one to call when the connection belongs to the session being built — a &hubURL= link, a session spec's sessionConnections — no matter who is looking. addConnectionConf below is the one whose destination depends on that. | WebSessionConnectionsMixin |
addConnectionConf(connectionConf: AnyConfiguration) => any | Add a connection config wherever this user's edits belong: an admin's into the shared config (jbrowse.connections, which the admin server writes back into config.json for every visitor), everyone else's into the session. Two destinations behind one name, so call it only where that really is the intent — the "Open connection..." dialog, where an admin adding a hub means to add it for the whole site. Anything that means one destination should say which: addSessionConnectionConf above for the session, jbrowse.addConnectionConf for the config. | WebSessionConnectionsMixin |
| deleteConnection | WebSessionConnectionsMixin | |
| makeConnection | ConnectionManagementSessionMixin | |
| breakConnection | Remove a live connection instance. Tolerant of an already-dormant connection (its instance is stripped from the session on reload). Leaves persisted open-track configs alone — the connect() error path calls this and the user's already-open tracks must survive a transient failure. Full removal goes through deleteConnection. | ConnectionManagementSessionMixin |
| teardownConnection | Close every track a connection contributed — the live instance's tracks plus any persisted open-track configs (a dormant connection, never expanded this session, still renders its opened tracks from connectionTrackConfigs) — from all views/widgets, drop the live instance, and drop the persisted configs. The session is left as if the connection had never loaded. | ConnectionManagementSessionMixin |
clearConnections() => void | ConnectionManagementSessionMixin | |
captureConnectionTrack(trackId: string) => void | Snapshot a just-opened connection track's config into connectionTrackConfigs so it survives session reload. No-op if the track isn't connection-provided or is already captured (edits go through updateConnectionTrackConfig). | ConnectionManagementSessionMixin |
| updateConnectionTrackConfig | Persist an edit to an opened connection track. The full config is stored (not a delta): the connection's fetched "base" isn't present at load, so only a complete config resolves synchronously. | ConnectionManagementSessionMixin |
| setConnectionTrackConfig | Upsert one opened connection track's persisted config. | ConnectionManagementSessionMixin |
pruneConnectionTrackConfig(trackId: string) => void | Drop a connection track's persisted config once no open view still references it, so the session doesn't accumulate closed tracks. | ConnectionManagementSessionMixin |
hydrateConnection(connectionId: string) => void | Lazily establish a single connection by id if it isn't already live — used when its category is expanded in the track selector. Fetches silently (no view launch / success snackbar); already-open tracks keep rendering from connectionTrackConfigs meanwhile. Idempotent. | ConnectionManagementSessionMixin |
setActivePanelId(panelId: string | undefined) => void | WorkspaceLayoutMixin | |
toggleMaximizedPanel(panelId: string) => void | Show one cell at the size of the workspace, or go back. A toggle rather than a pair, because the gesture is a toggle: the strip's double-click and the cell menu's one item both mean "this cell, or not any more". Maximizing a DIFFERENT cell while one is already maximized moves the mode rather than restoring, which is what the menu item on another cell's strip is asking for. Mounts no views that were not mounted — it is the same cell showing the same tab — and unmounts every other cell's, so the WebGL2 context ceiling ( agent-docs/reference/GPU_CONTEXT_BUDGET.md) can only go down. That is the reason it is this and not a display: none over a still-mounted workspace. | WorkspaceLayoutMixin |
restorePanels() => void | WorkspaceLayoutMixin | |
setActiveTab(panelId: string, tabId: string) => void | WorkspaceLayoutMixin | |
renameTab(tabId: string, title: string | undefined) => void | WorkspaceLayoutMixin | |
| splitPanel | Split a grid cell; the new cell gets one empty tab. | WorkspaceLayoutMixin |
closePanel(panelId: string) => void | WorkspaceLayoutMixin | |
addTab(panelId: string, viewIds?: string[]) => TabNode | undefined | "New empty tab": a tab in an existing cell, showing the launcher. | WorkspaceLayoutMixin |
closeTab(tabId: string) => void | Close a tab, and the cell with it if that was its last. A cell whose tabs are all gone is the state pruneEmptyPanel was written for — "dragging the last tab out of a split and leaving a blank half is the one place an empty panel is clearly not what was meant" — and closing that tab arrives at the identical half by a different gesture. It rendered nothing at all, not even the launcher an empty TAB shows, so the only way back out of it was the +.pruneEmptyPanel carries both guards already: a cell with tabs left stays, and the last cell in the workspace stays whatever happens to it, since there is nowhere for the tree to collapse to. | WorkspaceLayoutMixin |
addViewToTab(tabId: string, viewId: string) => void | WorkspaceLayoutMixin | |
| dropTabInPanel | Drop a dragged tab into an existing panel, as a tab. One action, so the tree never exists in a state where the tab is in both panels or neither. The imperative bridge needed an explicit runInAction around the unassign+reassign pair for exactly this, and a comment explaining that without it the reconcile autorun would observe the gap and re-home the view. | WorkspaceLayoutMixin |
| dropTabInNewSplit | Drop a dragged tab on a panel edge: split, and land in the new half. | WorkspaceLayoutMixin |
setSizes(branchId: string, sizes: number[]) => void | WorkspaceLayoutMixin | |
applyLayoutSpec(spec: LayoutSpecNode) => string[] | Arrange the workspace as a spec states. There is no init property and no standing request: the spec is converted and becomes the layout, here and now. init existed only because dockview had to be told, could not be told before it mounted, and had to be told again afterwards — three problems that all came from the layout living somewhere this action could not reach. | WorkspaceLayoutMixin |
moveViewToNewTab(viewId: string, allViewIds: string[]) => string | undefined | ViewMenu's "move to new tab": the view leaves its tab for a new one.allViewIds is EVERY view in the session, and is required for that reason — homing drops any view the list does not name, so the [viewId] default this used to carry unhomed all the others. | WorkspaceLayoutMixin |
moveViewToSplitRight(viewId: string, allViewIds: string[]) => string | undefined | ViewMenu's "move to split view": the view leaves for a new cell. allViewIds is every view in the session — see moveViewToNewTab. | WorkspaceLayoutMixin |
homeUnassignedViews(viewIds: string[]) => void | WorkspaceLayoutMixin | |
| setPendingMove | Move one view relative to the others. PUBLIC API: an external plugin calls this behind a 'setPendingMove' in session guard (jbrowse-plugin-protein3d, putting a protein view beside its genome view). It survived the last storage change by being kept as sugar, and it survives this one the same way — a capability-detecting caller cannot tell you it lost a capability.allViewIds is therefore OPTIONAL, and has to stay that way. The plugin passes the move alone, because that was the whole signature when its call site was written; requiring the second argument threw undefined.filter out of a launch the plugin does not wrap, and the figure was again the only thing that noticed. Keeping the NAME is half of not breaking a runtime lookup — the call has to keep working as it is spelled. | WorkspaceLayoutMixin |
tileViews(mode: TileMode, allViewIds: string[]) => void | The whole-workspace re-arrange: every view one cell, in one of four shapes. Restored from the dockview header's four "Global:" commands, which went with that component and were not reimplemented.allViewIds is passed in rather than read off the session for the same reason moveViewToNewTab takes it: this mixin owns the tree and has no view list of its own. Passing session.views order means the arrangement it states is already the order views render in, so unlike a session spec's layout there is nothing for orderViews to apply. | WorkspaceLayoutMixin |