taskdetail

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderAssigneeText

func RenderAssigneeText(task *taskpkg.Task, ctx FieldRenderContext) tview.Primitive

RenderAssigneeText renders an assignee field as read-only text

func RenderAuthorText added in v0.3.1

func RenderAuthorText(task *taskpkg.Task, colors *config.ColorConfig) tview.Primitive

RenderAuthorText renders the author field as read-only text

func RenderBlocksColumn added in v0.3.1

func RenderBlocksColumn(blocked []*taskpkg.Task) tview.Primitive

RenderBlocksColumn renders the "Blocks" column showing downstream dependents. Returns nil when blocked is empty, so the caller can skip adding it.

func RenderCreatedText added in v0.3.1

func RenderCreatedText(task *taskpkg.Task, colors *config.ColorConfig) tview.Primitive

RenderCreatedText renders the created-at field as read-only text

func RenderDependsOnColumn added in v0.3.1

func RenderDependsOnColumn(task *taskpkg.Task, taskStore store.Store) tview.Primitive

RenderDependsOnColumn renders the "Depends On" column showing upstream dependencies. Returns nil when the task has no dependencies, so the caller can skip adding it.

func RenderDueText added in v0.3.1

func RenderDueText(task *taskpkg.Task, colors *config.ColorConfig) tview.Primitive

RenderDueText renders the due date field

func RenderPointsText

func RenderPointsText(task *taskpkg.Task, ctx FieldRenderContext) tview.Primitive

RenderPointsText renders a points field as read-only text

func RenderPriorityText

func RenderPriorityText(task *taskpkg.Task, ctx FieldRenderContext) tview.Primitive

RenderPriorityText renders a priority field as read-only text

func RenderRecurrenceText added in v0.3.1

func RenderRecurrenceText(task *taskpkg.Task, colors *config.ColorConfig) tview.Primitive

RenderRecurrenceText renders the recurrence field

func RenderStatusText

func RenderStatusText(task *taskpkg.Task, ctx FieldRenderContext) tview.Primitive

RenderStatusText renders a status field as read-only text

func RenderTagsColumn

func RenderTagsColumn(task *taskpkg.Task) tview.Primitive

RenderTagsColumn renders the tags column with a label row on top.

func RenderTitleText

func RenderTitleText(task *taskpkg.Task, ctx FieldRenderContext) tview.Primitive

RenderTitleText renders a title as read-only text

func RenderTypeText

func RenderTypeText(task *taskpkg.Task, ctx FieldRenderContext) tview.Primitive

RenderTypeText renders a type field as read-only text

func RenderUpdatedText added in v0.3.1

func RenderUpdatedText(task *taskpkg.Task, colors *config.ColorConfig) tview.Primitive

RenderUpdatedText renders the updated-at field as read-only text

Types

type Base

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

Base contains shared state and methods for task detail/edit views. Both TaskDetailView and TaskEditView embed this struct to share common functionality.

func (*Base) GetPrimitive

func (b *Base) GetPrimitive() tview.Primitive

GetPrimitive returns the root tview primitive

func (*Base) GetTask

func (b *Base) GetTask() *taskpkg.Task

GetTask returns the task from the store or the fallback task

func (*Base) IsFullscreen

func (b *Base) IsFullscreen() bool

IsFullscreen reports whether the view is currently in fullscreen mode

func (*Base) SetFallbackTask

func (b *Base) SetFallbackTask(task *taskpkg.Task)

SetFallbackTask sets a task to render when it does not yet exist in the store (draft mode)

func (*Base) SetFocusSetter

func (b *Base) SetFocusSetter(setter func(tview.Primitive))

SetFocusSetter sets the callback for requesting focus changes

func (*Base) SetFullscreenChangeHandler

func (b *Base) SetFullscreenChangeHandler(handler func(isFullscreen bool))

SetFullscreenChangeHandler sets the callback for when fullscreen state changes

func (*Base) SetTaskController

func (b *Base) SetTaskController(tc *controller.TaskController)

SetTaskController sets the task controller for edit session management

type FieldRenderContext

type FieldRenderContext struct {
	Mode         RenderMode
	FocusedField model.EditField
	Colors       *config.ColorConfig
}

FieldRenderContext provides context for rendering field primitives

type LayoutPlan added in v0.3.1

type LayoutPlan struct {
	Sections []PlannedSection
	Gaps     []int // len = len(Sections) - 1; gap[i] is between Sections[i] and Sections[i+1]
}

LayoutPlan is the output of the layout algorithm.

func CalculateMetadataLayout added in v0.3.1

