MingaEditor.Shell.Traditional.Sidebars (Minga v0.1.0)

Copy Markdown View Source

Pure aggregate for Traditional sidebar selection and built-in surfaces.

The selected sidebar, Git status panel pair, and Observatory lifecycle are kept together so opening, closing, and replacing one built-in surface cannot leave an unrelated stale selection behind.

Summary

Functions

Returns the selected native sidebar id.

Closes Git status and clears both shared and TUI-specific state.

Closes Observatory and clears its selection when selected.

Completes a matching Observatory collection.

Expires a matching Observatory refresh token.

Returns the Git status panel.

Returns the TUI-specific Git status view state.

Shows or dismisses Observatory process inspection.

Returns the Observatory lifecycle value.

Opens and selects the Observatory surface.

Replaces the Git status panel while retaining its TUI view state.

Replaces the TUI-specific Git status view state.

Replaces Observatory data without changing refresh correlation.

Selects a visible sidebar, or clears selection with nil.

Types

git_status_tui_state()

@type git_status_tui_state() :: MingaEditor.GitStatus.TUIState.t()

t()

@type t() :: %MingaEditor.Shell.Traditional.Sidebars{
  active_id: String.t() | nil,
  git_status_panel: MingaEditor.GitStatus.Panel.t() | nil,
  git_status_tui_state: git_status_tui_state() | nil,
  observatory: MingaEditor.Shell.Traditional.Observatory.t()
}

Functions

active_id(sidebars)

@spec active_id(t()) :: String.t() | nil

Returns the selected native sidebar id.

close_git_status(sidebars)

@spec close_git_status(t()) :: t()

Closes Git status and clears both shared and TUI-specific state.

close_observatory(sidebars)

@spec close_observatory(t()) :: t()

Closes Observatory and clears its selection when selected.

complete_observatory(sidebars, token, data, next_timer)

@spec complete_observatory(
  t(),
  reference(),
  MingaEditor.Observatory.Data.t(),
  MingaEditor.Shell.Traditional.Observatory.timer()
) :: {:accepted | :stale, t()}

Completes a matching Observatory collection.

expire_observatory(sidebars, token)

@spec expire_observatory(t(), reference()) :: {:collect | :stale, t()}

Expires a matching Observatory refresh token.

git_status_panel(sidebars)

@spec git_status_panel(t()) :: MingaEditor.GitStatus.Panel.t() | nil

Returns the Git status panel.

git_status_tui_state(sidebars)

@spec git_status_tui_state(t()) :: git_status_tui_state() | nil

Returns the TUI-specific Git status view state.

inspect_observatory(sidebars, inspection)

@spec inspect_observatory(t(), MingaEditor.Observatory.Inspection.t() | nil) :: t()

Shows or dismisses Observatory process inspection.

observatory(sidebars)

Returns the Observatory lifecycle value.

open_observatory(sidebars, timer)

@spec open_observatory(t(), MingaEditor.Shell.Traditional.Observatory.timer() | nil) ::
  t()

Opens and selects the Observatory surface.

replace_git_status(sidebars, panel)

@spec replace_git_status(t(), MingaEditor.GitStatus.Panel.t() | nil) :: t()

Replaces the Git status panel while retaining its TUI view state.

replace_git_status_tui(sidebars, state)

@spec replace_git_status_tui(t(), git_status_tui_state() | nil) :: t()

Replaces the TUI-specific Git status view state.

replace_observatory_data(sidebars, data)

@spec replace_observatory_data(t(), MingaEditor.Observatory.Data.t() | nil) :: t()

Replaces Observatory data without changing refresh correlation.

select(sidebars, id)

@spec select(t(), String.t() | nil) :: t()

Selects a visible sidebar, or clears selection with nil.