diff --git a/packages/app/src/components/dialog-release-notes.tsx b/packages/app/src/components/dialog-release-notes.tsx index e83bc754d..7c642d3f1 100644 --- a/packages/app/src/components/dialog-release-notes.tsx +++ b/packages/app/src/components/dialog-release-notes.tsx @@ -1,4 +1,4 @@ -import { createSignal } from "solid-js" +import { createEffect, createSignal } from "solid-js" import { Dialog } from "@opencode-ai/ui/dialog" import { Button } from "@opencode-ai/ui/button" import { useDialog } from "@opencode-ai/ui/context/dialog" @@ -20,6 +20,7 @@ export function DialogReleaseNotes(props: { highlights: Highlight[] }) { const language = useLanguage() const settings = useSettings() const [index, setIndex] = createSignal(0) + let descriptionRef: HTMLParagraphElement | undefined const total = () => props.highlights.length const last = () => Math.max(0, total() - 1) @@ -28,6 +29,14 @@ export function DialogReleaseNotes(props: { highlights: Highlight[] }) { const isLast = () => index() >= last() const paged = () => total() > 1 + createEffect(() => { + // Reset scroll position when page changes + index() + queueMicrotask(() => { + if (descriptionRef) descriptionRef.scrollTop = 0 + }) + }) + function handleNext() { if (isLast()) return setIndex(index() + 1) @@ -68,20 +77,27 @@ export function DialogReleaseNotes(props: { highlights: Highlight[] }) { >
{feature()?.description ?? ""}
++ {feature()?.description ?? ""} +