plugin

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPaneAction added in v0.0.4

func ApplyPaneAction(src *task.Task, action PaneAction, currentUser string) (*task.Task, error)

ApplyPaneAction applies a parsed action to a task clone.

func SortTasks

func SortTasks(tasks []*task.Task, rules []SortRule)

SortTasks sorts tasks according to the given sort rules

Types

type ActionField added in v0.0.4

type ActionField string

ActionField identifies a supported action field.

const (
	ActionFieldStatus   ActionField = "status"
	ActionFieldType     ActionField = "type"
	ActionFieldPriority ActionField = "priority"
	ActionFieldAssignee ActionField = "assignee"
	ActionFieldPoints   ActionField = "points"
	ActionFieldTags     ActionField = "tags"
)

type ActionOperator added in v0.0.4

type ActionOperator string

ActionOperator identifies a supported action operator.

const (
	ActionOperatorAssign ActionOperator = "="
	ActionOperatorAdd    ActionOperator = "+="
	ActionOperatorRemove ActionOperator = "-="
)

type BasePlugin

type BasePlugin struct {
	Name        string        // display name shown in caption
	Key         tcell.Key     // tcell key constant (e.g. KeyCtrlH)
	Rune        rune          // printable character (e.g. 'L')
	Modifier    tcell.ModMask // modifier keys (Alt, Shift, Ctrl, etc.)
	Foreground  tcell.Color   // caption text color
	Background  tcell.Color   // caption background color
	FilePath    string        // source file path (for error messages)
	ConfigIndex int           // index in config.yaml plugins array (-1 if embedded/not in config)
	Type        string        // plugin type: "tiki" or "doki"
}

BasePlugin holds the common fields for all plugins

func (*BasePlugin) GetActivationKey

func (p *BasePlugin) GetActivationKey() (tcell.Key, rune, tcell.ModMask)

func (*BasePlugin) GetBackground

func (p *BasePlugin) GetBackground() tcell.Color

func (*BasePlugin) GetConfigIndex

func (p *BasePlugin) GetConfigIndex() int

func (*BasePlugin) GetFilePath

func (p *BasePlugin) GetFilePath() string

func (*BasePlugin) GetForeground

func (p *BasePlugin) GetForeground() tcell.Color

func (*BasePlugin) GetName

func (p *BasePlugin) GetName() string

func (*BasePlugin) GetType

func (p *BasePlugin) GetType() string

type DokiPlugin

type DokiPlugin struct {
	BasePlugin
	Fetcher string // "file" or "internal"
	Text    string // content text (for internal)
	URL     string // resource URL (for file)
}

DokiPlugin is a documentation-based plugin

type PaneAction added in v0.0.4

type PaneAction struct {
	Ops []PaneActionOp
}

PaneAction represents parsed pane actions.

func ParsePaneAction added in v0.0.4

func ParsePaneAction(input string) (PaneAction, error)

ParsePaneAction parses a pane action string into operations.

type PaneActionOp added in v0.0.4

type PaneActionOp struct {
	Field    ActionField
	Operator ActionOperator
	StrValue string
	IntValue int
	Tags     []string
}

PaneActionOp represents a single action operation.

type Plugin

type Plugin interface {
	GetName() string
	GetActivationKey() (tcell.Key, rune, tcell.ModMask)
	GetForeground() tcell.Color
	GetBackground() tcell.Color
	GetFilePath() string
	GetConfigIndex() int
	GetType() string
}

Plugin interface defines the common methods for all plugins

func LoadPlugins

func LoadPlugins() ([]Plugin, error)

LoadPlugins loads all plugins: embedded defaults (Recent, Roadmap) plus configured plugins from config.yaml Configured plugins with the same name as embedded plugins will be merged (configured fields override embedded)

type PluginPaneConfig added in v0.0.4

type PluginPaneConfig struct {
	Name    string `yaml:"name" mapstructure:"name"`
	Columns int    `yaml:"columns" mapstructure:"columns"`
	Filter  string `yaml:"filter" mapstructure:"filter"`
	Action  string `yaml:"action" mapstructure:"action"`
}

PluginPaneConfig represents a pane in YAML or config definitions.

type PluginRef

type PluginRef struct {
	// File reference (for file-based and hybrid modes)
	File string `mapstructure:"file"`

	// Inline definition fields (for inline and hybrid modes)
	Name       string             `mapstructure:"name"`
	Foreground string             `mapstructure:"foreground"`
	Background string             `mapstructure:"background"`
	Key        string             `mapstructure:"key"`
	Filter     string             `mapstructure:"filter"`
	Sort       string             `mapstructure:"sort"`
	View       string             `mapstructure:"view"`
	Type       string             `mapstructure:"type"`
	Fetcher    string             `mapstructure:"fetcher"`
	Text       string             `mapstructure:"text"`
	URL        string             `mapstructure:"url"`
	Panes      []PluginPaneConfig `mapstructure:"panes"`
}

PluginRef is the entry in config.yaml that references a plugin file or defines it inline

type SortRule

type SortRule struct {
	Field      string // "Assignee", "Points", "Priority", "CreatedAt", "UpdatedAt", "Status", "Type", "Title"
	Descending bool   // true for DESC, false for ASC (default)
}

SortRule represents a single sort criterion

func ParseSort

func ParseSort(expr string) ([]SortRule, error)

ParseSort parses a sort expression like "Assignee, Points DESC, Priority DESC, CreatedAt"

type TikiPane added in v0.0.4

type TikiPane struct {
	Name    string
	Columns int
	Filter  filter.FilterExpr
	Action  PaneAction
}

TikiPane represents a parsed pane definition.

type TikiPlugin

type TikiPlugin struct {
	BasePlugin
	Panes    []TikiPane // pane definitions for this plugin
	Sort     []SortRule // parsed sort rules (nil = default sort)
	ViewMode string     // default view mode: "compact" or "expanded" (empty = compact)
}

TikiPlugin is a task-based plugin (like default Kanban board)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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