Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-4964] fix: update onboarding layout and enhance scroll behavior (#7825)

Prateek Shourya68d72daa9002
diff --git a/apps/web/core/components/onboarding/root.tsx b/apps/web/core/components/onboarding/root.tsx
index 8d5679d73e..0aa9687202 100644
--- a/apps/web/core/components/onboarding/root.tsx
+++ b/apps/web/core/components/onboarding/root.tsx
@@ -132,7 +132,7 @@ export const OnboardingRoot: FC<Props> = observer(({ invitations = [] }) => {
}, []);
return (
- <>
+ <div className="flex flex-col h-full">
{/* Header with progress */}
<OnboardingHeader
currentStep={currentStep}
@@ -142,6 +142,6 @@ export const OnboardingRoot: FC<Props> = observer(({ invitations = [] }) => {
{/* Main content area */}
<OnboardingStepRoot currentStep={currentStep} invitations={invitations} handleStepChange={handleStepChange} />
- </>
+ </div>
);
});
diff --git a/apps/web/core/components/onboarding/steps/root.tsx b/apps/web/core/components/onboarding/steps/root.tsx
index a1f3319986..0ea7e77dd4 100644
--- a/apps/web/core/components/onboarding/steps/root.tsx
+++ b/apps/web/core/components/onboarding/steps/root.tsx
@@ -1,6 +1,6 @@
"use client";
-import { FC, useMemo } from "react";
+import { FC, useEffect, useMemo, useRef } from "react";
// plane imports
import { EOnboardingSteps, IWorkspaceMemberInvitation } from "@plane/types";
// local components
@@ -18,6 +18,19 @@ type Props = {
export const OnboardingStepRoot: FC<Props> = (props) => {
const { currentStep, invitations, handleStepChange } = props;
+ // ref for the scrollable container
+ const scrollContainerRef = useRef<HTMLDivElement>(null);
+
+ // scroll to top when step changes
+ useEffect(() => {
+ if (scrollContainerRef.current) {
+ scrollContainerRef.current.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+ }
+ }, [currentStep]);
+
// memoized step component mapping
const stepComponents = useMemo(
() => ({
@@ -33,8 +46,10 @@ export const OnboardingStepRoot: FC<Props> = (props) => {
);
return (
- <div className="flex-1 flex items-center justify-center p-8">
- <div className="w-full max-w-[24rem]">{stepComponents[currentStep]} </div>
+ <div ref={scrollContainerRef} className="flex-1 overflow-y-auto">
+ <div className="flex items-center justify-center min-h-full p-8">
+ <div className="w-full max-w-[24rem]">{stepComponents[currentStep]} </div>
+ </div>
</div>
);
};