func CalculateMetadataLayout(availableWidth int, sections []SectionInput) LayoutPlan

CalculateMetadataLayout computes which sections to show and how to distribute horizontal space among them.

Algorithm:

  1. Include only sections that have content.
  2. Check whether all included sections + 1-char minimum gaps fit.
  3. If not, hide right-side sections in order: Tags → Blocks → DependsOn.
  4. Distribute remaining free space evenly across gaps.
  5. Any remainder goes to the "bridge gap" (between last left-side and first right-side section). If no right-side sections remain, remainder goes to the last gap.

type PlannedSection added in v0.3.1

type PlannedSection struct {
	ID    SectionID
	Width int
}

PlannedSection is a section that made it into the final layout.

type RenderMode

type RenderMode int

RenderMode indicates whether we're rendering for view or edit mode

const (
	RenderModeView RenderMode = iota
	RenderModeEdit
)

type SectionID added in v0.3.1

type SectionID int

SectionID identifies a metadata section in left-to-right display order.

const (
	SectionStatusGroup SectionID = iota // status, type, priority, points
	SectionPeopleGroup                  // assignee, author, created, updated
	SectionDueGroup                     // due, recurrence
	SectionTags
	SectionDependsOn
	SectionBlocks
)

type SectionInput added in v0.3.1

type SectionInput struct {
	ID         SectionID
	Width      int  // minimum width this section needs
	HasContent bool // false = skip entirely (optional section with no data)
}

SectionInput describes one candidate section for the layout.

func BuildSectionInputs added in v0.3.1

func BuildSectionInputs(task *taskpkg.Task, hasBlocks bool) []SectionInput

BuildSectionInputs creates the standard section input list for a task, using the constants from config/dimensions.go.

type TaskDetailView

type TaskDetailView struct {
	Base // Embed shared state
	// contains filtered or unexported fields
}

TaskDetailView renders a full task with all details in read-only mode.

func NewTaskDetailView

func NewTaskDetailView(taskStore store.Store, taskID string, readOnly bool, imageManager *navtview.ImageManager, mermaidOpts *nav.MermaidOptions) *TaskDetailView

NewTaskDetailView creates a task detail view. When readOnly is true, only fullscreen is available — no editing actions.

func (*TaskDetailView) EnterFullscreen

func (tv *TaskDetailView) EnterFullscreen()

EnterFullscreen switches the view to fullscreen mode (description only)

func (*TaskDetailView) ExitFullscreen

func (tv *TaskDetailView) ExitFullscreen()

ExitFullscreen restores the regular task detail layout

func (*TaskDetailView) GetActionRegistry

func (tv *TaskDetailView) GetActionRegistry() *controller.ActionRegistry

GetActionRegistry returns the view's action registry

func (*TaskDetailView) GetViewDescription added in v0.3.1

func (tv *TaskDetailView) GetViewDescription() string

GetViewDescription returns the view description for the header info section

func (*TaskDetailView) GetViewID

func (tv *TaskDetailView) GetViewID() model.ViewID

GetViewID returns the view identifier

func (*TaskDetailView) GetViewName added in v0.3.1

func (tv *TaskDetailView) GetViewName() string

GetViewName returns the view name for the header info section

func (*TaskDetailView) OnBlur

func (tv *TaskDetailView) OnBlur()

OnBlur is called when the view becomes inactive

func (*TaskDetailView) OnFocus

func (tv *TaskDetailView) OnFocus()

OnFocus is called when the view becomes active

type TaskEditView

type TaskEditView struct {
	Base // Embed shared state
	// contains filtered or unexported fields
}

TaskEditView renders a task in full edit mode with all fields editable.

func NewTaskEditView

func NewTaskEditView(taskStore store.Store, taskID string, imageManager *navtview.ImageManager) *TaskEditView

NewTaskEditView creates a task edit view

func (*TaskEditView) CycleFieldValueDown

func (ev *TaskEditView) CycleFieldValueDown() bool

CycleFieldValueDown cycles the currently focused field's value downward (next)

func (*TaskEditView) CycleFieldValueUp

func (ev *TaskEditView) CycleFieldValueUp() bool

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

func (*TaskEditView) EnterFullscreen

func (ev *TaskEditView) EnterFullscreen()

EnterFullscreen switches the view to fullscreen mode

func (*TaskEditView) ExitFullscreen

func (ev *TaskEditView) ExitFullscreen()

ExitFullscreen restores the regular task detail layout

func (*TaskEditView) FocusNextField

func (ev *TaskEditView) FocusNextField() bool

