# TracksManagerSessionMixin

Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the [developer guide](https://jbrowse.org/jb2/docs/developer_guide/) for concepts. Built into JBrowse core. [View source](https://github.com/GMOD/jbrowse-components/blob/main/packages/product-core/src/Session/Tracks.ts).

Adds track configs to a session: looking one up by trackId among the
config's tracks, assembly sequences and connection tracks, and adding or
editing one.

Each section ends with the members a composed model contributes, linked to the page that documents them.

## Properties

7 inherited properties from one model:

From [BaseSessionModel](../basesessionmodel): [`id`](../basesessionmodel#property-id), [`name`](../basesessionmodel#property-name), [`focusedViewId`](../basesessionmodel#property-focusedviewid), [`highlights`](../basesessionmodel#property-highlights), [`highlightsVisible`](../basesessionmodel#property-highlightsvisible), [`highlightLabelsVisible`](../basesessionmodel#property-highlightlabelsvisible), [`heldForMissingPlugins`](../basesessionmodel#property-heldformissingplugins)


## Volatiles

6 inherited volatiles from 2 models:

From [BaseSessionModel](../basesessionmodel): [`selection`](../basesessionmodel#volatile-selection), [`hovered`](../basesessionmodel#volatile-hovered), [`queueOfDialogs`](../basesessionmodel#volatile-queueofdialogs), [`preferencesOverrides`](../basesessionmodel#volatile-preferencesoverrides)

From [SnackbarModel](../snackbarmodel): [`snackbarMessages`](../snackbarmodel#volatile-snackbarmessages), [`errorDialog`](../snackbarmodel#volatile-errordialog)


## Getters

| Member | Description |
| --- | --- |
| **trackBasesById**<br><code>Map&lt;string, TrackConfigEntry&gt;</code> | Each track's base by trackId: the entry its edits diff against. Here the config.json entry, which an edit writes directly. |
| **tracks**<br><code>TrackConfigEntry[]</code> |  |

13 inherited getters from 2 models:

From [BaseSessionModel](../basesessionmodel): [`root`](../basesessionmodel#getter-root), [`jbrowse`](../basesessionmodel#getter-jbrowse), [`rpcManager`](../basesessionmodel#getter-rpcmanager), [`configuration`](../basesessionmodel#getter-configuration), [`adminMode`](../basesessionmodel#getter-adminmode), [`textSearchManager`](../basesessionmodel#getter-textsearchmanager), [`assemblies`](../basesessionmodel#getter-assemblies), [`DialogComponent`](../basesessionmodel#getter-dialogcomponent), [`DialogProps`](../basesessionmodel#getter-dialogprops), [`animationMode`](../basesessionmodel#getter-animationmode), [`scrollZoom`](../basesessionmodel#getter-scrollzoom), [`numberGrouping`](../basesessionmodel#getter-numbergrouping)

From [SnackbarModel](../snackbarmodel): [`snackbarMessageSet`](../snackbarmodel#getter-snackbarmessageset)


## Methods

| Member | Description |
| --- | --- |
| **withTrackEdits**<br><code>(base: TrackConfigEntry) =&gt; TrackConfigEntry</code> | A track's base as the session resolves it, its edits applied. Here the base itself. |
| **getTrackById**<br><code>(id: string) =&gt; AnyTrackConfig &#124; undefined</code> | 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. |
| **getTracksById**<br><code>() =&gt; Record&lt;string, AnyTrackConfig&gt;</code> | Every track config the session can resolve, keyed by trackId. Prefer the per-id reactive `getTrackById(id)`: this map is rebuilt over every track on the first read after any edit, and reading it subscribes the caller to all of them. Kept for plugins that look up ids in a non-reactive context. |

5 inherited methods from 2 models:

From [BaseSessionModel](../basesessionmodel): [`getPreferenceDefault`](../basesessionmodel#method-getpreferencedefault), [`getPreference`](../basesessionmodel#method-getpreference), [`getPreferenceChanges`](../basesessionmodel#method-getpreferencechanges)

From [ReferenceManagementSessionMixin](../referencemanagementsessionmixin): [`getReferringMultiple`](../referencemanagementsessionmixin#method-getreferringmultiple), [`getReferring`](../referencemanagementsessionmixin#method-getreferring)


## Actions

| Member | Description |
| --- | --- |
| **addSessionTrackConf**<br><code>(trackConf: AnyConfiguration) =&gt; any</code> | Add a track config to *this session*.<br><br>This mixin's session has no separate session-track store, so the destination is the jbrowse config — which in the products that compose it (desktop) is the single user's own file rather than something a server hands other visitors, so the two scopes are the same place. Defined here anyway so that every session has it: a feature standing a track up on the user's behalf can then call one action everywhere instead of asking which mixin it landed on. `SessionTracksManagerSessionMixin` overrides it with the real session-scoped store. |
| **publishTrackConf**<br><code>(trackConf: AnyConfiguration) =&gt; any</code> | Add a track config wherever *this user's* catalog edits belong — the "Add track" workflows, where an admin adding a track means to add it for the whole site. `SessionTracksManagerSessionMixin` overrides it to send a non-admin's to the session instead; here there is only the one destination.<br><br>Anything that is not an Add-track workflow wants `addSessionTrackConf`: a track a feature stands up on the user's behalf — a search result, a computed consensus, a reconstruction's labels — is not a catalog entry, and publishing one writes it into the config.json every visitor is served, once per click. |
| **addTrackConf**<br><code>(trackConf: AnyConfiguration) =&gt; any</code> | Deprecated alias of `addSessionTrackConf`. Call that, or `publishTrackConf`, which say which destination they mean. |
| **updateTrackConfiguration**<br><code>(trackConf: { [key: string]: unknown; trackId: string; }) =&gt; void</code> | Persist edited track config back to the in-memory jbrowse config. The session-tracks mixin overrides this so a non-admin's edits become a shareable session-track override instead. |
| **deleteTrackConf**<br><code>(trackConf: AnyTrackConfig) =&gt; any</code> |  |

25 inherited actions from 3 models:

From [BaseSessionModel](../basesessionmodel): [`setSelection`](../basesessionmodel#action-setselection), [`clearSelection`](../basesessionmodel#action-clearselection), [`setHovered`](../basesessionmodel#action-sethovered), [`setHighlightsVisible`](../basesessionmodel#action-sethighlightsvisible), [`setHighlightLabelsVisible`](../basesessionmodel#action-sethighlightlabelsvisible), [`addHighlight`](../basesessionmodel#action-addhighlight), [`removeHighlight`](../basesessionmodel#action-removehighlight), [`updateHighlight`](../basesessionmodel#action-updatehighlight), [`setHighlights`](../basesessionmodel#action-sethighlights), [`setPreferenceOverride`](../basesessionmodel#action-setpreferenceoverride), [`clearPreferenceOverrides`](../basesessionmodel#action-clearpreferenceoverrides), [`clearPreferenceOverride`](../basesessionmodel#action-clearpreferenceoverride), [`setScrollZoom`](../basesessionmodel#action-setscrollzoom), [`setName`](../basesessionmodel#action-setname), [`setFocusedViewId`](../basesessionmodel#action-setfocusedviewid), [`removeActiveDialog`](../basesessionmodel#action-removeactivedialog), [`queueDialog`](../basesessionmodel#action-queuedialog), [`removeDialog`](../basesessionmodel#action-removedialog)

From [SnackbarModel](../snackbarmodel): [`notify`](../snackbarmodel#action-notify), [`notifyError`](../snackbarmodel#action-notifyerror), [`setErrorDialog`](../snackbarmodel#action-seterrordialog), [`pushSnackbarMessage`](../snackbarmodel#action-pushsnackbarmessage), [`popSnackbarMessage`](../snackbarmodel#action-popsnackbarmessage), [`removeSnackbarMessage`](../snackbarmodel#action-removesnackbarmessage)

From [ReferenceManagementSessionMixin](../referencemanagementsessionmixin): [`dereferenceTrack`](../referencemanagementsessionmixin#action-dereferencetrack)


