keys

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package keys holds the global key map for the section-based TUI and the config-driven rebinding that lets users override any binding by name.

The map is intentionally flat: every binding is a named field so it can be looked up for rebinding and listed for contextual help. Sections may expose their own additional bindings, but the navigation and Jira-verb bindings shared across every view live here so the experience stays consistent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	// Navigation.
	Up          key.Binding
	Down        key.Binding
	Top         key.Binding
	Bottom      key.Binding
	PageUp      key.Binding
	PageDown    key.Binding
	NextSection key.Binding
	PrevSection key.Binding
	Open        key.Binding
	Back        key.Binding

	// Queue control.
	Refresh     key.Binding
	TogglePause key.Binding
	Filter      key.Binding
	Facet       key.Binding
	Jumplist    key.Binding
	Search      key.Binding
	Presets     key.Binding
	NextLens    key.Binding
	PrevLens    key.Binding

	// Jira verbs (the triage loop).
	Transition key.Binding
	Comment    key.Binding
	Assign     key.Binding
	AssignMe   key.Binding
	Labels     key.Binding
	Worklog    key.Binding
	Edit       key.Binding
	Create     key.Binding

	// Cross-cutting.
	TogglePreview key.Binding
	GrowPreview   key.Binding
	ShrinkPreview key.Binding
	Zoom          key.Binding
	OpenBrowse    key.Binding
	CopyKey       key.Binding
	CopyURL       key.Binding
	Select        key.Binding
	SelectAll     key.Binding
	SelectInvert  key.Binding
	SelectRange   key.Binding
	Help          key.Binding
	Quit          key.Binding
}

Map is the global key map. Fields are grouped by purpose but all live in one struct so Map.Rebind can address any of them by a stable lower-case name.

func Default

func Default() Map

Default returns the stock key map. Bindings favor a Jira-native triage loop: j/k to move, enter to open, and single-key verbs (t/c/a/w) for the actions a reviewer repeats all day.

func (*Map) Names

func (m *Map) Names() []string

Names returns every rebindable binding name, sorted. Useful for docs and for validating a config file's keybinding overrides.

func (*Map) Rebind

func (m *Map) Rebind(overrides map[string][]string) error

Rebind applies user overrides keyed by binding name (e.g. {"transition": {"x"}}). An empty key slice is ignored so a partial config never silently unbinds an action. The first key becomes the help label. An unknown name is an error rather than a silent no-op, so a typo in a config file is surfaced.

Jump to

Keyboard shortcuts

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