fix: remove forcemount from user dropdown#1169
Conversation
…gation - Replace window.location.href with router.push() + router.refresh() in UserDropdown logout - Replace window.location.href with router.push() in CreateSearchSpaceDialog - Replace window.location.reload() with router.refresh() in login page retry action - Prevents full page reloads and preserves React state during in-app navigation
- Remove 'use client' from connector-document-mapping.ts (only exports constants and pure functions) - Remove 'use client' from sidebar-separator.tsx (purely presentational component) - Remove 'use client' and Framer Motion from logs/loading.tsx, replace with Tailwind animations - Reduces client bundle size by moving server-compatible code to server components
- Add autoComplete="username" and "current-password" to login form - Add autoComplete="email" and "new-password" to register form inputs - Add autoComplete="name" to profile display name input - Add autoComplete="off" to connector search input - Enables browser password managers and autofill functionality
- Add local state for message filter input with 300ms debounce - Use useDebouncedValue hook to delay table filter updates - Prevents full filtering pipeline from running on every keystroke - Improves responsiveness for large log datasets
- Remove forceMount prop from DropdownMenuContent - Allows Radix to mount content only when dropdown is open - Reduces unnecessary DOM nodes when dropdown is closed - Improves performance by using default Radix behavior
|
@SohamBhattacharjee2003 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. |
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on f20540f..693284c
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (11)
• surfsense_web/app/(home)/login/LocalLoginForm.tsx
• surfsense_web/app/(home)/login/page.tsx
• surfsense_web/app/(home)/register/page.tsx
• surfsense_web/app/dashboard/[search_space_id]/logs/(manage)/page.tsx
• surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx
• surfsense_web/app/dashboard/[search_space_id]/user-settings/components/ProfileContent.tsx
• surfsense_web/app/docs/sidebar-separator.tsx
• surfsense_web/components/UserDropdown.tsx
• surfsense_web/components/assistant-ui/connector-popup/components/connector-dialog-header.tsx
• surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts
• surfsense_web/components/layout/ui/dialogs/CreateSearchSpaceDialog.tsx
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 693284c..b82a4fb
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (50)
• .github/workflows/desktop-release.yml
• README.es.md
• README.hi.md
• README.md
• README.pt-BR.md
• README.zh-CN.md
• docs/chinese-llm-setup.md
• package-lock.json
• package.json
• surfsense_backend/alembic/versions/116_create_zero_publication.py
• surfsense_backend/alembic/versions/117_optimize_zero_publication_column_lists.py
• surfsense_backend/alembic/versions/118_add_local_folder_sync_and_versioning.py
• surfsense_backend/alembic/versions/119_add_vision_llm_id_to_search_spaces.py
• surfsense_backend/alembic/versions/120_add_vision_llm_configs_table.py
• surfsense_backend/alembic/versions/51_add_new_llm_config_table.py
• surfsense_backend/app/agents/autocomplete/__init__.py
• surfsense_backend/app/agents/autocomplete/autocomplete_agent.py
• surfsense_backend/app/agents/new_chat/chat_deepagent.py
• surfsense_backend/app/agents/new_chat/middleware/filesystem.py
• surfsense_backend/app/agents/new_chat/middleware/knowledge_search.py
• surfsense_backend/app/app.py
• surfsense_backend/app/celery_app.py
• surfsense_backend/app/config/__init__.py
• surfsense_backend/app/config/global_llm_config.example.yaml
• surfsense_backend/app/config/vision_model_list_fallback.json
• surfsense_backend/app/connectors/dropbox/client.py
• surfsense_backend/app/connectors/dropbox/content_extractor.py
• surfsense_backend/app/connectors/dropbox/file_types.py
• surfsense_backend/app/connectors/dropbox/folder_manager.py
• surfsense_backend/app/connectors/google_drive/content_extractor.py
• surfsense_backend/app/connectors/google_drive/file_types.py
• surfsense_backend/app/connectors/onedrive/content_extractor.py
• surfsense_backend/app/connectors/onedrive/file_types.py
• surfsense_backend/app/connectors/onedrive/folder_manager.py
• surfsense_backend/app/db.py
• surfsense_backend/app/etl_pipeline/constants.py
• surfsense_backend/app/etl_pipeline/etl_document.py
• surfsense_backend/app/etl_pipeline/etl_pipeline_service.py
• surfsense_backend/app/etl_pipeline/exceptions.py
• surfsense_backend/app/etl_pipeline/file_classifier.py
• surfsense_backend/app/etl_pipeline/parsers/audio.py
• surfsense_backend/app/etl_pipeline/parsers/direct_convert.py
• surfsense_backend/app/etl_pipeline/parsers/docling.py
• surfsense_backend/app/etl_pipeline/parsers/llamacloud.py
• surfsense_backend/app/etl_pipeline/parsers/plaintext.py
• surfsense_backend/app/etl_pipeline/parsers/unstructured.py
• surfsense_backend/app/indexing_pipeline/exceptions.py
• surfsense_backend/app/routes/__init__.py
• surfsense_backend/app/routes/airtable_add_connector_route.py
• surfsense_backend/app/routes/autocomplete_routes.py
⏭️ Files skipped (232)
| Locations |
|---|
surfsense_backend/app/etl_pipeline/__init__.py |
surfsense_backend/app/etl_pipeline/parsers/__init__.py |
surfsense_backend/app/routes/documents_routes.py |
surfsense_backend/app/routes/dropbox_add_connector_route.py |
surfsense_backend/app/routes/editor_routes.py |
surfsense_backend/app/routes/folders_routes.py |
surfsense_backend/app/routes/google_calendar_add_connector_route.py |
surfsense_backend/app/routes/google_drive_add_connector_route.py |
surfsense_backend/app/routes/google_gmail_add_connector_route.py |
surfsense_backend/app/routes/model_list_routes.py |
surfsense_backend/app/routes/new_llm_config_routes.py |
surfsense_backend/app/routes/search_source_connectors_routes.py |
surfsense_backend/app/routes/search_spaces_routes.py |
surfsense_backend/app/routes/vision_llm_routes.py |
surfsense_backend/app/schemas/__init__.py |
surfsense_backend/app/schemas/documents.py |
surfsense_backend/app/schemas/folders.py |
surfsense_backend/app/schemas/new_llm_config.py |
surfsense_backend/app/schemas/vision_llm.py |
surfsense_backend/app/services/docling_service.py |
surfsense_backend/app/services/llm_service.py |
surfsense_backend/app/services/model_list_service.py |
surfsense_backend/app/services/notification_service.py |
surfsense_backend/app/services/page_limit_service.py |
surfsense_backend/app/services/vision_autocomplete_service.py |
surfsense_backend/app/services/vision_llm_router_service.py |
surfsense_backend/app/services/vision_model_list_service.py |
surfsense_backend/app/tasks/celery_tasks/document_tasks.py |
surfsense_backend/app/tasks/chat/stream_new_chat.py |
surfsense_backend/app/tasks/connector_indexers/__init__.py |
surfsense_backend/app/tasks/connector_indexers/dropbox_indexer.py |
surfsense_backend/app/tasks/connector_indexers/google_drive_indexer.py |
surfsense_backend/app/tasks/connector_indexers/local_folder_indexer.py |
surfsense_backend/app/tasks/connector_indexers/onedrive_indexer.py |
surfsense_backend/app/tasks/document_processors/__init__.py |
surfsense_backend/app/tasks/document_processors/_direct_converters.py |
surfsense_backend/app/tasks/document_processors/_helpers.py |
surfsense_backend/app/tasks/document_processors/_save.py |
surfsense_backend/app/tasks/document_processors/file_processors.py |
surfsense_backend/app/tasks/document_processors/markdown_processor.py |
surfsense_backend/app/utils/document_versioning.py |
surfsense_backend/app/utils/file_extensions.py |
surfsense_backend/app/utils/oauth_security.py |
surfsense_backend/pyproject.toml |
surfsense_backend/tests/integration/document_upload/conftest.py |
surfsense_backend/tests/integration/document_upload/test_upload_limits.py |
surfsense_backend/tests/integration/google_unification/test_drive_indexer_credentials.py |
surfsense_backend/tests/integration/indexing_pipeline/test_local_folder_pipeline.py |
surfsense_backend/tests/integration/test_document_versioning.py |
surfsense_backend/tests/unit/connector_indexers/test_content_extraction.py |
surfsense_backend/tests/unit/connector_indexers/test_dropbox_parallel.py |
surfsense_backend/tests/unit/connector_indexers/test_google_drive_parallel.py |
surfsense_backend/tests/unit/connector_indexers/test_local_folder_scan.py |
surfsense_backend/tests/unit/connector_indexers/test_page_limits.py |
surfsense_backend/tests/unit/connectors/__init__.py |
surfsense_backend/tests/unit/connectors/test_dropbox_client.py |
surfsense_backend/tests/unit/connectors/test_dropbox_file_types.py |
surfsense_backend/tests/unit/connectors/test_dropbox_reauth.py |
surfsense_backend/tests/unit/connectors/test_google_drive_file_types.py |
surfsense_backend/tests/unit/connectors/test_onedrive_file_types.py |
surfsense_backend/tests/unit/etl_pipeline/conftest.py |
surfsense_backend/tests/unit/etl_pipeline/test_etl_pipeline_service.py |
surfsense_backend/tests/unit/middleware/test_knowledge_search.py |
surfsense_backend/tests/unit/services/__init__.py |
surfsense_backend/tests/unit/services/test_docling_image_support.py |
surfsense_backend/tests/unit/utils/__init__.py |
surfsense_backend/tests/unit/utils/test_file_extensions.py |
surfsense_backend/uv.lock |
surfsense_desktop/.env |
surfsense_desktop/.npmrc |
surfsense_desktop/electron-builder.yml |
surfsense_desktop/package.json |
surfsense_desktop/pnpm-lock.yaml |
surfsense_desktop/scripts/build-electron.mjs |
surfsense_desktop/src/ipc/channels.ts |
surfsense_desktop/src/ipc/handlers.ts |
surfsense_desktop/src/main.ts |
surfsense_desktop/src/modules/active-search-space.ts |
surfsense_desktop/src/modules/analytics.ts |
surfsense_desktop/src/modules/autocomplete/index.ts |
surfsense_desktop/src/modules/autocomplete/screenshot.ts |
surfsense_desktop/src/modules/autocomplete/suggestion-window.ts |
surfsense_desktop/src/modules/folder-watcher.ts |
surfsense_desktop/src/modules/permissions.ts |
surfsense_desktop/src/modules/platform.ts |
surfsense_desktop/src/modules/quick-ask.ts |
surfsense_desktop/src/modules/shortcuts.ts |
surfsense_desktop/src/modules/tray.ts |
surfsense_desktop/src/modules/window.ts |
surfsense_desktop/src/preload.ts |
surfsense_web/.env.example |
surfsense_web/app/(home)/changelog/page.tsx |
surfsense_web/app/(home)/login/LocalLoginForm.tsx |
surfsense_web/app/(home)/register/page.tsx |
surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx |
surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentTypeIcon.tsx |
surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsFilters.tsx |
surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx |
surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/types.ts |
surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx |
surfsense_web/app/dashboard/[search_space_id]/user-settings/components/CommunityPromptsContent.tsx |
surfsense_web/app/dashboard/[search_space_id]/user-settings/components/DesktopContent.tsx |
surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PromptsContent.tsx |
surfsense_web/app/dashboard/layout.tsx |
surfsense_web/app/dashboard/page.tsx |
surfsense_web/app/desktop/login/page.tsx |
surfsense_web/app/desktop/permissions/page.tsx |
surfsense_web/app/desktop/suggestion/layout.tsx |
surfsense_web/app/desktop/suggestion/page.tsx |
surfsense_web/app/desktop/suggestion/suggestion.css |
surfsense_web/app/docs/[[...slug]]/page.tsx |
surfsense_web/app/error.tsx |
surfsense_web/app/globals.css |
surfsense_web/app/layout.tsx |
surfsense_web/atoms/new-llm-config/new-llm-config-mutation.atoms.ts |
surfsense_web/atoms/new-llm-config/new-llm-config-query.atoms.ts |
surfsense_web/atoms/vision-llm-config/vision-llm-config-mutation.atoms.ts |
surfsense_web/atoms/vision-llm-config/vision-llm-config-query.atoms.ts |
surfsense_web/components/TokenHandler.tsx |
surfsense_web/components/UserDropdown.tsx |
surfsense_web/components/assistant-ui/assistant-message.tsx |
surfsense_web/components/assistant-ui/connector-popup.tsx |
surfsense_web/components/assistant-ui/connector-popup/connect-forms/index.tsx |
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/circleback-config.tsx |
surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-connect-view.tsx |
surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx |
surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/indexing-configuration-view.tsx |
surfsense_web/components/assistant-ui/connector-popup/tabs/active-connectors-tab.tsx |
surfsense_web/components/assistant-ui/connector-popup/tabs/all-connectors-tab.tsx |
surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view.tsx |
surfsense_web/components/assistant-ui/connector-popup/views/youtube-crawler-view.tsx |
surfsense_web/components/assistant-ui/document-upload-popup.tsx |
surfsense_web/components/assistant-ui/image.tsx |
surfsense_web/components/assistant-ui/inline-citation.tsx |
surfsense_web/components/assistant-ui/inline-mention-editor.tsx |
surfsense_web/components/assistant-ui/thread-list.tsx |
surfsense_web/components/assistant-ui/thread.tsx |
surfsense_web/components/assistant-ui/tool-fallback.tsx |
surfsense_web/components/chat-comments/comment-composer/comment-composer.tsx |
surfsense_web/components/chat-comments/comment-item/comment-actions.tsx |
surfsense_web/components/chat-comments/comment-item/comment-item.tsx |
surfsense_web/components/desktop/shortcut-recorder.tsx |
surfsense_web/components/documents/DocumentNode.tsx |
surfsense_web/components/documents/FolderNode.tsx |
surfsense_web/components/documents/FolderTreeView.tsx |
surfsense_web/components/documents/version-history.tsx |
surfsense_web/components/editor-panel/editor-panel.tsx |
surfsense_web/components/editor/plate-editor.tsx |
surfsense_web/components/homepage/features-bento-grid.tsx |
surfsense_web/components/homepage/hero-section.tsx |
surfsense_web/components/homepage/navbar.tsx |
surfsense_web/components/homepage/use-cases-grid.tsx |
surfsense_web/components/layout/providers/LayoutDataProvider.tsx |
surfsense_web/components/layout/ui/dialogs/CreateSearchSpaceDialog.tsx |
surfsense_web/components/layout/ui/right-panel/RightPanel.tsx |
surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx |
surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx |
surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx |
surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx |
surfsense_web/components/layout/ui/sidebar/PageUsageDisplay.tsx |
surfsense_web/components/layout/ui/tabs/DocumentTabContent.tsx |
surfsense_web/components/layout/ui/tabs/TabBar.tsx |
surfsense_web/components/markdown-viewer.tsx |
surfsense_web/components/new-chat/chat-header.tsx |
surfsense_web/components/new-chat/chat-share-button.tsx |
surfsense_web/components/new-chat/document-mention-picker.tsx |
surfsense_web/components/new-chat/model-selector.tsx |
surfsense_web/components/new-chat/prompt-picker.tsx |
surfsense_web/components/new-chat/source-detail-panel.tsx |
surfsense_web/components/onboarding-tour.tsx |
surfsense_web/components/platform-gate.tsx |
surfsense_web/components/public-chat-snapshots/public-chat-snapshot-row.tsx |
surfsense_web/components/public-chat-snapshots/public-chat-snapshots-empty-state.tsx |
surfsense_web/components/public-chat/public-chat-footer.tsx |
surfsense_web/components/settings/image-model-manager.tsx |
surfsense_web/components/settings/llm-role-manager.tsx |
surfsense_web/components/settings/model-config-manager.tsx |
surfsense_web/components/settings/search-space-settings-dialog.tsx |
surfsense_web/components/settings/user-settings-dialog.tsx |
surfsense_web/components/settings/vision-model-manager.tsx |
surfsense_web/components/shared/image-config-dialog.tsx |
surfsense_web/components/shared/model-config-dialog.tsx |
surfsense_web/components/shared/vision-config-dialog.tsx |
surfsense_web/components/sources/DocumentUploadTab.tsx |
surfsense_web/components/tool-ui/citation/citation-list.tsx |
surfsense_web/components/tool-ui/citation/citation.tsx |
surfsense_web/components/tool-ui/image/index.tsx |
surfsense_web/components/ui/animated-tabs.tsx |
surfsense_web/components/ui/checkbox.tsx |
surfsense_web/components/ui/context-menu.tsx |
surfsense_web/components/ui/dropdown-menu.tsx |
surfsense_web/components/ui/floating-toolbar.tsx |
surfsense_web/components/ui/insert-toolbar-button.tsx |
surfsense_web/components/ui/separator.tsx |
surfsense_web/components/ui/slash-node.tsx |
surfsense_web/components/ui/toggle-group.tsx |
surfsense_web/components/ui/toggle.tsx |
surfsense_web/components/ui/tooltip.tsx |
surfsense_web/components/ui/turn-into-toolbar-button.tsx |
surfsense_web/content/docs/testing.mdx |
surfsense_web/contexts/LocaleContext.tsx |
surfsense_web/contexts/platform-context.tsx |
surfsense_web/contracts/enums/connectorIcons.tsx |
surfsense_web/contracts/enums/llm-models.ts |
surfsense_web/contracts/enums/vision-providers.ts |
surfsense_web/contracts/types/document.types.ts |
surfsense_web/contracts/types/folder.types.ts |
surfsense_web/contracts/types/new-llm-config.types.ts |
surfsense_web/hooks/use-comments-sync.ts |
surfsense_web/hooks/use-documents.ts |
surfsense_web/hooks/use-folder-sync.ts |
surfsense_web/hooks/use-inbox.ts |
surfsense_web/hooks/use-platform.ts |
surfsense_web/lib/apis/base-api.service.ts |
surfsense_web/lib/apis/documents-api.service.ts |
surfsense_web/lib/apis/folders-api.service.ts |
surfsense_web/lib/apis/new-llm-config-api.service.ts |
surfsense_web/lib/apis/vision-llm-config-api.service.ts |
surfsense_web/lib/auth-utils.ts |
surfsense_web/lib/query-client/cache-keys.ts |
surfsense_web/lib/query-client/query-client.provider.tsx |
surfsense_web/mdx-components.tsx |
surfsense_web/messages/en.json |
surfsense_web/messages/es.json |
surfsense_web/messages/hi.json |
surfsense_web/messages/pt.json |
surfsense_web/messages/zh.json |
surfsense_web/next.config.ts |
surfsense_web/public/homepage/hero_tutorial/extreme_assist.mp4 |
surfsense_web/public/homepage/hero_tutorial/general_assist.mp4 |
surfsense_web/public/homepage/hero_tutorial/quick_assist.mp4 |
surfsense_web/types/window.d.ts |
Description
Removed the
forceMountprop fromDropdownMenuContentin UserDropdown component. This allows Radix UI to use its default behavior of mounting the dropdown content only when open, reducing unnecessary DOM nodes when the dropdown is closed.Changes:
forceMountprop fromDropdownMenuContentinUserDropdown.tsxMotivation and Context
The
forceMountprop keeps the dropdown DOM mounted at all times, even when closed. This adds unnecessary nodes to the DOM tree and impacts performance. By removing it, Radix UI will only mount the dropdown content when it's actually open (the default behavior), reducing DOM overhead and improving performance.If
forceMountwas originally added for animation purposes, Radix providesdata-stateCSS attributes that can be used for open/close animations without keeping the content mounted.FIX #1150
Screenshots
N/A - Performance improvement (no visual changes, dropdown functions identically)
API Changes
Change Type
Testing Performed
Verified:
Checklist
High-level PR Summary
This PR removes the
forceMountprop from theUserDropdowncomponent to improve performance by preventing unnecessary DOM nodes when the dropdown is closed. Additionally, it includes several navigation-related improvements (replacingwindow.locationcalls with Next.jsroutermethods), addsautoCompleteattributes to form inputs for better accessibility and UX, removes unnecessary"use client"directives from non-interactive components, replaces Framer Motion animations with CSS-based animations in a loading component, and implements debounced filtering for the logs table to reduce unnecessary re-renders.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_web/components/UserDropdown.tsxsurfsense_web/app/dashboard/[search_space_id]/logs/loading.tsxsurfsense_web/app/docs/sidebar-separator.tsxsurfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.tssurfsense_web/components/layout/ui/dialogs/CreateSearchSpaceDialog.tsxsurfsense_web/app/(home)/login/page.tsxsurfsense_web/app/(home)/login/LocalLoginForm.tsxsurfsense_web/app/(home)/register/page.tsxsurfsense_web/app/dashboard/[search_space_id]/user-settings/components/ProfileContent.tsxsurfsense_web/components/assistant-ui/connector-popup/components/connector-dialog-header.tsxsurfsense_web/app/dashboard/[search_space_id]/logs/(manage)/page.tsxsurfsense_web/app/(home)/login/LocalLoginForm.tsxsurfsense_web/app/(home)/login/page.tsxsurfsense_web/app/(home)/register/page.tsxsurfsense_web/app/dashboard/[search_space_id]/logs/(manage)/page.tsxsurfsense_web/app/dashboard/[search_space_id]/logs/loading.tsxsurfsense_web/app/dashboard/[search_space_id]/user-settings/components/ProfileContent.tsxsurfsense_web/components/assistant-ui/connector-popup/components/connector-dialog-header.tsxsurfsense_web/app/docs/sidebar-separator.tsxsurfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.tssurfsense_web/components/layout/ui/dialogs/CreateSearchSpaceDialog.tsx