MCPcopy
hub / github.com/docker/docker-agent / Layer

Method Layer

pkg/tui/components/tour/tour.go:150–159  ·  view source on GitHub ↗

Layer returns the floating card as a lipgloss layer anchored to the bottom-right of the content area, below the sidebar's agent info and tools so it hides as little as possible. Nil when the tour is inactive.

()

Source from the content-addressed store, hash-verified

148// bottom-right of the content area, below the sidebar's agent info and
149// tools so it hides as little as possible. Nil when the tour is inactive.
150func (m *Model) Layer() *lipgloss.Layer {
151 if !m.Active() || m.width < 20 || m.height < 10 {
152 return nil
153 }
154
155 view := m.view()
156 col := max(1, m.width-lipgloss.Width(view)-1)
157 row := max(1, m.contentBottom-lipgloss.Height(view))
158 return lipgloss.NewLayer(view).X(col).Y(row)
159}
160
161func (m *Model) view() string {
162 cardWidth := min(maxCardWidth, m.width-4)

Callers 5

ViewMethod · 0.80
TestNew_InactiveFunction · 0.80
TestStart_ShowsFirstStepFunction · 0.80
TestLayer_RequiresRoomFunction · 0.80

Calls 4

ActiveMethod · 0.95
viewMethod · 0.95
WidthMethod · 0.45
HeightMethod · 0.45

Tested by 4

TestNew_InactiveFunction · 0.64
TestStart_ShowsFirstStepFunction · 0.64
TestLayer_RequiresRoomFunction · 0.64