Skip to content

fix : derive has changes and use functional setstate#1035

Open
JoeMakuta wants to merge 3 commits intoMODSetter:devfrom
JoeMakuta:fix/derive-has-changes-and-use-functional-setstate
Open

fix : derive has changes and use functional setstate#1035
JoeMakuta wants to merge 3 commits intoMODSetter:devfrom
JoeMakuta:fix/derive-has-changes-and-use-functional-setstate

Conversation

@JoeMakuta
Copy link
Copy Markdown
Contributor

@JoeMakuta JoeMakuta commented Mar 29, 2026

Description

This PR addresses multiple React state management issues by converting direct state updates to functional setState calls (using prev => !prev pattern for toggles) and refactoring hasChanges tracking in settings components from stateful effects to derived computations during render. These changes fix bugs related to stale closures and unnecessary re-renders, improving performance and correctness across toggle buttons, sidebar state management, onboarding tour navigation, and settings forms.

Motivation and Context

FIX #1004
FIX #1007
FIX #1005

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR addresses multiple React state management issues by converting direct state updates to functional setState calls (using prev => !prev pattern for toggles) and refactoring hasChanges tracking in settings components from stateful effects to derived computations during render. These changes fix bugs related to stale closures and unnecessary re-renders, improving performance and correctness across toggle buttons, sidebar state management, onboarding tour navigation, and settings forms.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/components/settings/general-settings-manager.tsx
2 surfsense_web/components/settings/prompt-config-manager.tsx
3 surfsense_web/components/layout/hooks/useSidebarState.ts
4 surfsense_web/components/onboarding-tour.tsx
5 surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/mcp-connect-form.tsx
6 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/mcp-config.tsx
7 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-drive-config.tsx
8 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx
9 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/webcrawler-config.tsx
10 surfsense_web/components/assistant-ui/thinking-steps.tsx
11 surfsense_web/components/assistant-ui/tool-fallback.tsx
12 surfsense_web/components/chat-comments/comment-thread/comment-thread.tsx
13 surfsense_web/components/homepage/navbar.tsx

Need help? Join our Discord

Analyze latest changes

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

@JoeMakuta is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on 05030f6..4e6251e

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (13)

surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/mcp-connect-form.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/composio-drive-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/mcp-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/webcrawler-config.tsx
surfsense_web/components/assistant-ui/thinking-steps.tsx
surfsense_web/components/assistant-ui/tool-fallback.tsx
surfsense_web/components/chat-comments/comment-thread/comment-thread.tsx
surfsense_web/components/homepage/navbar.tsx
surfsense_web/components/layout/hooks/useSidebarState.ts
surfsense_web/components/onboarding-tour.tsx
surfsense_web/components/settings/general-settings-manager.tsx
surfsense_web/components/settings/prompt-config-manager.tsx

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