mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-09 23:58:31 +00:00
Apply PR #30815: opentui with native yoga layout
This commit is contained in:
commit
af68dca0d8
3 changed files with 426 additions and 523 deletions
|
|
@ -134,9 +134,9 @@
|
||||||
"electron"
|
"electron"
|
||||||
],
|
],
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@opentui/core": "catalog:",
|
"@opentui/core": "0.0.0-20260604-5b641b77",
|
||||||
"@opentui/keymap": "catalog:",
|
"@opentui/keymap": "0.0.0-20260604-5b641b77",
|
||||||
"@opentui/solid": "catalog:",
|
"@opentui/solid": "0.0.0-20260604-5b641b77",
|
||||||
"@types/bun": "catalog:",
|
"@types/bun": "catalog:",
|
||||||
"@types/node": "catalog:"
|
"@types/node": "catalog:"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -422,41 +422,48 @@ export function Session() {
|
||||||
const maxTop = Math.max(0, scroll.scrollHeight - scroll.viewport.height)
|
const maxTop = Math.max(0, scroll.scrollHeight - scroll.viewport.height)
|
||||||
const filename = `session-${route.sessionID.slice(0, 8)}-render-state-${timestamp}.json`
|
const filename = `session-${route.sessionID.slice(0, 8)}-render-state-${timestamp}.json`
|
||||||
renderer.dumpBuffers(timestamp)
|
renderer.dumpBuffers(timestamp)
|
||||||
await Filesystem.writeJson(path.join(process.cwd(), filename), {
|
await writeFile(
|
||||||
capturedAt: timestamp,
|
path.join(process.cwd(), filename),
|
||||||
channel: InstallationChannel,
|
JSON.stringify(
|
||||||
version: InstallationVersion,
|
{
|
||||||
sessionID: route.sessionID,
|
capturedAt: timestamp,
|
||||||
scroll: {
|
channel: InstallationChannel,
|
||||||
top: scroll.scrollTop,
|
version: InstallationVersion,
|
||||||
height: scroll.scrollHeight,
|
sessionID: route.sessionID,
|
||||||
viewportHeight: scroll.viewport.height,
|
scroll: {
|
||||||
maxTop,
|
top: scroll.scrollTop,
|
||||||
atBottom: scroll.scrollTop >= maxTop,
|
height: scroll.scrollHeight,
|
||||||
},
|
viewportHeight: scroll.viewport.height,
|
||||||
messages: messages().map((message) => ({
|
maxTop,
|
||||||
id: message.id,
|
atBottom: scroll.scrollTop >= maxTop,
|
||||||
role: message.role,
|
},
|
||||||
parts: (sync.data.part[message.id] ?? []).map((part) => {
|
messages: messages().map((message) => ({
|
||||||
const renderable = scroll.findDescendantById(`text-${part.id}`)
|
id: message.id,
|
||||||
return {
|
role: message.role,
|
||||||
id: part.id,
|
parts: (sync.data.part[message.id] ?? []).map((part) => {
|
||||||
type: part.type,
|
const renderable = scroll.findDescendantById(`text-${part.id}`)
|
||||||
...((part.type === "text" || part.type === "reasoning") && { textLength: part.text.length }),
|
return {
|
||||||
...(renderable && {
|
id: part.id,
|
||||||
renderable: {
|
type: part.type,
|
||||||
id: renderable.id,
|
...((part.type === "text" || part.type === "reasoning") && { textLength: part.text.length }),
|
||||||
x: renderable.x,
|
...(renderable && {
|
||||||
y: renderable.y,
|
renderable: {
|
||||||
width: renderable.width,
|
id: renderable.id,
|
||||||
height: renderable.height,
|
x: renderable.x,
|
||||||
visible: renderable.visible,
|
y: renderable.y,
|
||||||
},
|
width: renderable.width,
|
||||||
|
height: renderable.height,
|
||||||
|
visible: renderable.visible,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
}
|
})),
|
||||||
}),
|
},
|
||||||
})),
|
null,
|
||||||
})
|
2,
|
||||||
|
),
|
||||||
|
)
|
||||||
toast.show({ message: `Session render state written to ${filename}`, variant: "success" })
|
toast.show({ message: `Session render state written to ${filename}`, variant: "success" })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue