gridblock

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gridblock adapts the product-neutral strongo-tui grid.Model to aichat's transcript.Block contract, so a result grid can be a chat transcript entry. It is the only place aichat and strongo-tui's grid meet: grid.Model knows nothing about transcript or session.EntityRef.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityRef

func EntityRef(m *grid.Model) *session.EntityRef

EntityRef returns the session.EntityRef stored (as pointer or value) in the Ref of m's highlighted row, or nil when there is none.

Types

type Block

type Block struct{ *grid.Model }

Block adapts *grid.Model to transcript.Block, transcript.EntityBlock and transcript.SelfFramed. Model is embedded, so every other grid method (Title, CapturesEsc, SetSize, SetFocused, SelectRow, ...) is promoted unchanged, and View(width, focused) satisfies transcript.Block as is.

func Wrap

func Wrap(m *grid.Model) *Block

Wrap returns m as a transcript block.

func (*Block) Current

func (b *Block) Current() *session.EntityRef

Current returns the entity under the cursor, or nil.

func (*Block) Focusable

func (b *Block) Focusable() bool

Focusable reports that a grid block always takes a focus stop.

func (*Block) SelfFramed

func (b *Block) SelfFramed() bool

SelfFramed reports that the grid draws its own complete border, so transcript must not wrap it in a card fill.

func (*Block) Update

func (b *Block) Update(msg tea.Msg) (transcript.Block, tea.Cmd)

Update forwards msg to the grid and returns the same Block (identity is kept). The grid's pin request is translated into tui.AddToSidebarMsg.

Jump to

Keyboard shortcuts

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