mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-26 23:52:24 +00:00
fix(app): focus terminal after opening panel (#44737)
Co-authored-by: Brendonovich <14191578+Brendonovich@users.noreply.github.com>
This commit is contained in:
parent
0164c1c8bc
commit
43d4968356
2 changed files with 4 additions and 2 deletions
|
|
@ -126,6 +126,8 @@ test("routes typing to the composer unless the open terminal is focused", async
|
|||
|
||||
const composer = page.locator('[data-component="composer-editor"]')
|
||||
const terminal = page.locator('[data-component="terminal"]')
|
||||
await composer.click()
|
||||
await expect(composer).toBeFocused()
|
||||
await page.keyboard.press("Control+Backquote")
|
||||
await expect(terminal).toBeVisible()
|
||||
await expect.poll(() => terminal.evaluate((element) => element.contains(document.activeElement))).toBe(true)
|
||||
|
|
|
|||
|
|
@ -193,9 +193,9 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
|
|||
}
|
||||
|
||||
const openTerminal = () => {
|
||||
actions.session.layout.view().terminal.open()
|
||||
if (terminal.all().length > 0) terminal.new({ focus: true })
|
||||
if (terminal.all().length === 0) terminal.requestFocus()
|
||||
actions.session.layout.view().terminal.open()
|
||||
}
|
||||
|
||||
const closeTerminal = () => {
|
||||
|
|
@ -361,8 +361,8 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
|
|||
actions.session.layout.view().terminal.close()
|
||||
return
|
||||
}
|
||||
terminal.requestFocus(terminal.active())
|
||||
actions.session.layout.view().terminal.open()
|
||||
terminal.requestFocus(terminal.active())
|
||||
},
|
||||
}),
|
||||
viewCommand({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue