MCPcopy Index your code
hub / github.com/docker/docker-agent / render

Method render

cmd/root/agent_picker.go:694–726  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

692}
693
694func (m *agentPickerModel) render() string {
695 title, subtitle, help := m.headerText()
696
697 cardWidth := m.cardWidth()
698 n := m.visibleCount()
699 blocks := make([]string, 0, n*2)
700 for i := m.offset; i < m.offset+n; i++ {
701 if i > m.offset && agentPickerCardGap > 0 {
702 blocks = append(blocks, strings.Repeat("\n", agentPickerCardGap-1))
703 }
704 blocks = append(blocks, m.renderCard(m.choices[i], cardWidth, i == m.cursor))
705 }
706 list := lipgloss.JoinVertical(lipgloss.Left, blocks...)
707
708 content := lipgloss.JoinVertical(
709 lipgloss.Left,
710 title,
711 "",
712 subtitle,
713 "",
714 list,
715 "",
716 m.leanCheckbox(),
717 "",
718 help,
719 )
720
721 return styles.BaseStyle.
722 Border(lipgloss.RoundedBorder()).
723 BorderForeground(styles.BorderSecondary).
724 Padding(1, 4).
725 Render(content)
726}
727
728// renderDetails renders the scrollable YAML dialog for the selected agent.
729func (m *agentPickerModel) renderDetails() string {

Calls 6

headerTextMethod · 0.95
cardWidthMethod · 0.95
visibleCountMethod · 0.95
renderCardMethod · 0.95
leanCheckboxMethod · 0.95
RenderMethod · 0.65