fix(tui): repainted ssh topology flips
- Added renderer hooks for first-result placeholder replacement and partial-result settle repaints.\n- Enabled the hooks for SSH and covered the streamed-placeholder and settle seams.\n\nFixes #4314
This commit is contained in:
@@ -63,6 +63,19 @@ export type ToolRenderer = {
|
||||
* with the final render and may commit like any settled stream.
|
||||
*/
|
||||
provisionalPartialResult?: boolean;
|
||||
/**
|
||||
* Whether replacing a streamed pending placeholder with the first result
|
||||
* requires a full viewport repaint. Use for merged renderers whose pending
|
||||
* streamed args may have committed placeholder rows that the result render
|
||||
* re-anchors instead of preserving.
|
||||
*/
|
||||
forceFirstResultViewportRepaint?: boolean;
|
||||
/**
|
||||
* Whether settling a provisional partial result into the final render requires
|
||||
* a full viewport repaint. Use when the result renderer changes chrome or
|
||||
* frame topology at `options.isPartial: true -> false`.
|
||||
*/
|
||||
forceResultViewportRepaintOnSettle?: boolean;
|
||||
};
|
||||
|
||||
export const toolRenderers: Record<string, ToolRenderer> = {
|
||||
|
||||
@@ -392,4 +392,12 @@ export const sshToolRenderer = {
|
||||
// land below and strand a duplicate pending header above the final frame
|
||||
// ([#3177](https://github.com/can1357/oh-my-pi/issues/3177)).
|
||||
provisionalPartialResult: true,
|
||||
// Streamed args can initially render the SSH placeholder (`⏳ SSH: […]` /
|
||||
// `$ …`), then the first partial result inserts the `Output` section and
|
||||
// re-anchors the frame. Force a full repaint at that seam so placeholder rows
|
||||
// do not survive in viewport/native scrollback.
|
||||
forceFirstResultViewportRepaint: true,
|
||||
// The provisional pending-result frame settles into the final `⇄ SSH: [host]`
|
||||
// frame, so clear/replay the viewport at that topology flip too.
|
||||
forceResultViewportRepaintOnSettle: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user