MultipleViewsSessionMixin
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
| 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 |
Volatiles
| Member | Description | Defined by |
|---|---|---|
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 |
Getters
| Member | Description | Defined by |
|---|---|---|
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 |
rootTypeOrStateTreeNodeToStateTreeNode<ROOT_MODEL_TYPE> | BaseSessionModel | |
jbrowseany | BaseSessionModel | |
rpcManagerRpcManager | BaseSessionModel | |
configurationInstance<JB_CONFIG_SCHEMA> | BaseSessionModel | |
adminModeboolean | BaseSessionModel | |
textSearchManagerTextSearchManager | 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 |
Methods
| Member | Description | Defined by |
|---|---|---|
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 |
Actions
| Member | Description | Defined by |
|---|---|---|
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 |