MCPcopy Create free account
hub / github.com/basecamp/hey-cli / sectionView

Interface sectionView

internal/tui/section_view.go:21–56  ·  view source on GitHub ↗

sectionView is the interface every top-level section must implement.

Source from the content-addressed store, hash-verified

19
20type viewContext struct {
21 rootSDK *hey.Client
22 sdk *hey.Client
23 ctx context.Context
24 styles styles
25 imageRenderer imageRenderer
26 imageFetcher imageFetcher
27 saveAttachment attachmentSaveFunc
28 openAttachment attachmentOpenFunc
29 newAttachmentTempDir func() (string, error)
30 loadCover coverLoadFunc
31 saveCover coverSaveFunc
32 width int
33 height int // content area height
34}
35
36// sectionView is the interface every top-level section must implement.
37type sectionView interface {
38 // Init returns the command to run when this section becomes active.
39 Init() tea.Cmd
40
41 // Update handles messages relevant to this section.
42 // Returns the command and whether the message was consumed.
43 Update(msg tea.Msg) (tea.Cmd, bool)
44
45 // View renders the content area.
46 View() string
47
48 // HelpBindings returns section-specific help bindings for rowContent.
49 HelpBindings() []helpBinding
50
51 // SubnavItems returns the subnav state for header rendering.
52 SubnavItems() (items []navItem, selected int, label string, centered bool)
53
54 // SubnavLeft / SubnavRight handle subnav row navigation.
55 SubnavLeft() tea.Cmd
56 SubnavRight() tea.Cmd
57
58 // HandleContentKey handles key presses when focus is on rowContent.
59 HandleContentKey(msg tea.KeyPressMsg) tea.Cmd

Callers 66

TestInitReturnsCmdFunction · 0.65
journalWithEntryFunction · 0.65
UpdateMethod · 0.65
HandleContentKeyMethod · 0.65
sizedModelFunction · 0.65
modelWithBoxesFunction · 0.65

Implementers 3

calendarViewinternal/tui/calendar.go
mailViewinternal/tui/mail.go
journalViewinternal/tui/journal.go

Calls

no outgoing calls

Tested by

no test coverage detected