controller

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPluginNameFromAction

func GetPluginNameFromAction(id ActionID) string

GetPluginNameFromAction extracts the plugin name from a plugin action ID. Returns empty string if the action is not a plugin action.

func InitPluginActions

func InitPluginActions(plugins []PluginInfo)

InitPluginActions creates the plugin action registry from loaded plugins. Called once during app initialization after plugins are loaded.

Types

type Action

type Action struct {
	ID           ActionID
	Key          tcell.Key
	Rune         rune // for letter keys (when Key == tcell.KeyRune)
	Label        string
	Modifier     tcell.ModMask
	ShowInHeader bool // whether to display in header bar
}

Action represents a keyboard shortcut binding

type ActionID

type ActionID string

ActionID identifies a specific action

const (
	ActionBack           ActionID = "back"
	ActionQuit           ActionID = "quit"
	ActionRefresh        ActionID = "refresh"
	ActionToggleViewMode ActionID = "toggle_view_mode"
	ActionToggleHeader   ActionID = "toggle_header"
)

ActionID values for global actions (available in all views).

const (
	ActionMoveTaskLeft  ActionID = "move_task_left"
	ActionMoveTaskRight ActionID = "move_task_right"
	ActionNewTask       ActionID = "new_task"
	ActionDeleteTask    ActionID = "delete_task"
	ActionNavLeft       ActionID = "nav_left"
	ActionNavRight      ActionID = "nav_right"
	ActionNavUp         ActionID = "nav_up"
	ActionNavDown       ActionID = "nav_down"
)

ActionID values for task navigation and manipulation (used by plugins).

const (
	ActionEditTitle  ActionID = "edit_title"
	ActionEditSource ActionID = "edit_source"
	ActionEditDesc   ActionID = "edit_desc"
	ActionFullscreen ActionID = "fullscreen"
	ActionCloneTask  ActionID = "clone_task"
	ActionEditDeps   ActionID = "edit_deps"
	ActionEditTags   ActionID = "edit_tags"
	ActionChat       ActionID = "chat"
)

ActionID values for task detail view actions.

const (
	ActionSaveTask   ActionID = "save_task"
	ActionQuickSave  ActionID = "quick_save"
	ActionNextField  ActionID = "next_field"
	ActionPrevField  ActionID = "prev_field"
	ActionNextValue  ActionID = "next_value"  // Navigate to next value in a picker (down arrow)
	ActionPrevValue  ActionID = "prev_value"  // Navigate to previous value in a picker (up arrow)
	ActionClearField ActionID = "clear_field" // Clear the current field value
)

ActionID values for task edit view actions.

const (
	ActionNavigateBack    ActionID = "navigate_back"
	ActionNavigateForward ActionID = "navigate_forward"
)

ActionID values for doki plugin (markdown navigation) actions.

const (
	ActionOpenFromPlugin ActionID = "open_from_plugin"
)

ActionID values for plugin view actions.

const (
	ActionSearch ActionID = "search"
)

ActionID values for search.

type ActionRegistry

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

ActionRegistry holds the available actions for a view. - actions slice preserves registration order (needed for header display) - byKey/byRune maps provide O(1) lookups for keyboard matching

func CommonFieldNavigationActions

func CommonFieldNavigationActions() *ActionRegistry

CommonFieldNavigationActions returns actions available in all field editors (Tab/Shift-Tab navigation)

func DefaultGlobalActions

func DefaultGlobalActions() *ActionRegistry

DefaultGlobalActions returns common actions available in all views

func DepsViewActions added in v0.3.1

func DepsViewActions() *ActionRegistry

DepsViewActions returns the action registry for the dependency editor view.

func DescOnlyEditActions added in v0.3.1

func DescOnlyEditActions() *ActionRegistry

DescOnlyEditActions returns actions for description-only edit mode (no field navigation).

func DokiViewActions

func DokiViewActions() *ActionRegistry

DokiViewActions returns the action registry for doki (documentation) plugin views. Doki views primarily handle navigation through the NavigableMarkdown component.

func GetActionsForField

func GetActionsForField(field model.EditField) *ActionRegistry

GetActionsForField returns the appropriate action registry for the given edit field

func GetPluginActions

func GetPluginActions() *ActionRegistry

GetPluginActions returns the plugin action registry

func NewActionRegistry

func NewActionRegistry() *ActionRegistry

NewActionRegistry creates a new action registry

func PluginViewActions

func PluginViewActions() *ActionRegistry

PluginViewActions returns the canonical action registry for plugin views. Similar to backlog view but without sprint-specific actions.

func ReadonlyTaskDetailViewActions added in v0.3.1

func ReadonlyTaskDetailViewActions() *ActionRegistry

ReadonlyTaskDetailViewActions returns a reduced registry for readonly task detail views. Only fullscreen toggle is available — no editing actions.

func TagsOnlyEditActions added in v0.3.1

func TagsOnlyEditActions() *ActionRegistry

TagsOnlyEditActions returns actions for tags-only edit mode (no field navigation).

func TaskDetailViewActions

func TaskDetailViewActions() *ActionRegistry

TaskDetailViewActions returns the canonical action registry for the task detail view. Single source of truth for both input handling and header display.

func TaskEditAssigneeActions

func TaskEditAssigneeActions() *ActionRegistry

TaskEditAssigneeActions returns actions available when editing the assignee field

func TaskEditDescriptionActions

func TaskEditDescriptionActions() *ActionRegistry

TaskEditDescriptionActions returns actions available when editing the description field

func TaskEditDueActions added in v0.3.1

func TaskEditDueActions() *ActionRegistry

TaskEditDueActions returns actions available when editing the due date field

func TaskEditPointsActions

func TaskEditPointsActions() *ActionRegistry

TaskEditPointsActions returns actions available when editing the story points field

func TaskEditPriorityActions

func TaskEditPriorityActions() *ActionRegistry

TaskEditPriorityActions returns actions available when editing the priority field

func TaskEditRecurrenceActions added in v0.3.1

func TaskEditRecurrenceActions() *ActionRegistry

TaskEditRecurrenceActions returns actions available when editing the recurrence field

func TaskEditStatusActions

func TaskEditStatusActions() *ActionRegistry

TaskEditStatusActions returns actions available when editing the status field

func TaskEditTitleActions

func TaskEditTitleActions() *ActionRegistry

TaskEditTitleActions returns actions available when editing the title field

func TaskEditTypeActions

func TaskEditTypeActions() *ActionRegistry

TaskEditTypeActions returns actions available when editing the type field

func TaskEditViewActions

func TaskEditViewActions() *ActionRegistry

TaskEditViewActions returns the canonical action registry for the task edit view. Separate registry so view/edit modes can diverge while sharing rendering helpers.

func (*ActionRegistry) GetActions

func (r *ActionRegistry) GetActions() []Action

GetActions returns all registered actions

func (*ActionRegistry) GetHeaderActions

func (r *ActionRegistry) GetHeaderActions() []Action

GetHeaderActions returns only actions marked for header display

func (*ActionRegistry) LookupRune added in v0.1.2

func (r *ActionRegistry) LookupRune(ch rune) (Action, bool)

LookupRune returns the action registered for the given rune (with no modifier), if any.

func (*ActionRegistry) Match

func (r *ActionRegistry) Match(event *tcell.EventKey) *Action

Match finds an action matching the given key event using O(1) map lookups.

func (*ActionRegistry) Merge

func (r *ActionRegistry) Merge(other *ActionRegistry)

Merge adds all actions from another registry into this one. Actions from the other registry are appended to preserve order. If there are key conflicts, the other registry's actions take precedence.

func (*ActionRegistry) MergePluginActions

func (r *ActionRegistry) MergePluginActions()

MergePluginActions adds all plugin activation actions to this registry. Called after plugins are loaded to add dynamic plugin keys to view registries.

func (*ActionRegistry) Register

func (r *ActionRegistry) Register(action Action)

Register adds an action to the registry

func (*ActionRegistry) ToHeaderActions added in v0.3.1

func (r *ActionRegistry) ToHeaderActions() []model.HeaderAction

ToHeaderActions converts the registry's header actions to model.HeaderAction slice. This bridges the controller→model boundary without requiring callers to do the mapping.

type AssigneeEditableView

type AssigneeEditableView interface {
	View

	// SetAssigneeSaveHandler sets the callback for when assignee is saved
	SetAssigneeSaveHandler(handler func(string))
}

AssigneeEditableView is a view that supports assignee editing functionality

type DepsController added in v0.3.1

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

DepsController handles the dependency editor plugin view. Unlike PluginController, move logic here updates different tasks depending on the source/target lane pair — sometimes the moved task, sometimes the context task.

func NewDepsController added in v0.3.1

func NewDepsController(
	taskStore store.Store,
	mutationGate *service.TaskMutationGate,
	pluginConfig *model.PluginConfig,
	pluginDef *plugin.TikiPlugin,
	navController *NavigationController,
	statusline *model.StatuslineConfig,
	schema ruki.Schema,
) *DepsController

NewDepsController creates a dependency editor controller.

func (*DepsController) EnsureFirstNonEmptyLaneSelection added in v0.3.1

func (dc *DepsController) EnsureFirstNonEmptyLaneSelection() bool

EnsureFirstNonEmptyLaneSelection delegates to pluginBase with this controller's filter.

func (*DepsController) GetActionRegistry added in v0.3.1

func (pb *DepsController) GetActionRegistry() *ActionRegistry

func (*DepsController) GetFilteredTasksForLane added in v0.3.1

func (dc *DepsController) GetFilteredTasksForLane(lane int) []*task.Task

GetFilteredTasksForLane returns tasks for a given lane of the deps editor. Lane 0 (Blocks): tasks whose dependsOn contains the context task. Lane 1 (All): all tasks minus context task, blocks set, and depends set. Lane 2 (Depends): tasks listed in the context task's dependsOn.

func (*DepsController) GetPluginName added in v0.3.1

func (pb *DepsController) GetPluginName() string

func (*DepsController) HandleAction added in v0.3.1

func (dc *DepsController) HandleAction(actionID ActionID) bool

HandleAction routes actions to the appropriate handler.

func (*DepsController) HandleSearch added in v0.3.1

func (dc *DepsController) HandleSearch(query string)

HandleSearch processes a search query, narrowing visible tasks within each lane.

func (*DepsController) ShowNavigation added in v0.3.1

func (dc *DepsController) ShowNavigation() bool

type DescriptionEditableView

type DescriptionEditableView interface {
	View

	// ShowDescriptionEditor displays the description text area and returns the primitive to focus
	ShowDescriptionEditor() tview.Primitive

	// HideDescriptionEditor hides the description text area
	HideDescriptionEditor()

	// IsDescriptionEditing returns whether the description is currently being edited
	IsDescriptionEditing() bool

	// IsDescriptionTextAreaFocused returns whether the description text area currently has focus
	IsDescriptionTextAreaFocused() bool

	// SetDescriptionSaveHandler sets the callback for when description is saved
	SetDescriptionSaveHandler(handler func(string))

	// SetDescriptionCancelHandler sets the callback for when description editing is cancelled
	SetDescriptionCancelHandler(handler func())

	// SetFocusSetter sets the callback for requesting focus changes
	SetFocusSetter(setter func(p tview.Primitive))
}

DescriptionEditableView is a view that supports description editing functionality

type DokiController

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

DokiController handles doki plugin view actions (documentation/markdown navigation). DokiPlugins are read-only documentation views and don't need task filtering/sorting.

func NewDokiController

func NewDokiController(
	pluginDef *plugin.DokiPlugin,
	navController *NavigationController,
	statusline *model.StatuslineConfig,
) *DokiController

NewDokiController creates a doki controller

func (*DokiController) GetActionRegistry

func (dc *DokiController) GetActionRegistry() *ActionRegistry

GetActionRegistry returns the actions for the doki view

func (*DokiController) GetPluginName

func (dc *DokiController) GetPluginName() string

GetPluginName returns the plugin name

func (*DokiController) HandleAction

func (dc *DokiController) HandleAction(actionID ActionID) bool

HandleAction processes a doki action Note: Most doki actions (Tab, Shift+Tab, Alt+Left, Alt+Right) are handled directly by the NavigableMarkdown component in the view. The controller just needs to return false to allow the view to handle them.

func (*DokiController) HandleSearch

func (dc *DokiController) HandleSearch(query string)

