Skip to content

Conversation

@ritigya03
Copy link
Contributor

@ritigya03 ritigya03 commented Dec 29, 2025

Summary by CodeRabbit

  • New Features

    • Added editing state support to onboarding steps—components now properly respect editing mode during the onboarding flow.
  • Bug Fixes

    • Corrected step numbering and progress display in the onboarding experience.
    • Back navigation now correctly enables editing mode.
  • API Changes

    • Updated parameter schema structure for input_type query parameter.
    • Tightened metadata field validation constraints.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

This PR adds editing state tracking to the onboarding flow and updates API parameter schema definitions. Frontend onboarding components now accept a currentStepDisplayIndex prop and respect an isEditing Redux flag that affects step completion logic and visual progress display.

Changes

Cohort / File(s) Summary
OpenAPI Schema Updates
docs/backend/backend_python/openapi.json
Updated input_type query parameter schema to wrap InputType reference in allOf, added "Input Type" title and "path" default; removed additionalProperties constraint from ImageInCluster.Metadata field
Redux Onboarding State
frontend/src/features/onboardingSlice.ts
Added new boolean isEditing field to OnboardingState with false default; introduced setIsEditing reducer action and exported it alongside existing actions
Onboarding Step Components
frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx
frontend/src/components/OnboardingSteps/FolderSetupStep.tsx
frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx
Added currentStepDisplayIndex prop to each step component; integrated isEditing Redux state to gate completion logic and progress display; replaced stepIndex with currentStepDisplayIndex for progress calculations and UI labels; dispatched setIsEditing(true) on back navigation
Formatting
frontend/src/components/OnboardingSteps/OnboardingStep.tsx
Added blank lines in default case and before return statement (no functional changes)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • AOSSIE-Org/PictoPy#485: Modifies the same onboarding components (AvatarSelectionStep, FolderSetupStep, ThemeSelectionStep) and onboardingSlice with overlapping feature enhancements.

Suggested labels

bug, frontend

Poem

🐰 A rabbit hops through onboarding dreams,
With editing states and step-index schemes,
Progress displays now perfectly aligned,
Each backward step a new isEditing find!
The flow's more graceful, the schemas more clean—
Best onboarding journey ever seen!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Fix/back button changes only' is vague and does not clearly describe the main changes, which involve adding editing state management to the onboarding flow. Use a more descriptive title that captures the primary change, such as 'Add editing state to onboarding steps' or 'Improve onboarding navigation with editing state tracking'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a91a07d and 4054978.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • docs/backend/backend_python/openapi.json
  • frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx
  • frontend/src/components/OnboardingSteps/FolderSetupStep.tsx
  • frontend/src/components/OnboardingSteps/OnboardingStep.tsx
  • frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx
  • frontend/src/features/onboardingSlice.ts
🧰 Additional context used
🧬 Code graph analysis (3)
frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx (1)
frontend/src/app/store.ts (1)
  • RootState (22-22)
frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx (3)
frontend/src/contexts/ThemeContext.tsx (1)
  • useTheme (66-73)
frontend/src/app/store.ts (2)
  • RootState (22-22)
  • AppDispatch (24-24)
frontend/src/features/onboardingSlice.ts (2)
  • setIsEditing (33-35)
  • previousStep (48-55)
frontend/src/components/OnboardingSteps/FolderSetupStep.tsx (2)
frontend/src/app/store.ts (2)
  • AppDispatch (24-24)
  • RootState (22-22)
frontend/src/features/onboardingSlice.ts (2)
  • setIsEditing (33-35)
  • previousStep (48-55)
🔇 Additional comments (7)
frontend/src/features/onboardingSlice.ts (1)

12-12: LGTM! Editing state management implemented correctly.

The new isEditing state and setIsEditing reducer provide a clean mechanism for tracking when users navigate back to edit previously completed onboarding steps.

Also applies to: 21-21, 33-35, 59-60

frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx (2)

36-39: Good improvement: Using persisted values for initialization.

Initializing from localStorage instead of hard-coded defaults ensures user data persists across page refreshes during onboarding.


40-52: Editing state integration looks correct.

The isEditing flag properly gates auto-completion in the useEffect, ensuring the step doesn't auto-advance when users navigate back to edit.

frontend/src/components/OnboardingSteps/FolderSetupStep.tsx (1)

34-42: Editing flow correctly implemented.

The isEditing selector and setIsEditing(true) dispatch on back navigation ensure proper state management when users return to previously completed steps.

Also applies to: 66-68

frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx (1)

37-46: Consistent editing state implementation across all steps.

The editing flow matches the pattern in FolderSetupStep and AvatarSelectionStep, providing a cohesive user experience when navigating backward through onboarding.

Also applies to: 57-59

