config

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles loading and saving td configuration from .todos/config.json.

Index

Constants

View Source
const (
	DefaultTitleMinLength = 15
	DefaultTitleMaxLength = 100
)

Title validation defaults

Variables

This section is empty.

Functions

func ClearActiveWorkSession

func ClearActiveWorkSession(baseDir string) error

ClearActiveWorkSession clears the active work session

func ClearFocus

func ClearFocus(baseDir string) error

ClearFocus clears the focused issue

func DefaultPaneHeights added in v0.4.16

func DefaultPaneHeights() [3]float64

DefaultPaneHeights returns the default pane height ratios (equal thirds)

func GetActiveWorkSession

func GetActiveWorkSession(baseDir string) (string, error)

GetActiveWorkSession returns the active work session ID

func GetFeatureFlag added in v0.30.0

func GetFeatureFlag(baseDir, name string) (bool, bool, error)

GetFeatureFlag returns a feature flag from local config. The second return value indicates whether the flag is explicitly set.

func GetFocus

func GetFocus(baseDir string) (string, error)

GetFocus returns the focused issue ID

func GetPaneHeights added in v0.4.16

func GetPaneHeights(baseDir string) ([3]float64, error)

GetPaneHeights returns the configured pane heights, or defaults if not set

func GetTitleLengthLimits added in v0.18.0

func GetTitleLengthLimits(baseDir string) (min, max int, err error)

GetTitleLengthLimits returns min/max title length limits from config (with defaults)

func Load

func Load(baseDir string) (*models.Config, error)

Load reads the config from disk

func Save

func Save(baseDir string, cfg *models.Config) error

Save writes the config to disk using atomic write (temp file + rename)

func SetActiveWorkSession

func SetActiveWorkSession(baseDir string, wsID string) error

SetActiveWorkSession sets the active work session ID

func SetFeatureFlag added in v0.30.0

func SetFeatureFlag(baseDir, name string, enabled bool) error

SetFeatureFlag persists a feature flag in local config.

func SetFilterState added in v0.12.3

func SetFilterState(baseDir string, state *FilterState) error

SetFilterState saves the filter state to config

func SetFocus

func SetFocus(baseDir string, issueID string) error

SetFocus sets the focused issue ID

func SetPaneHeights added in v0.4.16

func SetPaneHeights(baseDir string, heights [3]float64) error

SetPaneHeights saves the pane height ratios to config

func UnsetFeatureFlag added in v0.30.0

func UnsetFeatureFlag(baseDir, name string) error

UnsetFeatureFlag removes an explicitly-set feature flag from local config.

Types

type FilterState added in v0.12.3

type FilterState struct {
	SearchQuery   string
	SortMode      string // "priority", "created", "updated"
	TypeFilter    string // "", "epic", "task", "bug", "feature", "chore"
	IncludeClosed bool
}

FilterState holds the current filter/search state for the monitor

func GetFilterState added in v0.12.3

func GetFilterState(baseDir string) (*FilterState, error)

GetFilterState returns the saved filter state

Jump to

Keyboard shortcuts

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