mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 00:38:31 +00:00
Apply PR #30815: opentui with native yoga layout
This commit is contained in:
commit
998e580c20
4 changed files with 415 additions and 506 deletions
12
package.json
12
package.json
|
|
@ -39,9 +39,9 @@
|
|||
"@octokit/rest": "22.0.0",
|
||||
"@hono/standard-validator": "0.2.0",
|
||||
"@hono/zod-validator": "0.4.2",
|
||||
"@opentui/core": "0.3.4",
|
||||
"@opentui/keymap": "0.3.4",
|
||||
"@opentui/solid": "0.3.4",
|
||||
"@opentui/core": "0.0.0-20260604-5b641b77",
|
||||
"@opentui/keymap": "0.0.0-20260604-5b641b77",
|
||||
"@opentui/solid": "0.0.0-20260604-5b641b77",
|
||||
"@tanstack/solid-virtual": "3.13.28",
|
||||
"@shikijs/stream": "4.2.0",
|
||||
"ulid": "3.0.1",
|
||||
|
|
@ -134,9 +134,9 @@
|
|||
"electron"
|
||||
],
|
||||
"overrides": {
|
||||
"@opentui/core": "catalog:",
|
||||
"@opentui/keymap": "catalog:",
|
||||
"@opentui/solid": "catalog:",
|
||||
"@opentui/core": "0.0.0-20260604-5b641b77",
|
||||
"@opentui/keymap": "0.0.0-20260604-5b641b77",
|
||||
"@opentui/solid": "0.0.0-20260604-5b641b77",
|
||||
"@types/bun": "catalog:",
|
||||
"@types/node": "catalog:"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
"zod": "catalog:"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentui/core": ">=0.3.4",
|
||||
"@opentui/keymap": ">=0.3.4",
|
||||
"@opentui/solid": ">=0.3.4"
|
||||
"@opentui/core": "0.0.0-20260604-5b641b77",
|
||||
"@opentui/keymap": "0.0.0-20260604-5b641b77",
|
||||
"@opentui/solid": "0.0.0-20260604-5b641b77"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@opentui/core": {
|
||||
|
|
|
|||
|
|
@ -429,41 +429,48 @@ export function Session() {
|
|||
const maxTop = Math.max(0, scroll.scrollHeight - scroll.viewport.height)
|
||||
const filename = `session-${route.sessionID.slice(0, 8)}-render-state-${timestamp}.json`
|
||||
renderer.dumpBuffers(timestamp)
|
||||
await Filesystem.writeJson(path.join(process.cwd(), filename), {
|
||||
capturedAt: timestamp,
|
||||
channel: InstallationChannel,
|
||||
version: InstallationVersion,
|
||||
sessionID: route.sessionID,
|
||||
scroll: {
|
||||
top: scroll.scrollTop,
|
||||
height: scroll.scrollHeight,
|
||||
viewportHeight: scroll.viewport.height,
|
||||
maxTop,
|
||||
atBottom: scroll.scrollTop >= maxTop,
|
||||
},
|
||||
messages: messages().map((message) => ({
|
||||
id: message.id,
|
||||
role: message.role,
|
||||
parts: (sync.data.part[message.id] ?? []).map((part) => {
|
||||
const renderable = scroll.findDescendantById(`text-${part.id}`)
|
||||
return {
|
||||
id: part.id,
|
||||
type: part.type,
|
||||
...((part.type === "text" || part.type === "reasoning") && { textLength: part.text.length }),
|
||||
...(renderable && {
|
||||
renderable: {
|
||||
id: renderable.id,
|
||||
x: renderable.x,
|
||||
y: renderable.y,
|
||||
width: renderable.width,
|
||||
height: renderable.height,
|
||||
visible: renderable.visible,
|
||||
},
|
||||
await writeFile(
|
||||
path.join(process.cwd(), filename),
|
||||
`${JSON.stringify(
|
||||
{
|
||||
capturedAt: timestamp,
|
||||
channel: InstallationChannel,
|
||||
version: InstallationVersion,
|
||||
sessionID: route.sessionID,
|
||||
scroll: {
|
||||
top: scroll.scrollTop,
|
||||
height: scroll.scrollHeight,
|
||||
viewportHeight: scroll.viewport.height,
|
||||
maxTop,
|
||||
atBottom: scroll.scrollTop >= maxTop,
|
||||
},
|
||||
messages: messages().map((message) => ({
|
||||
id: message.id,
|
||||
role: message.role,
|
||||
parts: (sync.data.part[message.id] ?? []).map((part) => {
|
||||
const renderable = scroll.findDescendantById(`text-${part.id}`)
|
||||
return {
|
||||
id: part.id,
|
||||
type: part.type,
|
||||
...((part.type === "text" || part.type === "reasoning") && { textLength: part.text.length }),
|
||||
...(renderable && {
|
||||
renderable: {
|
||||
id: renderable.id,
|
||||
x: renderable.x,
|
||||
y: renderable.y,
|
||||
width: renderable.width,
|
||||
height: renderable.height,
|
||||
visible: renderable.visible,
|
||||
},
|
||||
}),
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
})),
|
||||
})
|
||||
})),
|
||||
},
|
||||
null,
|
||||
2,
|
||||
)}\n`,
|
||||
)
|
||||
toast.show({ message: `Session render state written to ${filename}`, variant: "success" })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue