@oh-my-pi/pi-tui 17.4.2 → 18.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -363,11 +363,8 @@ export class ImageBudget {
363
363
  * Restart every placement epoch after a destructive history clear (`CSI 3 J`
364
364
  * full paint). The clear destroys all placement cells — scrollback rows are
365
365
  * gone and the replay rewrites the viewport — so no archive remains to
366
- * protect. Reverting to epoch 1 lets the replay's placements replace the
367
- * terminal's stale registry entries; the returned list names every image
368
- * and the highest epoch it reached so the caller can delete all of its
369
- * registry entries explicitly (`d=i` keeps the transmitted data) — an image
370
- * absent from the replay never re-places, so even its epoch-1 entry must go.
366
+ * protect. Reverting to epoch 1 lets the replay recreate every visible
367
+ * placement after the terminal-wide cleanup.
371
368
  */
372
369
  resetPlacementEpochs(): ReadonlyArray<{ imageId: number; lastEpoch: number }> {
373
370
  let stale: Array<{ imageId: number; lastEpoch: number }> | undefined;
@@ -532,7 +529,8 @@ export class Image implements Component {
532
529
  this.#cachedImageProtocol === imageProtocol &&
533
530
  this.#cachedCellWidthPx === cellDimensions.widthPx &&
534
531
  this.#cachedCellHeightPx === cellDimensions.heightPx &&
535
- this.#cachedKittyUnicodePlaceholders === kittyUnicodePlaceholders
532
+ this.#cachedKittyUnicodePlaceholders === kittyUnicodePlaceholders &&
533
+ (this.#imageId == null || this.#budget?.shouldTransmit(this.#imageId) !== true)
536
534
  ) {
537
535
  return this.#cachedLines;
538
536
  }
@@ -160,14 +160,6 @@ export class Loader extends Text {
160
160
  if (!this.#ui) {
161
161
  return;
162
162
  }
163
- // Direct write: a loader tick changes only this component, so the TUI can
164
- // update the already-positioned rows without driving the full
165
- // compose/prepare/diff pipeline. Lightweight test stubs may not carry the
166
- // newer API; keep their legacy component-scoped path working.
167
- if (typeof this.#ui.requestDirectWrite === "function") {
168
- this.#ui.requestDirectWrite(this);
169
- } else {
170
- this.#ui.requestComponentRender(this);
171
- }
163
+ this.#ui.requestComponentRender(this);
172
164
  }
173
165
  }