perf(tui): shrink standalone builds and target native bindings (#6432)

* perf(tui): shrink standalone builds without dropping features

* fix(tui): resolve macOS diagram fonts through CoreText

* fix(webui): preserve history pagination at the page boundary

* docs(tui): streamline release preflight guidance

---------

Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
This commit is contained in:
chengyongruandXubin Ren authored and GitHub committed 2026-10-24 22:00:50 +08:00
1 parent 0e0df327c8
commit ae7fed88e2
21 files changed
+424 -82

No files matched your search

@@ -903,7 +903,8 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
if (el.scrollTop > 1) historySpringRef.current?.leaveBoundary();
const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
const near = distance < NEAR_BOTTOM_PX;
const owner = threadMotionRef.current?.observeScroll(near) ?? "automatic";
// A detached history page's bottom is not the live tail.
const owner = threadMotionRef.current?.observeScroll(near && !historyWindow) ?? "automatic";
const logicallyAtBottom = !historyWindow && (owner === "automatic" || (owner === "navigation" && near));
setAtBottom((current) =>
current === logicallyAtBottom ? current : logicallyAtBottom,
@@ -942,7 +943,7 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
}
threadMotionRef.current?.handleUserScrollIntent(
canScrollInDirection(el, direction),
direction === "forward",
direction === "forward" && !historyWindow,
);
};
const prepareHistoryPull = () => {
@@ -1026,11 +1027,7 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
setAtHistoryTop(true);
return;
}
// Locally windowed messages need no network gesture or loading feedback.
if (hiddenMessageCount > 0) handleDirectionalInput(directionFromDelta(delta));
else threadMotionRef.current?.handleUserScrollIntent(
canScrollInDirection(el, directionFromDelta(delta)), delta > 0,
);
handleDirectionalInput(directionFromDelta(delta));
};
const handleTouchEnd = () => {
const pulling = historyTouchRef.current?.pulling;
+7 -6
View File
@@ -342,13 +342,14 @@ export class ThreadMotionCoordinator {
* A scroll event reports geometry; it does not prove user intent. Explicit
* input handlers call takeUserControl() before the browser scrolls. Layout,
* sticky positioning, and camera writes therefore remain automatic even
* when the browser emits an intermediate scroll event for them.
* when the browser emits an intermediate scroll event for them. Proximity
* to a detached history page's bottom must not count as near the live tail.
*/
observeScroll(nearBottom: boolean): ThreadScrollOwner {
observeScroll(nearLiveTail: boolean): ThreadScrollOwner {
switch (this.mode) {
case "navigating-latest":
if (!this.camera.isFollowing()) {
if (nearBottom) {
if (nearLiveTail) {
this.settleLatestNavigation();
} else {
this.invalidateGeometry();
@@ -358,7 +359,7 @@ export class ThreadMotionCoordinator {
case "navigating-history":
if (!this.camera.isFollowing()) {
this.transition("navigation-settled");
if (nearBottom) {
if (nearLiveTail) {
this.resumeAutoFollow();
} else {
this.resumeFollowArmed = true;
@@ -366,7 +367,7 @@ export class ThreadMotionCoordinator {
}
return "navigation";
case "browsing-history":
if (!nearBottom) {
if (!nearLiveTail) {
this.resumeFollowArmed = true;
return "user";
}
@@ -374,7 +375,7 @@ export class ThreadMotionCoordinator {
this.resumeAutoFollow();
return "automatic";
default:
if (!nearBottom) this.invalidateGeometry();
if (!nearLiveTail) this.invalidateGeometry();
return "automatic";
}
}