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.
()
| 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. |
| 150 | func (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 | |
| 161 | func (m *Model) view() string { |
| 162 | cardWidth := min(maxCardWidth, m.width-4) |