MCPcopy
hub / github.com/pranshuparmar/witr / View

Method View

internal/tui/view.go:12–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10)
11
12func (m MainModel) View() string {
13 if m.quitting {
14 return ""
15 }
16
17 outerStyle := baseStyle.
18 Width(m.width-2).
19 Height(m.height-2).
20 Padding(0, 1)
21
22 switch m.state {
23 case stateList:
24 return m.viewList(outerStyle)
25 case stateDetail:
26 if m.selectedDetail == nil && m.selectedContainer == nil {
27 return m.viewDetailLoading(outerStyle)
28 }
29 if m.selectedContainer != nil {
30 return m.viewContainerDetail(outerStyle)
31 }
32 return m.viewProcessDetail(outerStyle)
33 }
34 return "Unknown state"
35}
36
37func (m MainModel) viewList(outerStyle lipgloss.Style) string {
38 status := "Mode: Navigation (Press / to search)"

Callers 14

handlePortAreaMouseMethod · 0.80
handleLockAreaMouseMethod · 0.80
TestViewProcessDetailFunction · 0.80
TestViewContainerDetailFunction · 0.80
TestViewDetailLoadingFunction · 0.80
TestViewQuittingIsBlankFunction · 0.80
viewListMethod · 0.80

Calls 4

viewListMethod · 0.95
viewDetailLoadingMethod · 0.95
viewContainerDetailMethod · 0.95
viewProcessDetailMethod · 0.95

Tested by 7

TestViewProcessDetailFunction · 0.64
TestViewContainerDetailFunction · 0.64
TestViewDetailLoadingFunction · 0.64
TestViewQuittingIsBlankFunction · 0.64