core

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package core holds lazydash's backend-neutral domain model: the projects, boards, cards and fields that every source (GitHub Projects, local git issues) maps onto and that the TUI renders. It knows nothing about where the data came from or how it was fetched — that lives in internal/source/*.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionColors

func OptionColors(data *BoardData) map[string]map[string]string

OptionColors builds a lookup map of fieldName → optionName → terminal color string derived from each option's color enum. Used by the board renderer.

Types

type BoardData

type BoardData struct {
	Views  []ProjectView
	Fields []SelectField
	Items  []RawItem
}

BoardData holds everything fetched from a project in one call. Grouping into columns is done client-side via GroupByField.

type Card

type Card struct {
	ID          string
	Type        string // ISSUE | PULL_REQUEST | DRAFT_ISSUE
	Number      int
	Title       string
	State       string
	URL         string
	Repo        string
	Assignees   []string
	Labels      []Label
	Status      string
	Body        string
	FieldValues map[string]string // all field values keyed by field name
}

Card is a single item on the board.

func FlatItems

func FlatItems(data *BoardData) []Card

FlatItems returns all non-archived items in source order, for table views.

type Column

type Column struct {
	Name  string
	Cards []Card
}

Column is a named group of cards on a board view.

func GroupByField

func GroupByField(data *BoardData, fieldName string) []Column

GroupByField buckets RawItems into Columns using the named single-select field. Column order follows the field's option order. Falls back to "No <field>" bucket.

type FieldOption

type FieldOption struct {
	ID    string // option node id, needed to set the field value via the API
	Name  string
	Color string // enum: GRAY | BLUE | GREEN | YELLOW | ORANGE | RED | PINK | PURPLE
}

FieldOption is one option of a single-select field, including its color enum.

type Label

type Label struct {
	Name  string
	Color string // hex color without '#', e.g. "d73a4a"
}

Label holds an issue label with its display color.

type Project

type Project struct {
	ID          string
	Number      int
	Title       string
	Owner       string
	Description string
	URL         string
	UpdatedAt   string
	Source      string // name of the source that owns this project (e.g. "github", "local")
}

Project represents a board-bearing project from some source.

type ProjectView

type ProjectView struct {
	ID            string
	Name          string
	Layout        string // BOARD_LAYOUT | TABLE_LAYOUT | ROADMAP_LAYOUT
	GroupByField  string
	VisibleFields []VisibleField
}

ProjectView mirrors a saved view — a layout plus its grouping and columns.

type RawItem

type RawItem struct {
	ID          string
	Type        string
	IsArchived  bool
	Number      int
	Title       string
	State       string
	URL         string
	Repo        string
	Assignees   []string
	Labels      []Label
	Body        string
	FieldValues map[string]string // field name → selected option name
}

RawItem is an ungrouped project item with all its field values.

type SelectField

type SelectField struct {
	ID      string
	Name    string
	Options []FieldOption
}

SelectField is a single-select field with ordered options.

type VisibleField

type VisibleField struct {
	ID       string
	Name     string
	DataType string // TITLE | ASSIGNEES | SINGLE_SELECT | DATE | NUMBER | TEXT | ITERATION | MILESTONE | REPOSITORY | LABELS | LINKED_PULL_REQUESTS
}

VisibleField is a field configured to be shown in a view.

Jump to

Keyboard shortcuts

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