refactor(tui): simplify session rows

This commit is contained in:
Xubin Ren
2026-08-24 00:58:04 +08:00
parent 1f0771c555
commit 5accc903a0
3 changed files with 64 additions and 10 deletions
+11 -2
View File
@@ -2147,7 +2147,12 @@ export class NanobotTui {
this.updateTitle()
}
const limit = this.renderer.height >= 20 ? 8 : 4
this.sessionMenu.open(sessions, this.client.activeChatId, limit)
this.sessionMenu.open(
sessions,
this.client.activeChatId,
limit,
this.defaultModelPreset,
)
this.startSessionRefresh()
this.renderTitleColor()
this.sessionMenu.update(this.composer.plainText, limit)
@@ -2361,7 +2366,11 @@ export class NanobotTui {
this.apiReauthenticator,
)
if (this.quitting || loadId !== this.sessionLoadId || !this.sessionMenu.visible) return
this.sessionMenu.replace(sessions, this.client.activeChatId)
this.sessionMenu.replace(
sessions,
this.client.activeChatId,
this.defaultModelPreset,
)
this.status.content = sessions.length ? `${sessions.length} sessions` : "No saved sessions"
} catch {
// Keep the existing picker usable during a transient refresh failure.