HandleSearch is not applicable for DokiPlugins (documentation views don't have search)

func (*DokiController) ShowNavigation added in v0.3.1

func (dc *DokiController) ShowNavigation() bool

ShowNavigation returns true — doki views show plugin navigation keys.

type DueEditableView added in v0.3.1

type DueEditableView interface {
	View

	// SetDueSaveHandler sets the callback for when due date is saved
	SetDueSaveHandler(handler func(string))
}

DueEditableView is a view that supports due date editing functionality

type FieldFocusableView

type FieldFocusableView interface {
	View

	// SetFocusedField changes the focused field and re-renders
	SetFocusedField(field model.EditField)

	// GetFocusedField returns the currently focused field
	GetFocusedField() model.EditField

	// FocusNextField advances to the next field in edit order
	FocusNextField() bool

	// FocusPrevField moves to the previous field in edit order
	FocusPrevField() bool

	// IsEditFieldFocused returns whether any editable field has tview focus
	IsEditFieldFocused() bool
}

FieldFocusableView is a view that supports field-level focus in edit mode

type FocusSettable added in v0.0.6

type FocusSettable interface {
	SetFocusSetter(setter func(p tview.Primitive))
}

FocusSettable is implemented by views that need focus management for their subcomponents. This is used to wire up tview focus changes when the view needs to transfer focus to different primitives (e.g., edit fields, select lists).

type FullscreenChangeNotifier

type FullscreenChangeNotifier interface {
	// SetFullscreenChangeHandler sets the callback for when fullscreen state changes
	SetFullscreenChangeHandler(handler func(isFullscreen bool))
}

FullscreenChangeNotifier is a view that notifies when fullscreen state changes

type FullscreenView

type FullscreenView interface {
	View

	// EnterFullscreen switches the view into fullscreen mode
	EnterFullscreen()

	// ExitFullscreen returns the view to its normal layout
	ExitFullscreen()

	// IsFullscreen reports whether the view is currently fullscreen
	IsFullscreen() bool
}

FullscreenView is a view that can toggle fullscreen rendering

type InputRouter

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

func NewInputRouter

func NewInputRouter(
	navController *NavigationController,
	taskController *TaskController,
	pluginControllers map[string]PluginControllerInterface,
	taskStore store.Store,
	mutationGate *service.TaskMutationGate,
	statusline *model.StatuslineConfig,
	schema ruki.Schema,
) *InputRouter

NewInputRouter creates an input router

func (*InputRouter) HandleInput

func (ir *InputRouter) HandleInput(event *tcell.EventKey, currentView *ViewEntry) bool

HandleInput processes a key event for the current view and routes it to the appropriate handler. It processes events through multiple handlers in order: 1. Search input (if search is active) 2. Fullscreen escape (Esc key in fullscreen views) 3. Inline editors (title/description editing) 4. Task edit field focus (field navigation) 5. Global actions (Esc, Refresh) 6. View-specific actions (based on current view) Returns true if the event was handled, false otherwise.

func (*InputRouter) SetPluginRegistrar added in v0.3.1

func (ir *InputRouter) SetPluginRegistrar(fn func(name string, cfg *model.PluginConfig, def plugin.Plugin, ctrl PluginControllerInterface))

SetPluginRegistrar sets the callback used to register dynamically created plugins (e.g., the deps editor) with the view factory.

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

NavigationController manages the navigation stack and delegates view creation to RootLayout

func NewNavigationController

func NewNavigationController(app *tview.Application) *NavigationController

NewNavigationController creates a navigation controller

func (nc *NavigationController) CurrentView() *ViewEntry

CurrentView returns the current view entry from the navigation stack

func (nc *NavigationController) CurrentViewID() model.ViewID

CurrentViewID returns the view ID of the current view

func (nc *NavigationController) Depth() int

Depth returns the current stack depth (for testing)

func (nc *NavigationController) GetActiveView() View

GetActiveView returns the currently displayed view (from RootLayout)

func (nc *NavigationController) GetApp() *tview.Application

GetApp returns the tview application

func (nc *NavigationController) HandleBack() bool

HandleBack processes the back/escape action

func (nc *NavigationController) HandleQuit()

HandleQuit stops the application

func (nc *NavigationController) PopView() bool

PopView returns to the previous view

func (nc *NavigationController) PushView(viewID model.ViewID, params map[string]interface{})

PushView navigates to a new view, adding it to the stack

func (nc *NavigationController) ReplaceView(viewID model.ViewID, params map[string]interface{}) bool

ReplaceView replaces the current view with a new one (maintains stack depth)

func (nc *NavigationController) SetActiveViewGetter(getter func() View)

SetActiveViewGetter sets the function to retrieve the currently displayed view

func (nc *NavigationController) SetCommandRunner(runner func(name string, args ...string) error)

SetCommandRunner overrides the default command runner (useful for tests).

func (nc *NavigationController) SetEditorOpener(opener func(string) error)

SetEditorOpener overrides the default editor opener (useful for tests).

func (nc *NavigationController) SetOnViewChanged(callback func(viewID model.ViewID, params map[string]interface{}))

SetOnViewChanged registers a callback that runs when the view changes (for layoutModel sync)

func (nc *NavigationController) SuspendAndEdit(filePath string)

SuspendAndEdit suspends the tview application and opens the specified file in the user's default editor. After the editor exits, the application resumes and redraws.

func (nc *NavigationController) SuspendAndRun(name string, args ...string)

SuspendAndRun suspends the tview application and runs the specified command. The command runs with stdin/stdout/stderr connected to the terminal. After the command exits, the application resumes and redraws.

type NavigationProvider interface {
	ShowNavigation() bool
}

NavigationProvider is implemented by views that declare whether plugin navigation keys should be shown in the header when this view is active.

type PluginController

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

PluginController handles plugin view actions: navigation, open, create, delete.

func NewPluginController

func NewPluginController(
	taskStore store.Store,
	mutationGate *service.TaskMutationGate,
	pluginConfig *model.PluginConfig,
	pluginDef *plugin.TikiPlugin,
	navController *NavigationController,
	statusline *model.StatuslineConfig,
	schema ruki.Schema,
) *PluginController

NewPluginController creates a plugin controller

func (*PluginController) EnsureFirstNonEmptyLaneSelection added in v0.1.2

func (pc *PluginController) EnsureFirstNonEmptyLaneSelection() bool

EnsureFirstNonEmptyLaneSelection delegates to pluginBase with this controller's filter.

func (*PluginController) GetActionRegistry

func (pb *PluginController) GetActionRegistry() *ActionRegistry

func (*PluginController) GetFilteredTasksForLane added in v0.1.2

func (pc *PluginController) GetFilteredTasksForLane(lane int) []*task.Task

GetFilteredTasksForLane returns tasks filtered and sorted for a specific lane.

func (*PluginController) GetPluginName

func (pb *PluginController) GetPluginName() string

func (*PluginController) HandleAction

func (pc *PluginController) HandleAction(actionID ActionID) bool

HandleAction processes a plugin action

func (*PluginController) HandleSearch

func (pc *PluginController) HandleSearch(query string)

HandleSearch processes a search query for the plugin view

func (*PluginController) ShowNavigation added in v0.3.1

func (pc *PluginController) ShowNavigation() bool

ShowNavigation returns true — regular plugin views show plugin navigation keys.

type PluginControllerInterface

type PluginControllerInterface interface {
	GetActionRegistry() *ActionRegistry
	GetPluginName() string
	HandleAction(ActionID) bool
	HandleSearch(string)
	ShowNavigation() bool
}

PluginControllerInterface defines the common interface for all plugin controllers

type PluginInfo

type PluginInfo struct {
	Name     string
	Key      tcell.Key
	Rune     rune
	Modifier tcell.ModMask
}

PluginInfo provides the minimal info needed to register plugin actions. Avoids import cycle between controller and plugin packages.

type PointsEditableView

type PointsEditableView interface {
	View

	// SetPointsSaveHandler sets the callback for when story points is saved
	SetPointsSaveHandler(handler func(int))
}

PointsEditableView is a view that supports story points editing functionality

type PriorityEditableView

type PriorityEditableView interface {
	View

	// SetPrioritySaveHandler sets the callback for when priority is saved
	SetPrioritySaveHandler(handler func(int))
}

PriorityEditableView is a view that supports priority editing functionality

type RecurrenceEditableView added in v0.3.1

type RecurrenceEditableView interface {
	View

	// SetRecurrenceSaveHandler sets the callback for when recurrence is saved
	SetRecurrenceSaveHandler(handler func(string))
}

RecurrenceEditableView is a view that supports recurrence editing functionality

type RecurrencePartNavigable added in v0.3.1

type RecurrencePartNavigable interface {
	MoveRecurrencePartLeft() bool
	MoveRecurrencePartRight() bool
	IsRecurrenceValueFocused() bool
}

RecurrencePartNavigable is a view that supports Left/Right navigation between the two logical parts of a recurrence field (frequency and value).

type SearchableView

type SearchableView interface {
	View

	// ShowSearch displays the search box and returns the primitive to focus
	ShowSearch() tview.Primitive

	// HideSearch hides the search box
	HideSearch()

	// IsSearchVisible returns whether the search box is currently visible
	IsSearchVisible() bool

	// IsSearchBoxFocused returns whether the search box currently has focus
	IsSearchBoxFocused() bool

	// SetSearchSubmitHandler sets the callback for when search is submitted
	SetSearchSubmitHandler(handler func(text string))

	// SetFocusSetter sets the callback for requesting focus changes
	SetFocusSetter(setter func(p tview.Primitive))
}

SearchableView is a view that supports search functionality

type SelectableView

type SelectableView interface {
	View

	// GetSelectedID returns the ID of the currently selected item
	GetSelectedID() string

	// SetSelectedID sets the selection to a specific item
	SetSelectedID(id string)
}

SelectableView is a view that tracks selection state

type StatsProvider

type StatsProvider interface {
	// GetStats returns stats to display in the statusline for this view
	GetStats() []store.Stat
}

StatsProvider is a view that provides statistics for the statusline

type StatusEditableView

type StatusEditableView interface {
	View

	// SetStatusSaveHandler sets the callback for when status is saved
	SetStatusSaveHandler(handler func(string))
}

StatusEditableView is a view that supports status editing functionality

type TagsEditableView added in v0.3.1

type TagsEditableView interface {
	View

	// ShowTagsEditor displays the tags text area and returns the primitive to focus
	ShowTagsEditor() tview.Primitive

	// SetTagsSaveHandler sets the callback for when tags are saved
	SetTagsSaveHandler(handler func(string))

	// SetTagsCancelHandler sets the callback for when tags editing is cancelled
	SetTagsCancelHandler(handler func())
}

TagsEditableView is a view that supports tags editing functionality

type TaskController

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

TaskController handles task detail view actions

func NewTaskController

func NewTaskController(
	taskStore store.Store,
	mutationGate *service.TaskMutationGate,
	navController *NavigationController,
	statusline *model.StatuslineConfig,
) *TaskController

NewTaskController creates a new TaskController for managing task detail operations. It initializes action registries for both detail and edit views.

func (*TaskController) AddComment

func (tc *TaskController) AddComment(author, text string) bool

AddComment adds a new comment to the current task with the specified author and text. Returns false if no task is currently active, true if the comment was added successfully.

func (*TaskController) CancelEditSession

func (tc *TaskController) CancelEditSession()

CancelEditSession discards the editing copy without saving changes. This clears the in-memory editing task and resets the current task ID.

func (*TaskController) ClearDraft

func (tc *TaskController) ClearDraft()

ClearDraft removes any in-progress draft task.

func (*TaskController) CommitEditSession

func (tc *TaskController) CommitEditSession() error

CommitEditSession validates and persists changes from the current edit session. For draft tasks (new task creation), it validates, sets timestamps, and creates the file. For existing tasks, it checks for external modifications and updates the task in the store. Returns an error if validation fails or the task cannot be saved.

func (*TaskController) GetActionRegistry

func (tc *TaskController) GetActionRegistry() *ActionRegistry

GetActionRegistry returns the actions for the task detail view

func (*TaskController) GetCurrentTask

func (tc *TaskController) GetCurrentTask() *taskpkg.Task

GetCurrentTask returns the task being viewed or edited. Returns nil if no task is currently active.

func (*TaskController) GetCurrentTaskID

func (tc *TaskController) GetCurrentTaskID() string

GetCurrentTaskID returns the ID of the current task

func (*TaskController) GetDraftTask

func (tc *TaskController) GetDraftTask() *taskpkg.Task

GetDraftTask returns the draft task being created (or nil if not creating)

func (*TaskController) GetEditActionRegistry

func (tc *TaskController) GetEditActionRegistry() *ActionRegistry

GetEditActionRegistry returns the actions for the task edit view

func (*TaskController) GetEditingTask

func (tc *TaskController) GetEditingTask() *taskpkg.Task

GetEditingTask returns the task being edited (or nil if not editing)

func (*TaskController) GetFocusedField

func (tc *TaskController) GetFocusedField() model.EditField

GetFocusedField returns the currently focused field in edit mode

func (*TaskController) HandleAction

func (tc *TaskController) HandleAction(actionID ActionID) bool

HandleAction processes task detail view actions such as editing title or source. Returns true if the action was handled, false otherwise.

func (*TaskController) SaveAssignee

func (tc *TaskController) SaveAssignee(assignee string) bool

SaveAssignee saves the new assignee to the current task. The special value "Unassigned" is normalized to an empty string. Returns true if the assignee was successfully updated, false otherwise.

func (*TaskController) SaveDescription

func (tc *TaskController) SaveDescription(newDescription string) bool

SaveDescription saves the new description to the current task (draft or editing). For draft tasks (new task creation), updates the draft; for editing tasks, updates the editing copy. Returns true if a task was updated, false if no task is being edited.

func (*TaskController) SaveDue added in v0.3.1

func (tc *TaskController) SaveDue(dateStr string) bool

SaveDue saves the new due date to the current task. Empty string clears the due date (sets to zero time). Returns true if the due date was successfully updated, false otherwise.

func (*TaskController) SavePoints

func (tc *TaskController) SavePoints(points int) bool

SavePoints saves the new story points to the current task. Returns true if the points were successfully updated, false otherwise.

func (*TaskController) SavePriority

func (tc *TaskController) SavePriority(priority int) bool

SavePriority saves the new priority to the current task. Returns true if the priority was successfully updated, false otherwise.

func (*TaskController) SaveRecurrence added in v0.3.1

func (tc *TaskController) SaveRecurrence(cron string) bool

SaveRecurrence saves the new recurrence cron expression to the current task. When recurrence is set, Due is auto-computed as the next occurrence. When recurrence is cleared, Due is also cleared. Returns true if the recurrence was successfully updated, false otherwise.

func (*TaskController) SaveStatus

func (tc *TaskController) SaveStatus(statusDisplay string) bool

SaveStatus saves the new status to the current task after validating the display value. Returns true if the status was successfully updated, false otherwise.

func (*TaskController) SaveTags added in v0.3.1

func (tc *TaskController) SaveTags(tags []string) bool

SaveTags saves the new tags to the current task (draft or editing). Returns true if a task was updated, false if no task is being edited.

func (*TaskController) SaveTitle

func (tc *TaskController) SaveTitle(newTitle string) bool

SaveTitle saves the new title to the current task (draft or editing). For draft tasks (new task creation), updates the draft; for editing tasks, updates the editing copy. Returns true if a task was updated, false if no task is being edited.

func (*TaskController) SaveType

func (tc *TaskController) SaveType(typeDisplay string) bool

SaveType saves the new type to the current task after validating the display value. Returns true if the type was successfully updated, false otherwise.

func (*TaskController) SetCurrentTask

func (tc *TaskController) SetCurrentTask(taskID string)

SetCurrentTask sets the task ID for the currently viewed or edited task.

func (*TaskController) SetDraft

func (tc *TaskController) SetDraft(task *taskpkg.Task)

SetDraft sets a draft task for creation flow (not yet persisted).

func (*TaskController) SetFocusedField

func (tc *TaskController) SetFocusedField(field model.EditField)

SetFocusedField sets the currently focused field in edit mode

func (*TaskController) StartEditSession

func (tc *TaskController) StartEditSession(taskID string) *taskpkg.Task

StartEditSession creates an in-memory copy of the specified task for editing. It loads the task from the store and records its modification time for optimistic locking. Returns the editing copy, or nil if the task cannot be found.

func (*TaskController) UpdateTask

func (tc *TaskController) UpdateTask(task *taskpkg.Task)

UpdateTask persists changes to the specified task via the mutation gate.

type TaskEditCoordinator

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

TaskEditCoordinator owns task edit lifecycle: preparing the view, wiring handlers, and implementing commit/cancel and field navigation policy.

func NewTaskEditCoordinator

func NewTaskEditCoordinator(navController *NavigationController, taskController *TaskController) *TaskEditCoordinator

func (*TaskEditCoordinator) CancelAndClose

func (c *TaskEditCoordinator) CancelAndClose() bool

func (*TaskEditCoordinator) CommitAndClose

func (c *TaskEditCoordinator) CommitAndClose(activeView View) bool

func (*TaskEditCoordinator) CommitNoClose

func (c *TaskEditCoordinator) CommitNoClose(activeView View) bool

func (*TaskEditCoordinator) CycleFieldValueDown

func (c *TaskEditCoordinator) CycleFieldValueDown(activeView View) bool

func (*TaskEditCoordinator) CycleFieldValueUp

func (c *TaskEditCoordinator) CycleFieldValueUp(activeView View) bool

func (*TaskEditCoordinator) FocusNextField

func (c *TaskEditCoordinator) FocusNextField(activeView View) bool

func (*TaskEditCoordinator) FocusPrevField

func (c *TaskEditCoordinator) FocusPrevField(activeView View) bool

func (*TaskEditCoordinator) HandleKey

func (c *TaskEditCoordinator) HandleKey(activeView View, event *tcell.EventKey) bool

func (*TaskEditCoordinator) Prepare

func (c *TaskEditCoordinator) Prepare(activeView View, params model.TaskEditParams)

Prepare wires handlers and starts an edit session for the provided view instance. It is safe to call repeatedly; preparation is cached per active view instance.

type TaskEditView

type TaskEditView interface {
	View

	// GetEditedTitle returns the current title text in the editor
	GetEditedTitle() string

	// GetEditedDescription returns the current description text in the editor
	GetEditedDescription() string

	// GetEditedTags returns the current tags from the tags editor
	GetEditedTags() []string
}

TaskEditView exposes edited task fields for save operations

type TikiViewProvider added in v0.3.1

type TikiViewProvider interface {
	GetFilteredTasksForLane(lane int) []*task.Task
	EnsureFirstNonEmptyLaneSelection() bool
	GetActionRegistry() *ActionRegistry
	ShowNavigation() bool
}

TikiViewProvider is implemented by controllers that back a TikiPlugin view. The view factory uses this to create PluginView without knowing the concrete controller type.

type TitleEditableView

type TitleEditableView interface {
	View

	// ShowTitleEditor displays the title input field and returns the primitive to focus
	ShowTitleEditor() tview.Primitive

	// HideTitleEditor hides the title input field
	HideTitleEditor()

	// IsTitleEditing returns whether the title is currently being edited
	IsTitleEditing() bool

	// IsTitleInputFocused returns whether the title input currently has focus
	IsTitleInputFocused() bool

	// SetTitleSaveHandler sets the callback for when title is saved (explicit save via Enter)
	SetTitleSaveHandler(handler func(string))

	// SetTitleChangeHandler sets the callback for when title changes (auto-save on keystroke)
	SetTitleChangeHandler(handler func(string))

	// SetTitleCancelHandler sets the callback for when title editing is cancelled
	SetTitleCancelHandler(handler func())

	// SetFocusSetter sets the callback for requesting focus changes
	SetFocusSetter(setter func(p tview.Primitive))
}

TitleEditableView is a view that supports title editing functionality

type TypeEditableView

type TypeEditableView interface {
	View

	// SetTypeSaveHandler sets the callback for when type is saved
	SetTypeSaveHandler(handler func(string))
}

TypeEditableView is a view that supports type editing functionality

type ValueCyclableView

type ValueCyclableView interface {
	View

	// CycleFieldValueUp cycles the currently focused field's value upward
	CycleFieldValueUp() bool

	// CycleFieldValueDown cycles the currently focused field's value downward
	CycleFieldValueDown() bool
}

ValueCyclableView is a view that supports cycling through field values with arrow keys

type View

type View interface {
	// GetPrimitive returns the tview primitive for this view
	GetPrimitive() tview.Primitive

	// GetActionRegistry returns the actions available in this view
	GetActionRegistry() *ActionRegistry

	// GetViewID returns the identifier for this view type
	GetViewID() model.ViewID

	// OnFocus is called when the view becomes active
	OnFocus()

	// OnBlur is called when the view becomes inactive
	OnBlur()
}

View represents a renderable view with its action registry

type ViewEntry

type ViewEntry struct {
	ViewID model.ViewID
	Params map[string]interface{}
}

ViewEntry represents a view on the navigation stack with optional parameters

type ViewFactory

type ViewFactory interface {
	// CreateView instantiates a view by ID with optional parameters
	CreateView(viewID model.ViewID, params map[string]interface{}) View
}

ViewFactory creates views on demand

type ViewInfoProvider added in v0.3.1

type ViewInfoProvider interface {
	GetViewName() string
	GetViewDescription() string
}

ViewInfoProvider is a view that provides its name and description for the header info section

Jump to

Keyboard shortcuts

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