Documentation
¶
Overview ¶
Package kanban provides reusable board data, stable selection, navigation, and layout calculations. Consumers resolve domain objects before building cards and resolve semantic card IDs back into their own actions.
Index ¶
- func MinimumWidth(columns, columnWidth, outerWidth int) int
- func UsesCompact(width, columns, columnWidth, outerWidth int) bool
- type Action
- type ActionKind
- type Board
- func (b Board) CardAt(s Selection) (Card, bool)
- func (b Board) Clamp(s Selection) Selection
- func (b Board) ColumnCount() int
- func (b Board) ItemCount(column int) int
- func (b Board) MoveColumn(s Selection, delta int) Selection
- func (b Board) MoveRow(s Selection, delta int) Selection
- func (b Board) PositionOf(id string) (Position, bool)
- func (b Board) PreserveSelection(previous Board, s Selection) Selection
- type Card
- type CardRenderer
- type CellState
- type Component
- func (c *Component) Board() Board
- func (c *Component) ClearHover()
- func (c *Component) Compact(width, minColumnWidth int) bool
- func (c *Component) HandlePointer(kind PointerKind, region HitRegion) Action
- func (c *Component) MoveColumn(delta int)
- func (c *Component) MoveRow(delta int)
- func (c *Component) Render(options RenderOptions) RenderResult
- func (c *Component) ScrollLane(column, delta int)
- func (c *Component) Select(selection Selection)
- func (c *Component) Selection() Selection
- func (c *Component) SetBoard(board Board)
- func (c *Component) VisibleCards(maxCards int) []Card
- type HitRegion
- type Lane
- type LaneID
- type Layout
- type Line
- type PointerKind
- type Position
- type RegionKind
- type RenderOptions
- type RenderResult
- type Selection
- type Span
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MinimumWidth ¶
func UsesCompact ¶
Types ¶
type Action ¶
type Action struct {
Kind ActionKind
CardID string
LaneID LaneID
}
type ActionKind ¶
type ActionKind string
const ( ActionNone ActionKind = "" ActionSelected ActionKind = "selected" ActionActivated ActionKind = "activated" )
type CardRenderer ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component owns reusable board interaction state. It deliberately emits semantic card IDs; consumers keep domain actions and payloads source-local.
func (*Component) ClearHover ¶
func (c *Component) ClearHover()
func (*Component) HandlePointer ¶
func (c *Component) HandlePointer(kind PointerKind, region HitRegion) Action
func (*Component) MoveColumn ¶
func (*Component) Render ¶
func (c *Component) Render(options RenderOptions) RenderResult
func (*Component) ScrollLane ¶
func (*Component) VisibleCards ¶
VisibleCards returns the actual per-lane card window used by Render. It also scrolls the selected card into view, so background consumers such as the animation scheduler cannot drift from the next painted frame.
type HitRegion ¶
type HitRegion struct {
Kind RegionKind
Column int
Row int
CardID string
X, Y, W, H int
}
type Layout ¶
type Layout struct {
ColumnWidth int
ColumnWidths []int
CardHeight int
MaxCards int
ContentRows int
}
func CalculateLayout ¶
CalculateLayout mirrors the existing Sidecar board geometry while keeping height constraints testable independently of a view renderer.
type PointerKind ¶
type PointerKind string
const ( PointerHover PointerKind = "hover" PointerClick PointerKind = "click" PointerDoubleClick PointerKind = "double-click" )
type RegionKind ¶
type RegionKind string
const ( RegionColumn RegionKind = "column" RegionCard RegionKind = "card" )