feat(app): add chat outline navigation (#2792)
* feat(app): add chat outline navigation Long agent sessions need prompt navigation without coupling viewport movement to disposable server windows. Keep fetched timeline pages in client state so repeated jumps stay local, and settle prompt jumps against virtualized row measurement changes. * fix(app): preserve chat outline timeline coverage * fix(app): reconcile outline window submissions * fix(app): harden outline timeline navigation
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
isTimelineCatchUpComplete,
|
||||
isTimelineResumeSnapshotAuthoritative,
|
||||
planTimelineOlderFetch,
|
||||
planTimelinePromptJump,
|
||||
planTimelineTailFetch,
|
||||
} from "./timeline-sync-plan";
|
||||
|
||||
@@ -29,6 +30,19 @@ describe("timeline sync planning", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("an unloaded prompt jump merges a window with half a page newer than the target", () => {
|
||||
expect(planTimelinePromptJump({ epoch: "epoch-1", seq: 42 })).toEqual({
|
||||
direction: "before",
|
||||
cursor: {
|
||||
epoch: "epoch-1",
|
||||
seq: 42 + Math.floor(TIMELINE_FETCH_PAGE_SIZE / 2) + 1,
|
||||
},
|
||||
limit: TIMELINE_FETCH_PAGE_SIZE,
|
||||
projection: "projected",
|
||||
mergeWindow: true,
|
||||
});
|
||||
});
|
||||
|
||||
test("catch-up finishes when the daemon reports no newer rows", () => {
|
||||
expect(isTimelineCatchUpComplete({ direction: "after", hasNewer: false, error: null })).toBe(
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user