kimi-code/packages
liruifengv 23daf0f3c1
revert(pi-tui): restore upstream differential rendering behavior (#1367)
* fix(pi-tui): make the viewport anchor follow above-viewport content shifts

The anchor pins a buffer row index, but an above-viewport length change
shifts the content living at every index below it. The pinned window
then suddenly showed content further along (visible upward creep), and
the rows that slid above the window top were lost: never committed to
scrollback, which holds older bytes at those indices. During streaming,
every above-viewport net shrink (a finished agent row collapsing, a
merged step, a spinner line disappearing) permanently swallowed that
many rows, and the blank area under the input box kept growing.

doRender now scores two hypotheses for such frames — window stayed put
vs window content shifted by the length delta — and when the shift
explains the frame strictly better, moves the anchor with the content:
a pure shift re-anchors with no painting at all (the screen already
shows exactly that content), and a shift with local in-window changes
(spinner/timer rows) repaints the window at the shifted anchor.
Commit order stays continuous, so the exactly-once scrollback invariant
is preserved: no loss, no duplication.

Covered by e2e case07 (above-viewport shift), which fails on the
previous revision; the stale-content unit test now asserts the
follow-the-content window instead of the old swallowed-row behavior.

* revert(pi-tui): restore upstream differential rendering behavior

The fork's viewport/scrollback rendering patches (clamping the diff to
the visible viewport, viewport re-anchoring on collapse, the pinned
anchor with commit-on-advance, cursor visibility guarding, and the
content-shift anchor follow) accumulated interacting edge cases faster
than they could be stabilized: blank screens, duplicated scrollback
spans, vanished rows, and a growing blank area under the input box.

Revert src/tui.ts to the upstream 0.80.2 differential rendering
behavior: a change above the viewport triggers a destructive full
redraw again. Verified line-by-line against the upstream source — the
only remaining divergences are the TypeScript strict-mode syntax
adaptations and the narrow-terminal fixes (Container width clamping
and overwide-line truncation replacing the upstream crash-and-throw),
which are kept.

Also remove the rendering-bug e2e ledger and the shrink test suite
that specified the reverted behavior, restore the pre-fork rendering
tests (the transient-content test asserts the upstream full-redraw
behavior again), and drop the e2e glob from the test script. Editor
input-history and paste-burst changes are untouched.

Known trade-off, accepted for now: the original scroll-position yank
during streaming (destructive redraws emitting ESC[3J) returns; the
rendering rework will restart from this clean baseline.

* chore: downgrade the web thinking-effort changeset to patch
2026-07-04 17:57:43 +08:00
..
acp-adapter feat(agent-core): announce image compression and keep originals readable (#1304) 2026-07-02 19:07:56 +08:00
agent-core ci: release packages (#1334) 2026-07-03 23:51:39 +08:00
kaos fix(kaos): enrich PATH from the user's login shell at startup (#1339) 2026-07-03 15:20:38 +08:00
kimi-migration-legacy feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
kosong fix(agent-core): harden tool_use/tool_result exchange integrity (#1340) 2026-07-03 14:26:57 +08:00
migration-legacy chore(agent-core): remove experimental micro compaction (#1317) 2026-07-02 19:50:51 +08:00
node-sdk ci: release packages (#1334) 2026-07-03 23:51:39 +08:00
oauth feat: add model alias overrides (#1262) 2026-07-01 19:57:13 +08:00
pi-tui revert(pi-tui): restore upstream differential rendering behavior (#1367) 2026-07-04 17:57:43 +08:00
protocol feat(agent-core): keep head and tail of user messages during compaction (#1313) 2026-07-02 19:24:37 +08:00
server fix(web): make uploaded videos play in the chat (#1343) 2026-07-04 00:36:00 +08:00
server-e2e fix(web): stop auto-dismissing pending questions and approvals on a timeout (#1070) 2026-06-24 19:15:06 +08:00
telemetry ci: run unit tests on windows (#1037) 2026-06-26 11:56:41 +08:00