Documentation
¶
Overview ¶
Package dashboard provides the interactive terminal dashboard UI.
Index ¶
- Constants
- func CountWorkspaceIssues(statuses []RepoStatus) int
- func FetchAction(repoPath, repoName string) tea.Cmd
- func Icon(s RepoStatus) string
- func PullAction(repoPath, repoName string) tea.Cmd
- func StatusText(s RepoStatus) string
- type ActionCompleteMsg
- type ActionStartMsg
- type ActionType
- type ConfirmAction
- type ConfirmModel
- func (m ConfirmModel) Init() tea.Cmd
- func (m ConfirmModel) IsCanceled() bool
- func (m ConfirmModel) IsConfirmed() bool
- func (m ConfirmModel) IsDeleting() bool
- func (m ConfirmModel) IsDone() bool
- func (m ConfirmModel) SetDeleting(deleting bool) ConfirmModel
- func (m ConfirmModel) SetSize(width, height int) ConfirmModel
- func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)
- func (m ConfirmModel) View() string
- type DashboardModel
- type DashboardResult
- type DetailsModel
- func (m DetailsModel) Init() tea.Cmd
- func (m DetailsModel) SelectedRepo() int
- func (m DetailsModel) SetFocused(focused bool) DetailsModel
- func (m DetailsModel) SetLoading(loading bool) DetailsModel
- func (m DetailsModel) SetSize(width, height int) DetailsModel
- func (m DetailsModel) SetStatuses(statuses []RepoStatus) DetailsModel
- func (m DetailsModel) SetWorkspace(ws *WorkspaceData) DetailsModel
- func (m DetailsModel) Update(msg tea.Msg) (DetailsModel, tea.Cmd)
- func (m DetailsModel) View() string
- type DiffLoadedMsg
- type DiffViewModel
- func (m DiffViewModel) Init() tea.Cmd
- func (m DiffViewModel) SetContent(content, repoName string, staged bool) DiffViewModel
- func (m DiffViewModel) SetError(err error) DiffViewModel
- func (m DiffViewModel) SetLoading(loading bool) DiffViewModel
- func (m DiffViewModel) SetSize(width, height int) DiffViewModel
- func (m DiffViewModel) Update(msg tea.Msg) (DiffViewModel, tea.Cmd)
- func (m DiffViewModel) View() string
- type ErrorMsg
- type HelpModel
- type KeyMap
- type Pane
- type RefreshMsg
- type RepoStatus
- type RepoStatusMsg
- type StatusClearedMsg
- type StatusSummary
- type TickMsg
- type WorkspaceData
- type WorkspaceListModel
- func (m WorkspaceListModel) Init() tea.Cmd
- func (m WorkspaceListModel) SelectedIndex() int
- func (m WorkspaceListModel) SelectedWorkspace() *WorkspaceData
- func (m WorkspaceListModel) SetFocused(focused bool) WorkspaceListModel
- func (m WorkspaceListModel) SetSize(width, height int) WorkspaceListModel
- func (m WorkspaceListModel) SetStatuses(statuses map[string][]RepoStatus) WorkspaceListModel
- func (m WorkspaceListModel) SetWorkspaces(workspaces []WorkspaceData) WorkspaceListModel
- func (m WorkspaceListModel) Update(msg tea.Msg) (WorkspaceListModel, tea.Cmd)
- func (m WorkspaceListModel) View() string
- type WorkspaceStatusMsg
- type WorkspacesLoadedMsg
Constants ¶
const ( StatusClean = status.StatusClean StatusModified = status.StatusModified StatusAhead = status.StatusAhead StatusBehind = status.StatusBehind StatusDiverged = status.StatusDiverged StatusError = status.StatusError StatusLoading = status.StatusLoading )
Variables ¶
This section is empty.
Functions ¶
func CountWorkspaceIssues ¶
func CountWorkspaceIssues(statuses []RepoStatus) int
CountWorkspaceIssues counts how many repos have uncommitted/unpushed changes.
func FetchAction ¶
FetchAction creates a fetch command for a single repo.
func PullAction ¶
PullAction creates a pull command for a single repo.
func StatusText ¶
func StatusText(s RepoStatus) string
StatusText returns a short status description for display.
Types ¶
type ActionCompleteMsg ¶
type ActionCompleteMsg struct {
Action ActionType
Workspace string
Repo string
Success bool
Error error
Output string
}
ActionCompleteMsg is sent when an action completes.
type ActionStartMsg ¶
type ActionStartMsg struct {
Action ActionType
Workspace string
Repo string
}
ActionStartMsg is sent when an action starts.
type ActionType ¶
type ActionType int
ActionType represents the type of action to perform.
const ( ActionFetch ActionType = iota ActionPull ActionDelete ActionCreate ActionSwitch ActionDiff )
func (ActionType) String ¶
func (a ActionType) String() string
String returns a human-readable name for the action.
type ConfirmAction ¶
type ConfirmAction struct {
Action ActionType
Workspace string
Repo string
Description string
}
ConfirmAction contains details for a confirmation dialog.
type ConfirmModel ¶
type ConfirmModel struct {
// contains filtered or unexported fields
}
ConfirmModel represents a confirmation dialog.
func NewConfirm ¶
func NewConfirm(action ConfirmAction, keys KeyMap) ConfirmModel
NewConfirm creates a new confirmation dialog.
func (ConfirmModel) IsCanceled ¶
func (m ConfirmModel) IsCanceled() bool
IsCanceled returns true if the user canceled.
func (ConfirmModel) IsConfirmed ¶
func (m ConfirmModel) IsConfirmed() bool
IsConfirmed returns true if the user confirmed.
func (ConfirmModel) IsDeleting ¶ added in v0.0.4
func (m ConfirmModel) IsDeleting() bool
IsDeleting returns true if a deletion is in progress.
func (ConfirmModel) IsDone ¶
func (m ConfirmModel) IsDone() bool
IsDone returns true if the dialog is complete.
func (ConfirmModel) SetDeleting ¶ added in v0.0.4
func (m ConfirmModel) SetDeleting(deleting bool) ConfirmModel
SetDeleting sets the deleting state.
func (ConfirmModel) SetSize ¶
func (m ConfirmModel) SetSize(width, height int) ConfirmModel
SetSize sets the component dimensions.
func (ConfirmModel) Update ¶
func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)
Update handles messages.
func (ConfirmModel) View ¶
func (m ConfirmModel) View() string
View renders the confirmation dialog.
type DashboardModel ¶
type DashboardModel struct {
// contains filtered or unexported fields
}
DashboardModel is the main dashboard model.
func NewDashboard ¶
func NewDashboard(wm *workspace.Manager, cm *config.ConfigManager) DashboardModel
NewDashboard creates a new dashboard model.
func (DashboardModel) OpenSetup ¶ added in v0.0.4
func (m DashboardModel) OpenSetup() bool
OpenSetup returns true if the user requested to open the setup wizard.
func (DashboardModel) SelectedPath ¶
func (m DashboardModel) SelectedPath() string
SelectedPath returns the path of the workspace the user wants to switch to.
type DashboardResult ¶ added in v0.0.4
DashboardResult contains the result of running the dashboard.
func RunDashboard ¶
func RunDashboard(wm *workspace.Manager, cm *config.ConfigManager) (DashboardResult, error)
RunDashboard runs the dashboard and returns the result.
type DetailsModel ¶
type DetailsModel struct {
// contains filtered or unexported fields
}
DetailsModel represents the right panel workspace details.
func (DetailsModel) SelectedRepo ¶
func (m DetailsModel) SelectedRepo() int
SelectedRepo returns the currently selected repo index.
func (DetailsModel) SetFocused ¶
func (m DetailsModel) SetFocused(focused bool) DetailsModel
SetFocused sets whether this panel is focused.
func (DetailsModel) SetLoading ¶
func (m DetailsModel) SetLoading(loading bool) DetailsModel
SetLoading sets the loading state.
func (DetailsModel) SetSize ¶
func (m DetailsModel) SetSize(width, height int) DetailsModel
SetSize sets the component dimensions.
func (DetailsModel) SetStatuses ¶
func (m DetailsModel) SetStatuses(statuses []RepoStatus) DetailsModel
SetStatuses sets the repo statuses.
func (DetailsModel) SetWorkspace ¶
func (m DetailsModel) SetWorkspace(ws *WorkspaceData) DetailsModel
SetWorkspace sets the workspace to display.
func (DetailsModel) Update ¶
func (m DetailsModel) Update(msg tea.Msg) (DetailsModel, tea.Cmd)
Update handles messages.
type DiffLoadedMsg ¶
DiffLoadedMsg is sent when diff content is loaded.
type DiffViewModel ¶
type DiffViewModel struct {
// contains filtered or unexported fields
}
func NewDiffView ¶
func NewDiffView(keys KeyMap) DiffViewModel
func (DiffViewModel) Init ¶
func (m DiffViewModel) Init() tea.Cmd
func (DiffViewModel) SetContent ¶
func (m DiffViewModel) SetContent(content, repoName string, staged bool) DiffViewModel
func (DiffViewModel) SetError ¶
func (m DiffViewModel) SetError(err error) DiffViewModel
func (DiffViewModel) SetLoading ¶
func (m DiffViewModel) SetLoading(loading bool) DiffViewModel
func (DiffViewModel) SetSize ¶
func (m DiffViewModel) SetSize(width, height int) DiffViewModel
func (DiffViewModel) Update ¶
func (m DiffViewModel) Update(msg tea.Msg) (DiffViewModel, tea.Cmd)
func (DiffViewModel) View ¶
func (m DiffViewModel) View() string
type HelpModel ¶
type HelpModel struct {
// contains filtered or unexported fields
}
HelpModel represents the help overlay.
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Left key.Binding
Right key.Binding
Select key.Binding
Fetch key.Binding
Pull key.Binding
Delete key.Binding
Create key.Binding
Refresh key.Binding
Diff key.Binding
DiffStaged key.Binding
Settings key.Binding
Help key.Binding
Quit key.Binding
Filter key.Binding
Confirm key.Binding
Cancel key.Binding
}
KeyMap contains all keyboard bindings for the dashboard.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns the default keybindings with vim support.
type RepoStatus ¶
type RepoStatus = status.RepoStatus
RepoStatus is an alias to the shared status type with UI methods.
func FetchWorkspaceStatus ¶
func FetchWorkspaceStatus(workspacePath string, projects []string) []RepoStatus
FetchWorkspaceStatus fetches status for all repos in a workspace.
type RepoStatusMsg ¶
type RepoStatusMsg struct {
WorkspacePath string
RepoName string
Status RepoStatus
}
RepoStatusMsg is sent when a single repo's status is updated.
type StatusClearedMsg ¶ added in v0.0.5
type StatusClearedMsg struct{}
StatusClearedMsg signals that status message should be cleared.
type StatusSummary ¶
type StatusSummary = status.StatusSummary
StatusSummary is an alias to the shared status summary type.
type WorkspaceData ¶
type WorkspaceData struct {
Name string
Path string
Projects []string
Created time.Time
IsWorktree bool
}
WorkspaceData contains information about a workspace.
func WorkspacesToData ¶
func WorkspacesToData(workspaces []workspace.Workspace) []WorkspaceData
WorkspacesToData converts workspace types to dashboard WorkspaceData.
type WorkspaceListModel ¶
type WorkspaceListModel struct {
// contains filtered or unexported fields
}
WorkspaceListModel represents the left panel workspace list.
func NewWorkspaceList ¶
func NewWorkspaceList(workspaces []WorkspaceData, keys KeyMap) WorkspaceListModel
NewWorkspaceList creates a new workspace list model.
func (WorkspaceListModel) Init ¶
func (m WorkspaceListModel) Init() tea.Cmd
Init initializes the component.
func (WorkspaceListModel) SelectedIndex ¶
func (m WorkspaceListModel) SelectedIndex() int
SelectedIndex returns the actual index of the selected workspace.
func (WorkspaceListModel) SelectedWorkspace ¶
func (m WorkspaceListModel) SelectedWorkspace() *WorkspaceData
SelectedWorkspace returns the selected workspace or nil.
func (WorkspaceListModel) SetFocused ¶
func (m WorkspaceListModel) SetFocused(focused bool) WorkspaceListModel
SetFocused sets whether this panel is focused.
func (WorkspaceListModel) SetSize ¶
func (m WorkspaceListModel) SetSize(width, height int) WorkspaceListModel
SetSize sets the component dimensions.
func (WorkspaceListModel) SetStatuses ¶
func (m WorkspaceListModel) SetStatuses(statuses map[string][]RepoStatus) WorkspaceListModel
SetStatuses updates the status map.
func (WorkspaceListModel) SetWorkspaces ¶
func (m WorkspaceListModel) SetWorkspaces(workspaces []WorkspaceData) WorkspaceListModel
SetWorkspaces updates the workspace list.
func (WorkspaceListModel) Update ¶
func (m WorkspaceListModel) Update(msg tea.Msg) (WorkspaceListModel, tea.Cmd)
Update handles messages.
func (WorkspaceListModel) View ¶
func (m WorkspaceListModel) View() string
View renders the workspace list.
type WorkspaceStatusMsg ¶
type WorkspaceStatusMsg struct {
WorkspacePath string
Statuses []RepoStatus
}
WorkspaceStatusMsg is sent when a workspace's status is updated.
type WorkspacesLoadedMsg ¶
type WorkspacesLoadedMsg struct {
Workspaces []WorkspaceData
}
WorkspacesLoadedMsg is sent when workspaces are loaded.