controller

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 15 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"
	ActionFullscreen ActionID = "fullscreen"
	ActionCloneTask  ActionID = "clone_task"
)

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)
)

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. Uses a space-time tradeoff: stores actions in 3 places for different purposes: - actions slice preserves registration order (needed for header display) - byKey/byRune maps provide O(1) lookups for keyboard matching (vs O(n) linear search)

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 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 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 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 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, if any.

func (*ActionRegistry) Match

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

Match finds an action matching the given key event

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

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 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,
) *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)

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,
) *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.

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) 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.

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,
	pluginConfig *model.PluginConfig,
	pluginDef *plugin.TikiPlugin,
	navController *NavigationController,
) *PluginController

NewPluginController creates a plugin controller

func (*PluginController) EnsureFirstNonEmptyLaneSelection added in v0.1.2

func (pc *PluginController) EnsureFirstNonEmptyLaneSelection() bool

func (*PluginController) GetActionRegistry

func (pc *PluginController) GetActionRegistry() *ActionRegistry

GetActionRegistry returns the actions for the plugin view

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 (pc *PluginController) GetPluginName() string

GetPluginName returns the plugin name

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

type PluginControllerInterface

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

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 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 header for this view
	GetStats() []store.Stat
}

StatsProvider is a view that provides statistics for the header

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 TaskController

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

TaskController handles task detail view actions

func NewTaskController

func NewTaskController(
	taskStore store.Store,
	navController *NavigationController,
) *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) 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) 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) 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 in the store.

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
}

TaskEditView exposes edited task fields for save operations

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

Jump to

Keyboard shortcuts

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