FocusNextField advances to the next field in edit order

func (*TaskEditView) FocusPrevField

func (ev *TaskEditView) FocusPrevField() bool

FocusPrevField moves to the previous field in edit order

func (*TaskEditView) GetActionRegistry

func (ev *TaskEditView) GetActionRegistry() *controller.ActionRegistry

GetActionRegistry returns the view's action registry

func (*TaskEditView) GetEditedDescription

func (ev *TaskEditView) GetEditedDescription() string

GetEditedDescription returns the current description text in the editor

func (*TaskEditView) GetEditedTags added in v0.3.1

func (ev *TaskEditView) GetEditedTags() []string

GetEditedTags returns the current tags from the tags editor, split by whitespace.

func (*TaskEditView) GetEditedTitle

func (ev *TaskEditView) GetEditedTitle() string

GetEditedTitle returns the current title in the editor

func (*TaskEditView) GetFocusedField

func (ev *TaskEditView) GetFocusedField() model.EditField

GetFocusedField returns the currently focused field

func (*TaskEditView) GetTask

func (ev *TaskEditView) GetTask() *taskpkg.Task

GetTask returns the appropriate task based on mode (prioritizes editing copy)

func (*TaskEditView) GetViewDescription added in v0.3.1

func (ev *TaskEditView) GetViewDescription() string

GetViewDescription returns the view description for the header info section

func (*TaskEditView) GetViewID

func (ev *TaskEditView) GetViewID() model.ViewID

GetViewID returns the view identifier

func (*TaskEditView) GetViewName added in v0.3.1

func (ev *TaskEditView) GetViewName() string

GetViewName returns the view name for the header info section

func (*TaskEditView) HideDescriptionEditor

func (ev *TaskEditView) HideDescriptionEditor()

HideDescriptionEditor is a no-op in edit mode

func (*TaskEditView) HideTitleEditor

func (ev *TaskEditView) HideTitleEditor()

HideTitleEditor is a no-op in edit mode (title always visible)

func (*TaskEditView) IsDescOnly added in v0.3.1

func (ev *TaskEditView) IsDescOnly() bool

IsDescOnly returns whether the view is in description-only edit mode.

func (*TaskEditView) IsDescriptionEditing

func (ev *TaskEditView) IsDescriptionEditing() bool

IsDescriptionEditing returns whether the description is being edited

func (*TaskEditView) IsDescriptionTextAreaFocused

func (ev *TaskEditView) IsDescriptionTextAreaFocused() bool

IsDescriptionTextAreaFocused returns whether the description text area has focus

func (*TaskEditView) IsEditFieldFocused

func (ev *TaskEditView) IsEditFieldFocused() bool

IsEditFieldFocused returns whether any editable field has tview focus

func (*TaskEditView) IsRecurrenceValueFocused added in v0.3.1

func (ev *TaskEditView) IsRecurrenceValueFocused() bool

IsRecurrenceValueFocused returns true when the recurrence field's value part is active.

func (*TaskEditView) IsTagsOnly added in v0.3.1

func (ev *TaskEditView) IsTagsOnly() bool

IsTagsOnly returns whether the view is in tags-only edit mode.

func (*TaskEditView) IsTagsTextAreaFocused added in v0.3.1

func (ev *TaskEditView) IsTagsTextAreaFocused() bool

IsTagsTextAreaFocused returns whether the tags text area currently has focus

func (*TaskEditView) IsTitleEditing

func (ev *TaskEditView) IsTitleEditing() bool

IsTitleEditing returns whether the title is being edited (always true in edit mode)

func (*TaskEditView) IsTitleInputFocused

func (ev *TaskEditView) IsTitleInputFocused() bool

IsTitleInputFocused returns whether the title input has focus

func (*TaskEditView) IsValid

func (ev *TaskEditView) IsValid() bool

IsValid returns true if the task passes all validation checks

func (*TaskEditView) MoveRecurrencePartLeft added in v0.3.1

func (ev *TaskEditView) MoveRecurrencePartLeft() bool

MoveRecurrencePartLeft moves the recurrence editor to the frequency part. Returns true if the recurrence field is focused and the navigation was handled.

func (*TaskEditView) MoveRecurrencePartRight added in v0.3.1

func (ev *TaskEditView) MoveRecurrencePartRight() bool

MoveRecurrencePartRight moves the recurrence editor to the value part. Returns true if the recurrence field is focused and the navigation was handled.

func (*TaskEditView) OnBlur

func (ev *TaskEditView) OnBlur()

OnBlur is called when the view becomes inactive

