pi-fabric 0.132.0 → 0.132.2

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.
@@ -4321,10 +4321,11 @@ var widgetRowLimit = (maxRows, terminalRows) => {
4321
4321
  var widgetFocusedRowLimit = (maxRows, terminalRows) => widgetRowLimit(maxRows, terminalRows);
4322
4322
  var widgetViewport = (contentRows, budget, offset) => {
4323
4323
  const available = Math.max(0, Math.floor(budget));
4324
- const hasCue = contentRows > available && available > 1;
4324
+ const maxOffset = available > 0 ? Math.max(0, contentRows - available) : 0;
4325
+ const clampedOffset = Math.max(0, Math.min(maxOffset, Math.floor(offset)));
4326
+ const hasCue = clampedOffset < maxOffset && available > 1;
4325
4327
  const windowRows = Math.max(0, available - Number(hasCue));
4326
- const maxOffset = windowRows > 0 ? Math.max(0, contentRows - windowRows) : 0;
4327
- return { windowRows, hasCue, maxOffset, offset: Math.max(0, Math.min(maxOffset, Math.floor(offset))) };
4328
+ return { windowRows, hasCue, maxOffset, offset: clampedOffset };
4328
4329
  };
4329
4330
  var HEADER_ROW = "\0main";
4330
4331
  var FabricWidget = class {
@@ -4520,7 +4521,7 @@ var FabricWidget = class {
4520
4521
  const header = headerWidth === width ? lines[0] ?? "" : this.#content(snapshot, width, headerWidth).lines[0] ?? "";
4521
4522
  const boundedHeader = label ? this.#withRightLabel(header, label, width) : truncateToWidth3(header, width);
4522
4523
  const visibleLines = [boundedHeader, ...lines.slice(start, start + capacity).map((line) => truncateToWidth3(line, width))];
4523
- if (viewport.hasCue) visibleLines.push(below > 0 ? truncateToWidth3(this.theme.fg("dim", `\u2193 ${below} more`), width) : "");
4524
+ if (viewport.hasCue) visibleLines.push(truncateToWidth3(this.theme.fg("dim", `\u2193 ${below} more`), width));
4524
4525
  this.#rows = rows.filter((row) => row.line === 0 || row.line >= start && row.line < start + capacity).map((row) => ({ ...row, line: row.line === 0 ? 0 : row.line - start + 1 }));
4525
4526
  if (rows.length === 0 && this.interaction?.collapseIdle?.()) return [];
4526
4527
  this.#spacerRows = spacer;
@@ -7003,4 +7004,4 @@ export {
7003
7004
  FABRIC_MANAGED_HOST_VERSION,
7004
7005
  createFabricExtension
7005
7006
  };
7006
- //# sourceMappingURL=chunk-DQUSFEJL.js.map
7007
+ //# sourceMappingURL=chunk-UJPP3EVE.js.map