feat: Flow Transfer, Procedural Assist & UI Design System #97

Merged
chihlasm merged 51 commits from feat/flow-transfer-and-procedural-assist into main 2026-03-07 23:44:14 +00:00
Showing only changes of commit 9d9df9f0b8 - Show all commits

View File

@@ -186,18 +186,26 @@ export default function SurveyPage() {
}, 0)
const progressPct = Math.round((answeredCount / TOTAL_QUESTIONS) * 100)
const topRef = useRef<HTMLDivElement>(null)
const goSlide = (idx: number) => {
setCurrentSlide(idx)
}
// Scroll to top whenever the active slide changes
// Scroll to top whenever the active slide changes — mobile browsers
// (especially iOS Safari) ignore window.scrollTo, so we use
// scrollIntoView on a ref at the top of the page as primary method
const isFirstRender = useRef(true)
useEffect(() => {
if (isFirstRender.current) {
isFirstRender.current = false
return
}
window.scrollTo({ top: 0, behavior: 'smooth' })
if (topRef.current) {
topRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' })
} else {
window.scrollTo({ top: 0, behavior: 'smooth' })
}
}, [currentSlide])
const handleSubmit = async () => {
@@ -296,7 +304,7 @@ export default function SurveyPage() {
}
return (
<div className="min-h-screen bg-background text-foreground">
<div ref={topRef} className="min-h-screen bg-background text-foreground">
<PageMeta
title="Product Survey"
description="Help shape the future of ResolutionFlow by sharing your feedback"