func (*TaskEditView) OnFocus

func (ev *TaskEditView) OnFocus()

OnFocus is called when the view becomes active

func (*TaskEditView) SetAssigneeSaveHandler

func (ev *TaskEditView) SetAssigneeSaveHandler(handler func(string))

SetAssigneeSaveHandler sets the callback for when assignee is saved

func (*TaskEditView) SetDescOnly added in v0.3.1

func (ev *TaskEditView) SetDescOnly(descOnly bool)

SetDescOnly enables description-only edit mode where metadata is read-only.

func (*TaskEditView) SetDescriptionCancelHandler

func (ev *TaskEditView) SetDescriptionCancelHandler(handler func())

SetDescriptionCancelHandler sets the callback for when description editing is cancelled

func (*TaskEditView) SetDescriptionSaveHandler

func (ev *TaskEditView) SetDescriptionSaveHandler(handler func(string))

SetDescriptionSaveHandler sets the callback for when description is saved

func (*TaskEditView) SetDueSaveHandler added in v0.3.1

func (ev *TaskEditView) SetDueSaveHandler(handler func(string))

SetDueSaveHandler sets the callback for when due date is saved

func (*TaskEditView) SetFocusedField

func (ev *TaskEditView) SetFocusedField(field model.EditField)

SetFocusedField changes the focused field and re-renders

func (*TaskEditView) SetPointsSaveHandler

func (ev *TaskEditView) SetPointsSaveHandler(handler func(int))

SetPointsSaveHandler sets the callback for when story points is saved

func (*TaskEditView) SetPrioritySaveHandler

func (ev *TaskEditView) SetPrioritySaveHandler(handler func(int))

SetPrioritySaveHandler sets the callback for when priority is saved

func (*TaskEditView) SetRecurrenceSaveHandler added in v0.3.1

func (ev *TaskEditView) SetRecurrenceSaveHandler(handler func(string))

SetRecurrenceSaveHandler sets the callback for when recurrence is saved

func (*TaskEditView) SetStatusSaveHandler

func (ev *TaskEditView) SetStatusSaveHandler(handler func(string))

SetStatusSaveHandler sets the callback for when status is saved

func (*TaskEditView) SetTagsCancelHandler added in v0.3.1

func (ev *TaskEditView) SetTagsCancelHandler(handler func())

SetTagsCancelHandler sets the callback for when tags editing is cancelled

func (*TaskEditView) SetTagsOnly added in v0.3.1

func (ev *TaskEditView) SetTagsOnly(tagsOnly bool)

SetTagsOnly enables tags-only edit mode where metadata is read-only and the description area is replaced with a tags textarea.

func (*TaskEditView) SetTagsSaveHandler added in v0.3.1

func (ev *TaskEditView) SetTagsSaveHandler(handler func(string))

SetTagsSaveHandler sets the callback for when tags are saved

func (*TaskEditView) SetTitleCancelHandler

func (ev *TaskEditView) SetTitleCancelHandler(handler func())

SetTitleCancelHandler sets the callback for when title editing is cancelled

func (*TaskEditView) SetTitleChangeHandler

func (ev *TaskEditView) SetTitleChangeHandler(handler func(string))

SetTitleChangeHandler sets the callback for when title changes

func (*TaskEditView) SetTitleSaveHandler

func (ev *TaskEditView) SetTitleSaveHandler(handler func(string))

SetTitleSaveHandler sets the callback for when title is saved

func (*TaskEditView) SetTypeSaveHandler

func (ev *TaskEditView) SetTypeSaveHandler(handler func(string))

SetTypeSaveHandler sets the callback for when type is saved

func (*TaskEditView) ShowDescriptionEditor

func (ev *TaskEditView) ShowDescriptionEditor() tview.Primitive

ShowDescriptionEditor displays the description text area

func (*TaskEditView) ShowTagsEditor added in v0.3.1

func (ev *TaskEditView) ShowTagsEditor() tview.Primitive

ShowTagsEditor displays the tags text area and returns the primitive to focus

func (*TaskEditView) ShowTitleEditor

func (ev *TaskEditView) ShowTitleEditor() tview.Primitive

ShowTitleEditor displays the title input field

func (*TaskEditView) UpdateHeaderForField

func (ev *TaskEditView) UpdateHeaderForField(field model.EditField)

UpdateHeaderForField updates the registry with field-specific actions

func (*TaskEditView) ValidationErrors added in v0.4.0

func (ev *TaskEditView) ValidationErrors() []string

ValidationErrors returns the current list of validation error messages.

Jump to

Keyboard shortcuts

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