fix(tui): keep scroll position indicator textual

This commit is contained in:
Xubin Ren
2026-08-17 20:56:10 +08:00
parent 0035cd67cd
commit 5415e68014
2 changed files with 3 additions and 4 deletions
+3 -3
View File
@@ -1134,7 +1134,7 @@ describe("NanobotTui layout", () => {
app.accept({ event: "stream_end", chat_id: "chat" })
await setup.renderOnce()
expect(scroll.scrollTop).toBe(0)
expect(scroll.verticalScrollBar.visible).toBe(true)
expect(scroll.verticalScrollBar.visible).toBe(false)
expect(internals.status.plainText).toContain("Ctrl+End latest")
setup.mockInput.pressKey("\u001B[6~")
@@ -1148,8 +1148,8 @@ describe("NanobotTui layout", () => {
expect(internals.status.plainText).not.toContain("Ctrl+End latest")
setup.mockInput.pressKey("HOME", { ctrl: true })
await waitUntil(() => scroll.verticalScrollBar.visible)
expect(scroll.verticalScrollBar.visible).toBe(true)
await waitUntil(() => internals.status.plainText.includes("Ctrl+End latest"))
expect(scroll.verticalScrollBar.visible).toBe(false)
app.accept({ event: "attached", chat_id: "chat" })
await waitUntil(() => (app as unknown as { ready: boolean }).ready)
await setup.renderOnce()
-1
View File
@@ -321,7 +321,6 @@ export class Transcript {
&& unseenOutput === this.navigation.unseenOutput
) return
this.navigation = { awayFromBottom, unseenOutput }
this.root.verticalScrollBar.visible = awayFromBottom
this.emitNavigation()
}