mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-09 21:58:28 +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"
|
||||
],
|
||||
"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:"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -422,41 +422,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,
|
||||
),
|
||||
)
|
||||
toast.show({ message: `Session render state written to ${filename}`, variant: "success" })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue