mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
feat: faster tui init
This commit is contained in:
parent
06af406146
commit
7c0d10a4ce
8 changed files with 124 additions and 112 deletions
|
|
@ -23,7 +23,7 @@ import (
|
|||
|
||||
func toMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {
|
||||
r := styles.GetMarkdownRenderer(width, backgroundColor)
|
||||
content = strings.ReplaceAll(content, app.Info.Path.Root+"/", "")
|
||||
content = strings.ReplaceAll(content, app.RootPath+"/", "")
|
||||
rendered, _ := r.Render(content)
|
||||
lines := strings.Split(rendered, "\n")
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ func truncateHeight(content string, height int) string {
|
|||
}
|
||||
|
||||
func relative(path string) string {
|
||||
return strings.TrimPrefix(path, app.Info.Path.Root+"/")
|
||||
return strings.TrimPrefix(path, app.RootPath+"/")
|
||||
}
|
||||
|
||||
func extension(path string) string {
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ func (m *messagesComponent) renderView() {
|
|||
author := ""
|
||||
switch message.Role {
|
||||
case client.User:
|
||||
author = app.Info.User
|
||||
author = m.app.Info.User
|
||||
case client.Assistant:
|
||||
author = message.Metadata.Assistant.ModelID
|
||||
}
|
||||
|
|
@ -328,7 +328,7 @@ func (m *messagesComponent) home() string {
|
|||
logoAndVersion := lipgloss.JoinVertical(
|
||||
lipgloss.Right,
|
||||
logo,
|
||||
muted(app.Info.Version),
|
||||
muted(m.app.Version),
|
||||
)
|
||||
|
||||
lines := []string{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue