mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-01 00:31:51 +03:00
fix(tui): keep navigation commands in Herdr panes
This commit is contained in:
+9
-1
@@ -2139,7 +2139,7 @@ describe("NanobotTui layout", () => {
|
||||
})
|
||||
|
||||
describe("NanobotTui in a Herdr pane", () => {
|
||||
test("stays quiet while reporting task, session, lifecycle, and metadata", async () => {
|
||||
test("keeps local navigation while reporting task, session, lifecycle, and metadata", async () => {
|
||||
const setup = await createTestRenderer({ width: 80, height: 22, screenMode: "main-screen" })
|
||||
const states: Array<{ state: HostAgentState; message?: string }> = []
|
||||
const metadata: HostMetadata[] = []
|
||||
@@ -2160,6 +2160,14 @@ describe("NanobotTui in a Herdr pane", () => {
|
||||
host,
|
||||
)
|
||||
|
||||
await setup.mockInput.typeText("/")
|
||||
await setup.flush()
|
||||
const commandFrame = setup.captureCharFrame()
|
||||
expect(commandFrame).toContain("/sessions")
|
||||
expect(commandFrame).toContain("/new-chat")
|
||||
expect(commandFrame).toContain("/branch")
|
||||
setup.mockInput.pressEscape()
|
||||
|
||||
app.accept({ event: "attached", chat_id: "chat" })
|
||||
app.accept({
|
||||
event: "user_message",
|
||||
|
||||
+1
-5
@@ -459,11 +459,7 @@ export class NanobotTui {
|
||||
this.activeThemeMode = this.resolveThemeMode(renderer.themeMode)
|
||||
this.palette = this.activeThemeMode === "light" ? LIGHT : DARK
|
||||
this.host = host
|
||||
this.localCommands = host.hosted
|
||||
? LOCAL_COMMANDS.filter(({ command }) => (
|
||||
command === "/context" || command === "/diff" || command === "/exit"
|
||||
))
|
||||
: LOCAL_COMMANDS
|
||||
this.localCommands = LOCAL_COMMANDS
|
||||
this.transcript = new Transcript(
|
||||
renderer,
|
||||
transcriptTheme(this.palette, this.backgroundKnown),
|
||||
|
||||
Reference in New Issue
Block a user