Bläddra i källkod

fix(tui): preserve subagent list position (#39156)

Co-authored-by: Kit Langton <kit.langton@gmail.com>
opencode-agent[bot] 2 veckor sedan
förälder
incheckning
f5700808c5
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      packages/tui/src/routes/session/composer/subagents-tab.tsx

+ 2 - 1
packages/tui/src/routes/session/composer/subagents-tab.tsx

@@ -103,7 +103,8 @@ export function SubagentsTab(props: { sessionID: string }) {
       setStore("selected", next)
       const scrollCurrentIntoView = () => scrollToIndex(next, true)
       scrollCurrentIntoView()
-      requestAnimationFrame(scrollCurrentIntoView)
+      // The remounted scrollbox finishes layout on the next frame and resets its scroll position.
+      requestAnimationFrame(() => requestAnimationFrame(scrollCurrentIntoView))
     }
     wasActive = true
     if (store.selected >= list.length) moveTo(Math.max(0, list.length - 1))