package common import ( "context" "tasksquire/taskwarrior" ) type Common struct { Ctx context.Context TW taskwarrior.TaskWarrior Keymap *Keymap Styles *Styles pageStack *Stack[Component] width int height int } func NewCommon(ctx context.Context, tw taskwarrior.TaskWarrior) *Common { return &Common{ Ctx: ctx, TW: tw, Keymap: NewKeymap(), Styles: NewStyles(tw.GetConfig()), pageStack: NewStack[Component](), } } func (c *Common) SetSize(width, height int) { c.width = width c.height = height } func (c *Common) Width() int { return c.width } func (c *Common) Height() int { return c.height } func (c *Common) PushPage(page Component) { c.pageStack.Push(page) } func (c *Common) PopPage() (Component, error) { return c.pageStack.Pop() }