components

package
v0.0.0-...-62e7362 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractValuesFromAssignEvents

func ExtractValuesFromAssignEvents(assignEvents []models.AssignEvent, days int) []int

ExtractValuesFromAssignEvents extracts integer values from assignEvents array Takes the last N days of data

func FormatPersonTime

func FormatPersonTime(tzOffsetMinutes int) string

FormatPersonTime returns a formatted time string with timezone and optional offset e.g., "11:52 pm UTC+08:00 | +7h"

func RenderClipboardMessage

func RenderClipboardMessage(message string) string

RenderClipboardMessage renders a success/info message (typically for clipboard operations) Returns empty string if message is empty

func RenderHelpBar

func RenderHelpBar(hasSelection bool, width int) string

RenderHelpBar renders the help/keyboard shortcuts bar at the bottom Shows different shortcuts depending on whether a card is selected

func RenderPeopleList

func RenderPeopleList(people []models.Person, maxHeight int, scrollOffset int, terminalWidth int, selectedIndex int, dimmedPeople map[string]bool, emptyContext EmptyStateContext) string

RenderPeopleList renders a list of people with responsive columns and scrolling dimmedPeople is a map of person keys that should be rendered dimmed (for fade mode)

func RenderPersonActivitySparklines

func RenderPersonActivitySparklines(person *models.Person) []string

RenderPersonActivitySparklines renders the activity sparklines for a person Shows 7-day and 30-day assignment trends with statistics

func RenderPersonDepartments

func RenderPersonDepartments(person *models.Person) []string

RenderPersonDepartments renders the departments for a person as a bulleted list

func RenderPersonMRReviews

func RenderPersonMRReviews(person *models.Person) []string

RenderPersonMRReviews renders the MR reviews section for a person

func RenderPersonNameAndHandle

func RenderPersonNameAndHandle(name, username string, maxWidth int) (string, string)

RenderPersonNameAndHandle renders a person's name and username with consistent styling If maxWidth > 0, truncates text that's too long with "..." Returns (nameRendered, usernameRendered)

func RenderPersonRoleLabels

func RenderPersonRoleLabels(person *models.Person) []string

RenderPersonRoleLabels renders the role labels for a person, aligned by project name

func RenderPersonStatus

func RenderPersonStatus(person *models.Person) string

RenderPersonStatus renders the status line for a person

func RenderPersonTimeLine

func RenderPersonTimeLine(tzOffsetMinutes int) string

RenderPersonTimeLine renders the time string with styled timezone offset Returns a fully styled time line ready to display

func RenderRoleLabel

func RenderRoleLabel(role string, selected bool) string

RenderRoleLabel renders a single role label with tmux-style formatting Role format: "maintainer::backend" becomes [maintainer][backend] - Left part (role type) gets specialty color - Right part (specialty) gets muted gray background

func RenderRoleLabels

func RenderRoleLabels(roles []string, selectedRoles map[string]bool, maxWidth int) []string

RenderRoleLabels renders multiple role labels with automatic wrapping

func RenderSparkline

func RenderSparkline(values []int) string

RenderSparkline renders a Unicode sparkline from a series of values Returns empty string if data is empty

func RenderSparklineWithStats

func RenderSparklineWithStats(values []int, days int, count int, avg float64) string

RenderSparklineWithStats renders a sparkline with accompanying statistics days: number of days covered (e.g., 7 or 30) count: total count over the period avg: average per day

Types

type CopyUsernameMsg

type CopyUsernameMsg struct {
	Username string
}

CopyUsernameMsg is sent when user requests to copy username (Ctrl+C)

type EmptyStateContext

type EmptyStateContext struct {
	HasNameFilter      bool
	NameFilterValue    string
	HasAvailFilter     bool
	HasWorkHoursFilter bool
}

EmptyStateContext provides context for rendering helpful empty state messages

type HelpItem

type HelpItem struct {
	Category string
	Key      string
	Desc     string
}

HelpItem represents a single help entry

type HelpModal

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

HelpModal displays help information with search functionality

func NewHelpModal

func NewHelpModal(width, height int) HelpModal

NewHelpModal creates a new help modal

func (HelpModal) Update

func (h HelpModal) Update(msg tea.Msg) (HelpModal, tea.Cmd)

Update handles messages for the help modal

func (HelpModal) View

func (h HelpModal) View() string

View renders the help modal

type HelpModalClosedMsg

type HelpModalClosedMsg struct{}

HelpModalClosedMsg is sent when the help modal is closed

type PeopleList

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

PeopleList is a component for displaying and interacting with a list of people

func NewPeopleList

func NewPeopleList(
	people []models.Person,
	width, height int,
	clipboardMessage string,
) PeopleList

NewPeopleList creates a new PeopleList component

func (PeopleList) ClearSelection

func (p PeopleList) ClearSelection() PeopleList

ClearSelection clears the selected card

func (PeopleList) GetFilteredPeople

func (p PeopleList) GetFilteredPeople() []models.Person

GetFilteredPeople returns people filtered by name (public method)

func (PeopleList) HasSelection

func (p PeopleList) HasSelection() bool

HasSelection returns whether a card is currently selected

