fix(webui): show latest button for hidden content (#6605)
* fix(webui): show latest button for hidden content * fix(webui): preserve latest navigation after focus scroll
This commit is contained in:
1 parent
c5f2ce5089
commit
f62dfe0ee8
7 files changed
+243
-23
No files matched your search
@@ -44,6 +44,7 @@ const THREAD_MOTION_TRANSITIONS: Readonly<
|
||||
"resume-follow": "current-automatic-mode",
|
||||
},
|
||||
"follow-latest": {
|
||||
"navigate-latest": "navigating-latest",
|
||||
"navigate-history": "navigating-history",
|
||||
"user-scroll": "browsing-history",
|
||||
},
|
||||
@@ -134,6 +135,7 @@ interface ThreadMotionCoordinatorOptions {
|
||||
measure: (promptId: string | null) => ThreadMotionGeometry | null;
|
||||
onGeometry?: (geometry: ThreadMotionGeometry) => void;
|
||||
onAutoFollow?: () => void;
|
||||
onLatestNavigationSettled?: () => void;
|
||||
scheduler?: ThreadMotionScheduler;
|
||||
}
|
||||
|
||||
@@ -159,6 +161,7 @@ export class ThreadMotionCoordinator {
|
||||
private readonly measure: ThreadMotionCoordinatorOptions["measure"];
|
||||
private readonly onGeometry?: ThreadMotionCoordinatorOptions["onGeometry"];
|
||||
private readonly onAutoFollow?: ThreadMotionCoordinatorOptions["onAutoFollow"];
|
||||
private readonly onLatestNavigationSettled?: () => void;
|
||||
private readonly scheduler: ThreadMotionScheduler;
|
||||
private turn: ThreadMotionTurn = {
|
||||
id: null,
|
||||
@@ -180,6 +183,7 @@ export class ThreadMotionCoordinator {
|
||||
this.measure = options.measure;
|
||||
this.onGeometry = options.onGeometry;
|
||||
this.onAutoFollow = options.onAutoFollow;
|
||||
this.onLatestNavigationSettled = options.onLatestNavigationSettled;
|
||||
this.scheduler = options.scheduler ?? defaultScheduler();
|
||||
}
|
||||
|
||||
@@ -330,6 +334,13 @@ export class ThreadMotionCoordinator {
|
||||
return result;
|
||||
}
|
||||
|
||||
cameraSettled(): void {
|
||||
if (this.mode === "navigating-latest") {
|
||||
this.settleLatestNavigation();
|
||||
this.onLatestNavigationSettled?.();
|
||||
}
|
||||
}
|
||||
|
||||
isAutoFollowPaused(): boolean {
|
||||
return this.isHistoryMode();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user