mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
sync
This commit is contained in:
parent
7b8e78292d
commit
c8aece4f7c
1 changed files with 8 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import type { PatchTool } from "../../../tool/patch"
|
|||
import type { WebFetchTool } from "../../../tool/webfetch"
|
||||
import type { TaskTool } from "../../../tool/task"
|
||||
import { useKeyboard, type BoxProps, type JSX } from "@opentui/solid"
|
||||
import { useSDK } from "./context/sdk"
|
||||
|
||||
export function Session() {
|
||||
const route = useRouteData("session")
|
||||
|
|
@ -36,10 +37,17 @@ export function Session() {
|
|||
let scroll: ScrollBoxRenderable
|
||||
|
||||
createEffect(() => sync.session.sync(route.sessionID))
|
||||
const sdk = useSDK()
|
||||
|
||||
useKeyboard((evt) => {
|
||||
if (evt.name === "pageup") scroll.scrollBy(-scroll.height / 2)
|
||||
if (evt.name === "pagedown") scroll.scrollBy(scroll.height / 2)
|
||||
if (evt.name === "escape")
|
||||
sdk.session.abort({
|
||||
path: {
|
||||
id: route.sessionID,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue