4 "charm.land/lipgloss/v2"
5 "github.com/charmbracelet/crush/internal/agent"
6 "github.com/charmbracelet/crush/internal/ui/common"
7 uv "github.com/charmbracelet/ultraviolet"
10// selectedLargeModel returns the currently selected large language model from
11// the agent coordinator, if one exists.
12func (m *UI) selectedLargeModel() *agent.Model {
13 if m.com.App.AgentCoordinator != nil {
14 model := m.com.App.AgentCoordinator.Model()
20// landingView renders the landing page view showing the current working
21// directory, model information, and LSP/MCP status in a two-column layout.
22func (m *UI) landingView() string {
24 width := m.layout.main.Dx()
25 cwd := common.PrettyPath(t, m.com.Config().WorkingDir(), width)
31 parts = append(parts, "", m.modelInfo(width))
32 infoSection := lipgloss.JoinVertical(lipgloss.Left, parts...)
34 _, remainingHeightArea := uv.SplitVertical(m.layout.main, uv.Fixed(lipgloss.Height(infoSection)+1))
36 mcpLspSectionWidth := min(30, (width-1)/2)
38 lspSection := m.lspInfo(mcpLspSectionWidth, max(1, remainingHeightArea.Dy()), false)
39 mcpSection := m.mcpInfo(mcpLspSectionWidth, max(1, remainingHeightArea.Dy()), false)
41 content := lipgloss.JoinHorizontal(lipgloss.Left, lspSection, " ", mcpSection)
43 return lipgloss.NewStyle().
45 Height(m.layout.main.Dy() - 1).
48 lipgloss.JoinVertical(lipgloss.Left, infoSection, "", content),
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list