View renders the model.
()
| 2545 | |
| 2546 | // View renders the model. |
| 2547 | func (m *appModel) View() tea.View { |
| 2548 | windowTitle := m.windowTitle() |
| 2549 | |
| 2550 | if m.err != nil { |
| 2551 | return toFullscreenView(styles.ErrorStyle.Render(m.err.Error()), windowTitle, false, m.leanMode) |
| 2552 | } |
| 2553 | |
| 2554 | if !m.ready { |
| 2555 | return toFullscreenView( |
| 2556 | styles.CenterStyle. |
| 2557 | Width(m.wWidth). |
| 2558 | Height(m.wHeight). |
| 2559 | Render(styles.MutedStyle.Render("Loading…")), |
| 2560 | windowTitle, |
| 2561 | false, |
| 2562 | m.leanMode, |
| 2563 | ) |
| 2564 | } |
| 2565 | |
| 2566 | // Content area (messages + sidebar) -- swaps per tab |
| 2567 | contentView := m.chatPage.View() |
| 2568 | |
| 2569 | // Lean mode: editor appears right after the last message, with empty |
| 2570 | // space pushed to the top via bottom-alignment. |
| 2571 | if m.leanMode { |
| 2572 | viewParts := []string{contentView} |
| 2573 | if m.chatPage.IsWorking() || m.sessionState.PauseState() != service.PauseNone { |
| 2574 | viewParts = append(viewParts, m.renderLeanWorkingIndicator()) |
| 2575 | } |
| 2576 | viewParts = append(viewParts, m.editor.View()) |
| 2577 | inner := lipgloss.JoinVertical(lipgloss.Top, viewParts...) |
| 2578 | baseView := lipgloss.PlaceVertical(m.height, lipgloss.Bottom, inner) |
| 2579 | return toFullscreenView(baseView, windowTitle, m.chatPage.IsWorking(), m.leanMode) |
| 2580 | } |
| 2581 | |
| 2582 | // Resize handle (between content and bottom panel) |
| 2583 | resizeHandle := m.renderResizeHandle(m.width) |
| 2584 | |
| 2585 | // Tab bar (above editor) |
| 2586 | tabBarView := m.tabBar.View() |
| 2587 | |
| 2588 | // Editor (fixed position, per-session state) |
| 2589 | editorView := m.editor.View() |
| 2590 | |
| 2591 | // Status bar |
| 2592 | statusBarView := m.statusBar.View() |
| 2593 | |
| 2594 | // Combine: content | resize handle | [tab bar] | editor | status bar |
| 2595 | viewParts := []string{ |
| 2596 | contentView, |
| 2597 | resizeHandle, |
| 2598 | } |
| 2599 | if tabBarView != "" { |
| 2600 | viewParts = append(viewParts, lipgloss.NewStyle(). |
| 2601 | Padding(0, styles.AppPadding). |
| 2602 | Render(tabBarView)) |
| 2603 | } |
| 2604 | viewParts = append(viewParts, editorView) |
nothing calls this directly
no test coverage detected