state

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(path string) error

Clear removes the state file

func DefaultStatePath

func DefaultStatePath(configPath string) string

DefaultStatePath returns the default state file path relative to config

func ExtractGroupIDs

func ExtractGroupIDs(groups []*config.Group) []string

ExtractGroupIDs converts a slice of group pointers to their IDs

func ResolveGroupPath

func ResolveGroupPath(cfg *config.Config, groupIDs []string) ([]*config.Group, bool)

ResolveGroupPath converts a slice of group IDs to group pointers Returns the resolved groups and true if all groups were found

Types

type NavigationState struct {
	// View identification
	ViewState ViewState `yaml:"viewState"`

	// For browsingGroups: path through the group hierarchy (group IDs)
	GroupPath []string `yaml:"groupPath,omitempty"`

	// For viewingWorkflowOutput: which workflow was selected
	SelectedWorkflow string `yaml:"selectedWorkflow,omitempty"`

	// Was workflow accessed via pinned view? (determines back navigation)
	FromPinnedView bool `yaml:"fromPinnedView,omitempty"`

	// List selection indices for better UX
	ListIndex       int `yaml:"listIndex,omitempty"`
	PinnedListIndex int `yaml:"pinnedListIndex,omitempty"`
}

NavigationState represents the persisted navigation state

func Load

func Load(path string) (*NavigationState, error)

Load reads the navigation state from a file

func (s *NavigationState) Save(path string) error

Save writes the navigation state to a file

type ViewState

type ViewState string

ViewState represents the current view in the TUI

const (
	ViewBrowsingGroups  ViewState = "browsingGroups"
	ViewPinnedWorkflows ViewState = "viewingPinnedWorkflows"
	ViewWorkflowOutput  ViewState = "viewingWorkflowOutput"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL