@cplieger/web-terminal-ui 6.1.4 → 7.0.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cplieger/web-terminal-ui",
3
- "version": "6.1.4",
3
+ "version": "7.0.0",
4
4
  "type": "module",
5
5
  "description": "Reference touch-first browser UI for @cplieger/web-terminal-engine: a composable kernel + feature modules (tabs, activity monitor, mobile toolbar, context menu, IME, predictive echo, viewport handling) and CSS. One createTerminal() call.",
6
6
  "license": "MPL-2.0",
@@ -40,7 +40,7 @@
40
40
  "verify": "bash scripts/verify.sh"
41
41
  },
42
42
  "peerDependencies": {
43
- "@cplieger/web-terminal-engine": "^3.10.0 || ^4.0.0 || ^5.0.0"
43
+ "@cplieger/web-terminal-engine": "^5.0.3"
44
44
  },
45
45
  "overrides": {
46
46
  "qs": "^6.15.2"
@@ -52,7 +52,7 @@
52
52
  "@stryker-mutator/vitest-runner": "10.0.0",
53
53
  "@types/node": "26.2.0",
54
54
  "@typescript/native": "npm:typescript@7.0.2",
55
- "@vitest/coverage-v8": "4.1.10",
55
+ "@vitest/coverage-v8": "4.1.11",
56
56
  "eslint": "10.8.1",
57
57
  "fast-check": "4.9.0",
58
58
  "happy-dom": "20.11.2",
@@ -63,7 +63,7 @@
63
63
  "stylelint-config-standard": "40.0.0",
64
64
  "typescript": "npm:@typescript/typescript6@6.0.2",
65
65
  "typescript-eslint": "8.67.0",
66
- "vitest": "4.1.10"
66
+ "vitest": "4.1.11"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public"
@@ -47,7 +47,16 @@ export function scrollToBottom(): TerminalFeature {
47
47
  ctx.scroll.scrollToBottom();
48
48
  return;
49
49
  }
50
- surface.scrollTo({ top: surface.scrollHeight, behavior: "smooth" });
50
+ // Target the MAXIMUM offset, not scrollHeight. An over-scroll target is
51
+ // one clientHeight past the end and needs the container to clamp it,
52
+ // which is the assumption the engine's own bottom writes stopped making:
53
+ // clamping an offset the content shrank out from under is an
54
+ // implementation behaviour and WebKit does not do it. The line above
55
+ // already computes the maximum, so this is the same arithmetic said once.
56
+ surface.scrollTo({
57
+ top: surface.scrollHeight - surface.clientHeight,
58
+ behavior: "smooth",
59
+ });
51
60
  };
52
61
 
53
62
  // pointerdown (like the toolbar keys) so touch devices get the jump on the
@@ -601,7 +601,13 @@ function buildTerminal(
601
601
 
602
602
  connection.init({
603
603
  computeSize: render.computeSize,
604
- getHaveThrough: render.getHighestIndex,
604
+ // getHaveThrough is deliberately NOT supplied. The engine defaults it to its
605
+ // own renderer (engine >= 5.0.3), which is the only party that knows which
606
+ // store is currently bound and which of its rows the server has confirmed.
607
+ // Supplying it from here is what claimed rows the application had merely
608
+ // DRAWN — `render.getHighestIndex` is the window's bottom row — and left a
609
+ // frozen copy of the composer parked in scrollback on almost every reattach.
610
+ // An explicit member wins over the default, so re-adding one reopens that.
605
611
  // --- Demand-paged scrollback (engine docs/paged-scrollback.md §4-5) ---
606
612
  // The transport is store-blind and viewport-blind by design, so every one of
607
613
  // these forwards a decision only the renderer can make. Without them the
@@ -811,7 +817,12 @@ function buildTerminal(
811
817
  case "scroll-down": {
812
818
  ev.preventDefault();
813
819
  const h = termWrap.clientHeight;
814
- termWrap.scrollTop = Math.min(termWrap.scrollHeight, termWrap.scrollTop + h);
820
+ // The ceiling is the maximum offset, not scrollHeight: the latter is one
821
+ // clientHeight past the end, so a page-down near the bottom handed the
822
+ // container an out-of-range offset and relied on it to clamp. Same
823
+ // reasoning as the engine's bottom writes.
824
+ const max = Math.max(0, termWrap.scrollHeight - h);
825
+ termWrap.scrollTop = Math.min(max, termWrap.scrollTop + h);
815
826
  return true;
816
827
  }
817
828
  case "ignore":