mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-31 00:03:01 +03:00
fix(tui): keep scroll position indicator textual
This commit is contained in:
+3
-3
@@ -1134,7 +1134,7 @@ describe("NanobotTui layout", () => {
|
|||||||
app.accept({ event: "stream_end", chat_id: "chat" })
|
app.accept({ event: "stream_end", chat_id: "chat" })
|
||||||
await setup.renderOnce()
|
await setup.renderOnce()
|
||||||
expect(scroll.scrollTop).toBe(0)
|
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")
|
expect(internals.status.plainText).toContain("Ctrl+End latest")
|
||||||
|
|
||||||
setup.mockInput.pressKey("\u001B[6~")
|
setup.mockInput.pressKey("\u001B[6~")
|
||||||
@@ -1148,8 +1148,8 @@ describe("NanobotTui layout", () => {
|
|||||||
expect(internals.status.plainText).not.toContain("Ctrl+End latest")
|
expect(internals.status.plainText).not.toContain("Ctrl+End latest")
|
||||||
|
|
||||||
setup.mockInput.pressKey("HOME", { ctrl: true })
|
setup.mockInput.pressKey("HOME", { ctrl: true })
|
||||||
await waitUntil(() => scroll.verticalScrollBar.visible)
|
await waitUntil(() => internals.status.plainText.includes("Ctrl+End latest"))
|
||||||
expect(scroll.verticalScrollBar.visible).toBe(true)
|
expect(scroll.verticalScrollBar.visible).toBe(false)
|
||||||
app.accept({ event: "attached", chat_id: "chat" })
|
app.accept({ event: "attached", chat_id: "chat" })
|
||||||
await waitUntil(() => (app as unknown as { ready: boolean }).ready)
|
await waitUntil(() => (app as unknown as { ready: boolean }).ready)
|
||||||
await setup.renderOnce()
|
await setup.renderOnce()
|
||||||
|
|||||||
@@ -321,7 +321,6 @@ export class Transcript {
|
|||||||
&& unseenOutput === this.navigation.unseenOutput
|
&& unseenOutput === this.navigation.unseenOutput
|
||||||
) return
|
) return
|
||||||
this.navigation = { awayFromBottom, unseenOutput }
|
this.navigation = { awayFromBottom, unseenOutput }
|
||||||
this.root.verticalScrollBar.visible = awayFromBottom
|
|
||||||
this.emitNavigation()
|
this.emitNavigation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user