func (PeopleList) IsFilterActive

func (p PeopleList) IsFilterActive() bool

IsFilterActive returns whether the filter input is currently active

func (PeopleList) RenderGrid

func (p PeopleList) RenderGrid(availableHeight int, hasAvailFilter bool, hasWorkHoursFilter bool) string

RenderGrid renders just the people grid (separate from title)

func (PeopleList) SetClipboardMessage

func (p PeopleList) SetClipboardMessage(msg string) PeopleList

SetClipboardMessage updates the clipboard message

func (PeopleList) SetDimmedPeople

func (p PeopleList) SetDimmedPeople(dimmed map[string]bool) PeopleList

SetDimmedPeople updates the dimmed people map (for fade mode)

func (PeopleList) SetPeople

func (p PeopleList) SetPeople(people []models.Person) PeopleList

SetPeople updates the people list (when project/roles change)

func (PeopleList) Update

func (p PeopleList) Update(msg tea.Msg) (PeopleList, tea.Cmd)

Update handles messages for the PeopleList

func (PeopleList) View

func (p PeopleList) View(availableHeight int) string

View renders the PeopleList with title, filter, and grid

type PersonDetail

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

PersonDetail is a component for displaying person details in a modal

func NewPersonDetail

func NewPersonDetail(
	person *models.Person,
	clipboardMessage string,
) PersonDetail

NewPersonDetail creates a new PersonDetail component

func (PersonDetail) SetClipboardMessage

func (p PersonDetail) SetClipboardMessage(msg string) PersonDetail

SetClipboardMessage updates the clipboard message

func (PersonDetail) Update

func (p PersonDetail) Update(msg tea.Msg) (PersonDetail, tea.Cmd)

Update handles messages for the PersonDetail

func (PersonDetail) View

func (p PersonDetail) View() string

View renders the PersonDetail modal

type PersonDetailClosedMsg

type PersonDetailClosedMsg struct{}

PersonDetailClosedMsg is sent when the person detail modal is closed

type PersonDetailCopyRequestMsg

type PersonDetailCopyRequestMsg struct {
	Username string
}

PersonDetailCopyRequestMsg is sent when user requests to copy username

type PersonSelectedMsg

type PersonSelectedMsg struct {
	Person *models.Person
}

PersonSelectedMsg is sent when a person is selected (Enter key)

type ProjectSelectedMsg

type ProjectSelectedMsg struct {
	Project string
}

ProjectSelectedMsg is sent when a project is selected

type ProjectSelector

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

ProjectSelector is a component for selecting a project from a list

func NewProjectSelector

func NewProjectSelector(projects []string, currentProject string, width, height int) ProjectSelector

NewProjectSelector creates a new ProjectSelector

func (ProjectSelector) Update

func (p ProjectSelector) Update(msg tea.Msg) (ProjectSelector, tea.Cmd)

Update handles messages for the ProjectSelector

func (ProjectSelector) View

func (p ProjectSelector) View() string

View renders the ProjectSelector

type ProjectSelectorCancelledMsg

type ProjectSelectorCancelledMsg struct{}

ProjectSelectorCancelledMsg is sent when the selector is cancelled

type RoleSelectionAppliedMsg

type RoleSelectionAppliedMsg struct {
	SelectedRoles map[string]bool
}

RoleSelectionAppliedMsg is sent when role selection is applied

type RoleSelector

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

RoleSelector is a component for selecting multiple roles with checkboxes

func NewRoleSelector

func NewRoleSelector(
	projectName string,
	roles []string,
	selectedRoles map[string]bool,
	width, height int,
) RoleSelector

NewRoleSelector creates a new RoleSelector

func (RoleSelector) Update

func (r RoleSelector) Update(msg tea.Msg) (RoleSelector, tea.Cmd)

Update handles messages for the RoleSelector

func (RoleSelector) View

func (r RoleSelector) View() string

View renders the RoleSelector

type RoleSelectorCancelledMsg

type RoleSelectorCancelledMsg struct{}

RoleSelectorCancelledMsg is sent when the selector is cancelled

type SortSelectedMsg

type SortSelectedMsg struct {
	Option api.SortOption
}

SortSelectedMsg is sent when a sort option is selected

type SortSelector

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

SortSelector represents the sort selector modal

func NewSortSelector

func NewSortSelector(currentOption api.SortOption, width, height int) SortSelector

NewSortSelector creates a new sort selector

func (SortSelector) Update

func (s SortSelector) Update(msg tea.Msg) (SortSelector, tea.Cmd)

Update handles messages for the sort selector

func (SortSelector) View

func (s SortSelector) View() string

View renders the sort selector modal

type VisibleCardRange

type VisibleCardRange struct {
	Start int // First visible card index
	End   int // Last visible card index (exclusive)
	Count int // Number of visible cards
}

VisibleCardRange represents the range of visible card indices

func CalculateVisibleCardRange

func CalculateVisibleCardRange(totalPeople int, maxHeight int, scrollOffset int, terminalWidth int) VisibleCardRange

CalculateVisibleCardRange calculates which cards are visible on screen

Jump to

Keyboard shortcuts

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