@@ -7,7 +7,7 @@ import { useSpring } from "@opencode-ai/ui/motion-spring"
77import { TextReveal } from "@opencode-ai/ui/text-reveal"
88import { TextStrikethrough } from "@opencode-ai/ui/text-strikethrough"
99import { createResizeObserver } from "@solid-primitives/resize-observer"
10- import { Index , createEffect , createMemo , on , onCleanup } from "solid-js"
10+ import { Index , createEffect , createMemo , onCleanup } from "solid-js"
1111import { createStore } from "solid-js/store"
1212import { composerEnabled , composerProbe } from "@/testing/session-composer"
1313import { useLanguage } from "@/context/language"
@@ -210,76 +210,25 @@ export function SessionTodoDock(props: {
210210 opacity : `${ Math . max ( 0 , Math . min ( 1 , 1 - hide ( ) ) ) } ` ,
211211 } }
212212 >
213- < TodoList todos = { props . todos } open = { ! store . collapsed } />
213+ < TodoList todos = { props . todos } />
214214 </ div >
215215 </ div >
216216 </ DockTray >
217217 )
218218}
219219
220- function TodoList ( props : { todos : Todo [ ] ; open : boolean } ) {
220+ function TodoList ( props : { todos : Todo [ ] } ) {
221221 const [ store , setStore ] = createStore ( {
222222 stuck : false ,
223- scrolling : false ,
224- } )
225- let scrollRef ! : HTMLDivElement
226- let timer : number | undefined
227-
228- const inProgress = createMemo ( ( ) => props . todos . findIndex ( ( todo ) => todo . status === "in_progress" ) )
229-
230- const ensure = ( ) => {
231- if ( ! props . open ) return
232- if ( store . scrolling ) return
233- if ( ! scrollRef || scrollRef . offsetParent === null ) return
234-
235- const el = scrollRef . querySelector ( "[data-in-progress]" )
236- if ( ! ( el instanceof HTMLElement ) ) return
237-
238- const topFade = 16
239- const bottomFade = 44
240- const container = scrollRef . getBoundingClientRect ( )
241- const rect = el . getBoundingClientRect ( )
242- const top = rect . top - container . top + scrollRef . scrollTop
243- const bottom = rect . bottom - container . top + scrollRef . scrollTop
244- const viewTop = scrollRef . scrollTop + topFade
245- const viewBottom = scrollRef . scrollTop + scrollRef . clientHeight - bottomFade
246-
247- if ( top < viewTop ) {
248- scrollRef . scrollTop = Math . max ( 0 , top - topFade )
249- } else if ( bottom > viewBottom ) {
250- scrollRef . scrollTop = bottom - ( scrollRef . clientHeight - bottomFade )
251- }
252-
253- setStore ( "stuck" , scrollRef . scrollTop > 0 )
254- }
255-
256- createEffect (
257- on ( [ ( ) => props . open , inProgress ] , ( ) => {
258- if ( ! props . open || inProgress ( ) < 0 ) return
259- requestAnimationFrame ( ensure )
260- } ) ,
261- )
262-
263- onCleanup ( ( ) => {
264- if ( ! timer ) return
265- window . clearTimeout ( timer )
266223 } )
267224
268225 return (
269226 < div class = "relative" >
270227 < div
271228 class = "px-3 pb-11 flex flex-col gap-1.5 max-h-42 overflow-y-auto no-scrollbar"
272- ref = { scrollRef }
273229 style = { { "overflow-anchor" : "none" } }
274230 onScroll = { ( e ) => {
275231 setStore ( "stuck" , e . currentTarget . scrollTop > 0 )
276- setStore ( "scrolling" , true )
277- if ( timer ) window . clearTimeout ( timer )
278- timer = window . setTimeout ( ( ) => {
279- setStore ( "scrolling" , false )
280- if ( inProgress ( ) < 0 ) return
281- requestAnimationFrame ( ensure )
282- } , 250 )
283232 } }
284233 >
285234 < Index each = { props . todos } >
0 commit comments