The open source coding agent.
TypeScript
chore: cleanup
Adamb19a424c85eb
diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsxindex 2fa9cf47488..0669f2ec16a 100644--- a/packages/ui/src/components/message-part.tsx+++ b/packages/ui/src/components/message-part.tsx@@ -502,7 +502,6 @@ ToolRegistry.register({render(props) {const diffComponent = useDiffComponent()const diagnostics = createMemo(() => getDiagnostics(props.metadata.diagnostics, props.input.filePath))- console.log(props)return (<BasicTool{...props}diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsxindex f101a3aa471..bd65ffdc107 100644--- a/packages/ui/src/components/session-turn.tsx+++ b/packages/ui/src/components/session-turn.tsx@@ -271,7 +271,6 @@ export function SessionTurn(const scrollTop = scrollRef.scrollTopconst scrollHeight = scrollRef.scrollHeight- // If we're in a reflow state (width just changed), don't interpret as user scrollif (store.reflowing) {batch(() => {setStore("lastScrollTop", scrollTop)@@ -280,19 +279,13 @@ export function SessionTurn(return}- // Check if this looks like a reflow-induced scroll adjustment- // When width changes, scrollHeight changes and browser adjusts scrollTop proportionallyconst scrollHeightChanged = Math.abs(scrollHeight - store.lastScrollHeight) > 10const scrollTopDelta = scrollTop - store.lastScrollTop- // If scrollHeight decreased (content got shorter due to wider width),- // and scrollTop decreased proportionally, this is reflow, not user scrollif (scrollHeightChanged && scrollTopDelta < 0) {const heightRatio = store.lastScrollHeight > 0 ? scrollHeight / store.lastScrollHeight : 1const expectedScrollTop = store.lastScrollTop * heightRatio- const tolerance = 100 // Allow some tolerance for the adjustment- if (Math.abs(scrollTop - expectedScrollTop) < tolerance) {- // This is a proportional adjustment from reflow, not user scrolling+ if (Math.abs(scrollTop - expectedScrollTop) < 100) {batch(() => {setStore("lastScrollTop", scrollTop)setStore("lastScrollHeight", scrollHeight)@@ -311,7 +304,6 @@ export function SessionTurn(return}- // Only count as user scroll if scrollTop decreased without a corresponding scrollHeight changeconst scrolledUp = scrollTop < store.lastScrollTop - 50 && !scrollHeightChangedif (scrolledUp && working()) {setStore("userScrolled", true)@@ -346,28 +338,22 @@ export function SessionTurn(})}- // Track width changes to detect reflow situationscreateResizeObserver(() => store.contentRef,({ width }) => {const widthChanged = Math.abs(width - store.lastContainerWidth) > 5if (widthChanged && store.lastContainerWidth > 0) {- // Width changed - mark as reflowing to ignore scroll adjustmentssetStore("reflowing", true)- // Clear reflow state after browser has had time to adjustrequestAnimationFrame(() => {requestAnimationFrame(() => {setStore("reflowing", false)- // Restore auto-scroll if we're still workingif (working() && !store.userScrolled) {scrollToBottom()}})})- } else {- if (!store.reflowing) {- scrollToBottom()- }+ } else if (!store.reflowing) {+ scrollToBottom()}setStore("lastContainerWidth", width)},