docs/backend/backend_python/openapi.json (2)

1120-1128: Verify schema change doesn't break existing API clients.

The input_type parameter now uses an allOf wrapper with an explicit "default": "path" and a "title" field. While this structure improves API documentation, confirm that existing frontend clients and generated API code handle this schema correctly. In particular, verify that code generators don't ignore or misinterpret the default value or title when processing the allOf construct, and check if any hardcoded client implementations expect the original direct $ref structure.


2204-2213: The metadata schema does not restrict additional properties. The OpenAPI definition uses "type": "object" without an explicit additionalProperties: false constraint, which means additional properties are permitted by default per JSON Schema specification. This matches the Python model definition metadata: Optional[Dict[str, Any]], which allows arbitrary key-value pairs. There is no breaking change in this schema.

Likely an incorrect or invalid review comment.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/OnboardingSteps/OnboardingStep.tsx (1)

26-42: Critical: Missing currentStepDisplayIndex prop causes runtime errors.

The sharedProps object only includes stepIndex and totalSteps, but all child step components now require currentStepDisplayIndex in their prop interfaces:

  • AvatarSelectionStep (line 26)
  • FolderSetupStep (line 22)
  • ThemeSelectionStep (line 28)

This will result in undefined being passed for currentStepDisplayIndex, breaking the progress calculation and step display in all three components.

🔎 Proposed fix
 const sharedProps = {
   stepIndex,
   totalSteps: VISIBLE_STEPS.length,
+  currentStepDisplayIndex: stepIndex,
 };

Note: Verify whether currentStepDisplayIndex should equal stepIndex or if it needs different logic to account for non-visible steps.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a91a07d and 4054978.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • docs/backend/backend_python/openapi.json
  • frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx
  • frontend/src/components/OnboardingSteps/FolderSetupStep.tsx
  • frontend/src/components/OnboardingSteps/OnboardingStep.tsx
  • frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx
  • frontend/src/features/onboardingSlice.ts
🧰 Additional context used
🧬 Code graph analysis (3)
frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx (1)
frontend/src/app/store.ts (1)
  • RootState (22-22)
frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx (3)
frontend/src/contexts/ThemeContext.tsx (1)
  • useTheme (66-73)
frontend/src/app/store.ts (2)
  • RootState (22-22)
  • AppDispatch (24-24)
frontend/src/features/onboardingSlice.ts (2)
  • setIsEditing (33-35)
  • previousStep (48-55)
frontend/src/components/OnboardingSteps/FolderSetupStep.tsx (2)
frontend/src/app/store.ts (2)
  • AppDispatch (24-24)
  • RootState (22-22)
frontend/src/features/onboardingSlice.ts (2)
  • setIsEditing (33-35)
  • previousStep (48-55)
🔇 Additional comments (7)
frontend/src/features/onboardingSlice.ts (1)

12-12: LGTM! Editing state management implemented correctly.

The new isEditing state and setIsEditing reducer provide a clean mechanism for tracking when users navigate back to edit previously completed onboarding steps.

Also applies to: 21-21, 33-35, 59-60

frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx (2)

36-39: Good improvement: Using persisted values for initialization.

Initializing from localStorage instead of hard-coded defaults ensures user data persists across page refreshes during onboarding.


40-52: Editing state integration looks correct.

The isEditing flag properly gates auto-completion in the useEffect, ensuring the step doesn't auto-advance when users navigate back to edit.

frontend/src/components/OnboardingSteps/FolderSetupStep.tsx (1)

34-42: Editing flow correctly implemented.

The isEditing selector and setIsEditing(true) dispatch on back navigation ensure proper state management when users return to previously completed steps.

Also applies to: 66-68

frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx (1)

37-46: Consistent editing state implementation across all steps.

The editing flow matches the pattern in FolderSetupStep and AvatarSelectionStep, providing a cohesive user experience when navigating backward through onboarding.

Also applies to: 57-59

docs/backend/backend_python/openapi.json (2)

1120-1128: Verify schema change doesn't break existing API clients.

The input_type parameter now uses an allOf wrapper with an explicit "default": "path" and a "title" field. While this structure improves API documentation, confirm that existing frontend clients and generated API code handle this schema correctly. In particular, verify that code generators don't ignore or misinterpret the default value or title when processing the allOf construct, and check if any hardcoded client implementations expect the original direct $ref structure.


2204-2213: The metadata schema does not restrict additional properties. The OpenAPI definition uses "type": "object" without an explicit additionalProperties: false constraint, which means additional properties are permitted by default per JSON Schema specification. This matches the Python model definition metadata: Optional[Dict[str, Any]], which allows arbitrary key-value pairs. There is no breaking change in this schema.

Likely an incorrect or invalid review comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant