Skip to content

The agent that grows with you

fix(desktop): share transcript budget across panes

KoNit-K887cdec4f249
diff --git a/apps/desktop/src/components/assistant-ui/thread/list.test.ts b/apps/desktop/src/components/assistant-ui/thread/list.test.ts
index 3b277cd1a4c..94ed305258c 100644
--- a/apps/desktop/src/components/assistant-ui/thread/list.test.ts
+++ b/apps/desktop/src/components/assistant-ui/thread/list.test.ts
@@ -102,6 +102,11 @@ describe('transcriptPaneBudget', () => {
expect(transcriptPaneBudget(4, true)).toBe(HIDDEN_TRANSCRIPT_RENDER_BUDGET)
expect(transcriptPaneBudget(1, false)).toBeGreaterThan(HIDDEN_TRANSCRIPT_RENDER_BUDGET)
})
+
+ it('shares the visible page budget across five and six mounted panes', () => {
+ expect(transcriptPaneBudget(5, false)).toBe(120)
+ expect(transcriptPaneBudget(6, false)).toBe(100)
+ })
})
describe('shouldClampTranscriptBudget', () => {
diff --git a/apps/desktop/src/components/assistant-ui/thread/list.tsx b/apps/desktop/src/components/assistant-ui/thread/list.tsx
index cef47312320..81c80d0233b 100644
--- a/apps/desktop/src/components/assistant-ui/thread/list.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/list.tsx
@@ -88,8 +88,8 @@ const RENDER_BUDGET = 600
// over ALL of them — measured as the 4-zone collapse in the long-session
// matrix (worst-second 8fps while 1-2 zones held 50+). Sharing the budget
// keeps "screens of scrollback" constant instead of "turns per pane": a pane
-// a quarter the height gets a quarter the page, floored at a quarter budget
-// (MIN_VISIBLE_GROUPS still floors the turn count regardless of weight).
+// gets its proportional share of the page (MIN_VISIBLE_GROUPS still floors the
+// turn count regardless of weight).
// Panes that already backfilled keep their mounted content when the count
// changes — the share only caps where NEW backfills stop.
const $mountedTranscriptPanes = atom(0)
@@ -118,9 +118,7 @@ const FIRST_PAINT_BUDGET = 20
export const HIDDEN_TRANSCRIPT_RENDER_BUDGET = 40
export const transcriptPaneBudget = (mountedPanes: number, hidden: boolean): number =>
- hidden
- ? HIDDEN_TRANSCRIPT_RENDER_BUDGET
- : Math.max(Math.ceil(RENDER_BUDGET / Math.max(1, mountedPanes)), RENDER_BUDGET / 4)
+ hidden ? HIDDEN_TRANSCRIPT_RENDER_BUDGET : Math.ceil(RENDER_BUDGET / Math.max(1, mountedPanes))
// "Show earlier" raises renderBudget ABOVE paneBudget (one pane page per click).
// The render-phase cap must only snap a hot-hidden pane down to its retention