fix(tui): flushed queued image transmits before alt-screen frame paints

- Drained `#imageBudget.takeTransmits()` and wrote the queued `a=t` sequences ahead of the paint in `TUI.#emitAltFrame`, matching the normal-screen path, so id-keyed placements and placeholder cells composed into the frame resolve against loaded data.
- Fixed images first shown inside a fullscreen overlay (e.g. the settings shape preview) rendering as blank placeholder cells until the overlay closed.
This commit is contained in:
can1357
2026-06-12 07:36:43 +02:00
parent 118f32d37f
commit 662823c40c
+12
View File
@@ -2712,6 +2712,18 @@ export class TUI extends Container {
#emitAltFrame(lines: string[], width: number, height: number): void {
const fitted: string[] = new Array(height);
for (let r = 0; r < height; r++) fitted[r] = lines[r] ?? "";
// Flush queued image-data transmits (`a=t`, no visible output) before the
// paint so id-keyed placements and placeholder cells composed into this
// frame resolve against loaded data. The normal-screen path flushes these
// ahead of its paint; without this, an image first shown inside a
// fullscreen overlay (e.g. the settings shape preview) would render as
// blank placeholder cells until the overlay closed.
const imageTransmits = this.#imageBudget.takeTransmits();
if (imageTransmits.length > 0) {
let transmitBuffer = "";
for (const seq of imageTransmits) transmitBuffer += seq;
this.terminal.write(transmitBuffer);
}
// Skip an identical repaint (the modal is mostly static between
// keystrokes) — unless a forced repaint (resetDisplay,
// requestRender(true)) is pending: the redraw gesture must repair a