Fix: Prevent progress bar overflow in onboarding steps#639
Fix: Prevent progress bar overflow in onboarding steps#639srijan2607 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
WalkthroughThe pull request fixes progress percentage overflow and step index calculation in the onboarding flow by clamping progress values to a maximum of 100 and remapping the current step index to visible steps, preventing display misalignment. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related issues
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
frontend/src/components/OnboardingSteps/FolderSetupStep.tsx (1)
67-67: Progress capping fix is correct.The
Math.min(100, ...)clamping correctly prevents progress overflow. The calculated value is consistently used for both text display (Line 77) and bar width (Line 82), avoiding the inconsistency present in AvatarSelectionStep.tsx.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx(1 hunks)frontend/src/components/OnboardingSteps/FolderSetupStep.tsx(1 hunks)frontend/src/components/OnboardingSteps/OnboardingStep.tsx(1 hunks)frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx(1 hunks)
🔇 Additional comments (1)
frontend/src/components/OnboardingSteps/OnboardingStep.tsx (1)
26-30: LGTM! Step index mapping correctly aligns with visible steps.The visible step index mapping correctly computes the current step's position within
VISIBLE_STEPSand falls back to the originalstepIndexfor non-visible steps (UPDATE_STEP, SERVER_CHECK). This ensures progress calculations in child components reflect only the visible onboarding steps.
|
@rahulharpal1603 can you take a look |
Related issue #638
This pull request improves the onboarding progress calculation and display logic to ensure that progress percentages and progress bars never exceed 100%, and that step indices accurately reflect only visible steps. The changes increase the accuracy and robustness of the onboarding UI.
Progress calculation and display improvements:
Math.min(100, ...)to cap progress percentages and progress bar widths at 100%, preventing UI overflow or incorrect displays. (AvatarSelectionStep.tsx,FolderSetupStep.tsx,ThemeSelectionStep.tsx) [1] [2] [3]Step index logic update:
OnboardingStepcomponent now maps the current step name to its index withinVISIBLE_STEPS, ensuring that progress indicators are based only on visible steps rather than all possible steps. (OnboardingStep.tsx)Summary by CodeRabbit
Bug Fixes