feat: 升级到 lipgloss/bubbletea v2,实现翻译卡片组件

- 升级 charm.land/lipgloss/v2 v1.1.0 -> v2.0.2
- 升级 charm.land/bubbletea/v2 v1.3.10 -> v2.0.2
- 升级 charm.land/bubbles/v2 -> v2.1.0
- 新增翻译卡片组件:元信息行(Tokens/耗时/模型)、用户输入(碳黑背景)、翻译结果
- 卡片组件间距 5px
- 重构 model.go 适配 v2 API
- 更新 keys.go, messages.go, styles.go
This commit is contained in:
2026-04-07 04:47:58 +08:00
parent 18b191d10d
commit 217db90cfa
10 changed files with 865 additions and 287 deletions

21
internal/tui/messages.go Normal file
View File

@@ -0,0 +1,21 @@
package tui
import "time"
type ChatMessage struct {
ID string
Input string
Output string
FromLang string
ToLang string
Model string
Tokens int
Timestamp time.Time
Error string
}
type ChatHistory struct {
Messages []ChatMessage
scrollPos int
totalLines int
}