depseditor

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package depseditor provides an interactive TUI for viewing and editing task dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasCycle

func HasCycle(tasks []*pm.Task) bool

HasCycle returns true if the dependency graph formed by the tasks contains a cycle. It uses DFS with a three-state color marking (unvisited / in-stack / done).

func PlanHasCycle

func PlanHasCycle(plan *pm.Plan) bool

PlanHasCycle reports whether the plan's current dependency graph has any cycle.

func WouldCreateCycle

func WouldCreateCycle(plan *pm.Plan, taskID, newDepID int) bool

WouldCreateCycle reports whether adding newDepID to the DependsOn list of taskID would introduce a cycle in the plan's dependency graph.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the bubbletea model for the interactive dependency editor.

func New

func New(plan *pm.Plan, targetID int) (*Model, error)

New creates a Model for editing the dependencies of the task identified by targetID.

func (Model) Cancelled

func (m Model) Cancelled() bool

Cancelled reports whether the user pressed Escape/q to abort.

func (Model) Confirmed

func (m Model) Confirmed() bool

Confirmed reports whether the user pressed Enter to save changes.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Result

func (m Model) Result() []int

Result returns the updated dependency ID list to persist on confirmation.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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