-
-
Notifications
You must be signed in to change notification settings - Fork 670
fix: resolve feature state inconsistencies #1491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,10 +23,29 @@ interface OnboardingState { | |||||||||||||||||||||||||||||
| isEditing: boolean; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| function getInitialStepStatus(): boolean[] { | ||||||||||||||||||||||||||||||
| const hasProfile = Boolean( | ||||||||||||||||||||||||||||||
| localStorage.getItem('name') && localStorage.getItem('avatar'), | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| return STEP_NAMES.map((stepName) => { | ||||||||||||||||||||||||||||||
| switch (stepName) { | ||||||||||||||||||||||||||||||
| case STEPS.AVATAR_SELECTION_STEP: | ||||||||||||||||||||||||||||||
| return hasProfile; | ||||||||||||||||||||||||||||||
| case STEPS.FOLDER_SETUP_STEP: | ||||||||||||||||||||||||||||||
| return localStorage.getItem('folderChosen') === 'true'; | ||||||||||||||||||||||||||||||
| case STEPS.THEME_SELECTION_STEP: | ||||||||||||||||||||||||||||||
| return localStorage.getItem('themeChosen') === 'true'; | ||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const initialState: OnboardingState = { | ||||||||||||||||||||||||||||||
| currentStepIndex: 0, | ||||||||||||||||||||||||||||||
| currentStepName: STEP_NAMES[0], | ||||||||||||||||||||||||||||||
| stepStatus: STEP_NAMES.map(() => false), | ||||||||||||||||||||||||||||||
| stepStatus: getInitialStepStatus(), | ||||||||||||||||||||||||||||||
|
Comment on lines
45
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Derive the current step from the persisted status.
Proposed fix const initialState: OnboardingState = {
currentStepIndex: 0,
currentStepName: STEP_NAMES[0],
stepStatus: getInitialStepStatus(),
avatar: localStorage.getItem('avatar'),
name: localStorage.getItem('name') || '',
isEditing: false,
};
+syncCurrentStepFromStatus(initialState);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| avatar: localStorage.getItem('avatar'), | ||||||||||||||||||||||||||||||
| name: localStorage.getItem('name') || '', | ||||||||||||||||||||||||||||||
| isEditing: false, | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: AOSSIE-Org/PictoPy
Length of output: 208
🏁 Script executed:
Repository: AOSSIE-Org/PictoPy
Length of output: 50375
🏁 Script executed:
Repository: AOSSIE-Org/PictoPy
Length of output: 50376
🏁 Script executed:
Repository: AOSSIE-Org/PictoPy
Length of output: 291
Align the folder parent type and root selector logic.
backend/app/schemas/folders.pyallowsFolderDetails.parent_folder_idto benull. Changefrontend/src/types/Folder.tstoparent_folder_id?: string | null. Reuse one root-folder predicate across the selectors sonullandundefinedreceive consistent handling.🤖 Prompt for AI Agents
Source: Coding guidelines