Member Junction
    Preparing search index...

    Manages workspace state including tabs, layout, and persistence.

    Uses a single Workspace.Configuration JSON blob for all state, with debounced saves to minimize database writes.

    Index

    Constructors

    Properties

    MainLayoutTabFilter: ((tab: WorkspaceTab) => boolean) | null = null

    Optional predicate identifying tabs that belong to the MAIN layout. Tabs failing the predicate (e.g. record tabs under the records-style record-open model, which live in their own layout region) are excluded from ALL main-layout semantics: they never force the main tab bar to appear (shouldShowTabs), are never consumed as the replaceable "temporary tab" by OpenTab, and skip the keep-last-tab-alive rule in CloseTab. Null = every tab is a main-layout tab (classic behavior). Kept as a settable predicate (not an import) because this package sits below the package that owns the record-open style. NOTE: record tabs DOCKED to the workspace ("Move to Workspace") intentionally PASS this filter — they are main-layout tabs.

    RecordsRegionTabFilter: ((tab: WorkspaceTab) => boolean) | null = null

    Optional predicate identifying members of the records REGION — the second temp-tab pool. Requests carrying TempScope: 'records' consume and cascade within this set only, which is what gives records preview-tab behavior without letting a nav click touch a record (TempTabConsumptionFilter keeps guarding that direction) or a record open touch the nav tab. Settable predicate for the same layering reason as MainLayoutTabFilter. NOTE: record tabs DOCKED to the workspace ("Move to Workspace") must FAIL this filter — docking is an act of investment, and a docked record is a main-layout tab that nothing in either pool may consume.

    TempTabConsumptionFilter: ((tab: WorkspaceTab) => boolean) | null = null

    Optional predicate identifying tabs that may be CONSUMED as the replaceable "temporary tab" by OpenTab. Record tabs (docked or not) are deliberately unpinned yet must never be silently replaced by the next nav click — the shell sets this to exclude ALL record tabs under the records style. Null = every unpinned main-layout tab is consumable (classic behavior). Settable predicate for the same layering reason as MainLayoutTabFilter.

    Accessors

    • get TabBarVisible(): Observable<boolean>

      Observable of tab bar visibility Returns false when only 1 tab exists and no tabs are pinned Returns true when 2+ tabs exist OR any tabs are pinned

      Returns Observable<boolean>

    Methods

    • Clear the saved layout structure. This is used to recover from corrupted layouts - tabs will be recreated fresh.

      Returns void

    • Close all tabs except the specified one

      Parameters

      • tabId: string

      Returns void

    • Close all tabs to the right of the specified tab

      Parameters

      • tabId: string

      Returns void

    • Initialize the workspace state for a user

      Parameters

      • userId: string

      Returns Promise<void>

    • Force creation of a new tab, never replacing temporary tabs Used for Shift+Click behavior - checks for existing tab first, only creates new if none exists

      Parameters

      Returns string

    • Reset workspace to a clean default configuration and persist immediately. Used for recovery when stale or corrupted workspace data prevents startup.

      Returns Promise<void>

    • Update the RECORDS region layout (the separate Golden Layout hosting record tabs under the records-style record-open model).

      Parameters

      Returns void

    • Update the configuration of a specific tab. Merges the provided partial configuration with the existing tab configuration.

      Parameters

      • tabId: string

        The ID of the tab to update

      • configUpdate: Partial<WorkspaceTab["configuration"]>

        Partial configuration to merge with existing configuration

      Returns void

    • Update a tab's top-level resourceRecordId (and mirror it into configuration.recordId).

      Used when a "new record" tab transitions to a saved record — the tab was opened with an empty recordId, but once the user saves, the tab now represents an actual record. Without this, the next "Create New Record" request would match this tab (both have empty resourceRecordId) and focus the stale form instead of opening a fresh one.

      Also clears configuration.isNew since the record now exists.

      Parameters

      • tabId: string
      • newRecordId: string

      Returns void

    • Update tab sequences after reorder

      Parameters

      • tabIds: string[]

      Returns void

    • Update the title of a specific tab

      Parameters

      • tabId: string
      • newTitle: string

      Returns void