EmbeddedSessionThemeMixin
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
Theme getters shared by the single-view embedded sessions
(react-linear-genome-view, react-circular-genome-view). Embedded products
have no theme switching, so the active theme is always default; the config
theme slot still applies via configTheme.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
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 |
| heldForMissingPlugins | views, tracks, displays and widgets pruneUnbuildableNodes took out of the tree because this build has no plugin for their type, each with the anchor that puts it back. Nothing in the session reads its contents, and pruneUnbuildableNodes defines their structure.It is a declared property because MST drops undeclared snapshot keys without error. Without this declaration the held nodes survive the prune and are then discarded when setSession builds the tree, while every unit test of the prune still passes. heldNodesSurviveTheSession.test.ts tests that they survive. | BaseSessionModel |
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. A single spread-replaced object made every setter wake every reader, so toggling scroll-to-zoom re-fetched every track.deep: false keeps an object-valued preference a plain object rather than a MobX Proxy, which V8's structured-clone serializer rejects. 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 |
Getters
| Member | Description | Defined by |
|---|---|---|
themeOptionsSerializableThemeArgs | Serializable theme description (the canonical themeOptions contract shared with the app-core/web sessions). This is what crosses the RPC worker boundary — e.g. the canvas display reads getSession(self).themeOptions in its rpcProps so worker-baked colors (CDS frames, stroke fallback) honor the config theme slot. | EmbeddedSessionThemeMixin |
paletteJBrowsePalette | Every color JBrowse renders, resolved to plain strings and free of any UI toolkit. This is what rendering reads. See the canonical ThemeManagerSessionMixin getter of the same name. | EmbeddedSessionThemeMixin |
styleThemeJBrowseStyleTheme | The palette plus the sizing tokens makeStyles reads. See the canonical ThemeManagerSessionMixin getter of the same name. | EmbeddedSessionThemeMixin |
themeTheme | Resolved MUI theme, mirroring the product's ThemeProvider. Lets headless/RPC consumers derive theme-dependent state without a mounted component. Shares its colors with palette by construction. | EmbeddedSessionThemeMixin |
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 |
Methods
| Member | Description | Defined by |
|---|---|---|
getActiveThemeOptions(_name?: string | undefined) => ThemeOptions | undefined | Raw ThemeOptions for the active theme, which every view's SVG export threads into each display's renderSvg as a configTheme and rebuilds outside React. The config slot is the whole answer here because it is the whole of an embedded product's theming: no picker, no allThemes, and it is what setThemeMode writes and palette resolves from. name is accepted and ignored — the app session's counterpart looks a named preset up in allThemes(). | EmbeddedSessionThemeMixin |
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 |
getPreferenceChanges() => TrackConfigChange[] | every scalar preference override that currently differs from its config/admin default, as { path, from, to } rows whose path is the override's own key. A scalar pref (animationMode, scrollZoom) whose override equals the default is omitted, since reverting it is a no-op. | BaseSessionModel |
Actions
| Member | Description | Defined by |
|---|---|---|
setThemeMode(mode: "dark" | "light") => void | Switch the session to light or dark. themeOptions sends the theme slot to the renderer, so labels drawn in the worker follow it, and palette is derived from the same slot, so React-drawn elements follow it too. An embedder who sets only a React-side palette leaves the worker-drawn labels in the old mode.Merges into the existing theme at both levels. theme is a frozen slot, so setConf(session, 'theme', { palette: { mode } }) replaces every other key in it, discarding whatever the host passed as createViewState's configuration.theme (a brand primary, say) the first time their dark-mode toggle fires. resolvePalette spreads configTheme.palette over the preset shallowly, so mode and primary are siblings and both levels have to be kept. | EmbeddedSessionThemeMixin |
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 visible even after 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, 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 |
setScrollZoom(flag: boolean) => void | set the global scroll-to-zoom preference (see the scrollZoom getter) | 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 |