Skip to content

[Feat] Sync auth node in visualizer with more oauth providers - #529

Merged
Fermionic-Lyu merged 2 commits into
mainfrom
sync-visualizer-auth-node
Oct 27, 2025
Merged

Fermionic-Lyu merged 2 commits into
mainfrom
sync-visualizer-auth-node

Conversation

@Fermionic-Lyu

@Fermionic-Lyu Fermionic-Lyu commented Oct 27, 2025 •

Copy link
Copy Markdown
Member

Summary

Since we have more oauth providers now, we need to sync up the visualizer as well.

image

How did you test this change?

Tested locally.

Summary by CodeRabbit

  • New Features

    • Expanded OAuth sign-in options: Google, GitHub, Microsoft, Discord, LinkedIn, and Facebook.
    • Authentication UI now lists all available providers with icons and Enabled/Disabled status.
  • Refactor

    • Provider definitions consolidated into a shared module for consistent display and easier maintenance.

@coderabbitai

coderabbitai Bot commented Oct 27, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Consolidates OAuth provider metadata into a new helpers.tsx module and updates components to import oauthProviders and OAuthProviderInfo from that shared source instead of keeping local hard-coded provider definitions.

Changes

Cohort / File(s) Summary
New centralized provider definitions
frontend/src/features/auth/helpers.tsx
Added OAuthProviderInfo type and exported oauthProviders array (Google, GitHub, Microsoft, Discord, LinkedIn, Facebook) with icons, descriptions, and setup URLs.
Auth UI components updated to consume shared providers
frontend/src/features/auth/components/AuthMethodTab.tsx, frontend/src/features/auth/components/AddOAuthDialog.tsx, frontend/src/features/auth/components/OAuthConfigDialog.tsx, frontend/src/features/visualizer/components/AuthNode.tsx
Removed local provider list and imports of a local OAuthProviderInfo; components now import oauthProviders and type OAuthProviderInfo from @/features/auth/helpers and render providers from the centralized array (dynamic list rendering replacing hard-coded blocks).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check that OAuthProvidersSchema-typed id values match other usages across the app.
  • Verify SVG icon imports and that icons render correctly after the move.
  • Confirm no behavioral changes in provider filtering, badges, or dialog initializations.

Possibly related PRs

Suggested reviewers

  • tonychang04

Poem

🐰 A hop, a nibble, code in tow,
Providers gathered row by row,
Icons tucked in one neat lair,
Shared helpers now handle their care,
Hooray — the UI’s lighter to show!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "[Feat] Sync auth node in visualizer with more oauth providers" is directly related to the primary objective and main changes in the changeset. The PR refactors OAuth provider definitions into a centralized helpers file and updates the AuthNode component in the visualizer to render providers dynamically from this shared source instead of hard-coded values. This enables the visualizer to display additional OAuth providers without code changes. The title accurately captures the user-facing outcome: the visualizer's auth node is now synchronized with a more complete set of OAuth providers. The title is concise, specific, and clearly communicates the primary change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync-visualizer-auth-node

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
frontend/src/features/auth/components/AuthMethodTab.tsx (1)

19-19: Consider using the imported name directly.

The providers alias is technically redundant since you could use oauthProviders directly throughout the component. However, it does provide a shorter name and may align with existing code patterns.

Apply this diff if you prefer to eliminate the alias:

-import { oauthProviders, type OAuthProviderInfo } from '@/features/auth/helpers';
-
-const providers = oauthProviders;
+import { oauthProviders as providers, type OAuthProviderInfo } from '@/features/auth/helpers';

Or use oauthProviders directly throughout the file.

frontend/src/features/auth/helpers.tsx (1)

18-61: LGTM!

The centralized provider definitions are comprehensive and well-structured. All six major OAuth providers are included with complete metadata. The varying icon styles (dark mode handling, brand colors) appear intentional for proper brand representation.

Optional consideration for future scalability:

The current pattern stores icons as ReactElement instances created at module load. This works fine for the current read-only rendering usage, but if you need more flexibility in the future (e.g., passing different props to icons in different contexts), consider refactoring to use icon component factories:

icon: () => <Google className="w-6 h-6" />
// Then render as: {provider.icon()}

This is purely optional and not needed for the current implementation.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81527a1 and 335bcc9.

📒 Files selected for processing (3)
  • frontend/src/features/auth/components/AuthMethodTab.tsx (2 hunks)
  • frontend/src/features/auth/helpers.tsx (1 hunks)
  • frontend/src/features/visualizer/components/AuthNode.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use TypeScript for all code files
Use ES modules (import/export syntax)
Prefer descriptive, unabbreviated variable and function names
Implement proper error handling with try-catch blocks and logging where appropriate
Use single quotes for strings
Include semicolons at the end of statements
Use arrow functions for callbacks and inline functions
Prefer const over let; avoid var
Use template literals for string interpolation
Maintain 2-space indentation
Format code with the repository Prettier configuration
Variables, parameters, properties, and functions must use camelCase
Constants and enum members must use UPPER_CASE
Include JSDoc comments for complex functions

Files:

  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/visualizer/components/AuthNode.tsx
  • frontend/src/features/auth/helpers.tsx
frontend/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.{tsx,ts}: Use functional React components with hooks exclusively
Use Radix UI primitives for accessibility
Optimize React component re-renders

Files:

  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/visualizer/components/AuthNode.tsx
  • frontend/src/features/auth/helpers.tsx
frontend/src/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.tsx: Implement TypeScript interfaces/types for all component props
Follow component composition patterns; keep components focused and single-purpose
Implement proper loading and error states in UI
Use a consistent icon set from lucide-react

Files:

  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/visualizer/components/AuthNode.tsx
  • frontend/src/features/auth/helpers.tsx
frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.{ts,tsx}: Use TanStack Query for server state management
Use React Hook Form for form handling with Zod validation
Optimize bundle size with proper imports

Files:

  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/visualizer/components/AuthNode.tsx
  • frontend/src/features/auth/helpers.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

React components and TypeScript types/interfaces must use PascalCase

Files:

  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/visualizer/components/AuthNode.tsx
  • frontend/src/features/auth/helpers.tsx
frontend/src/**/[A-Z]*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Component files must use PascalCase filenames (e.g., DataGrid.tsx)

Files:

  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/visualizer/components/AuthNode.tsx
🧬 Code graph analysis (3)
frontend/src/features/auth/components/AuthMethodTab.tsx (1)
frontend/src/features/auth/helpers.tsx (1)
  • oauthProviders (18-61)
frontend/src/features/visualizer/components/AuthNode.tsx (1)
frontend/src/features/auth/helpers.tsx (1)
  • oauthProviders (18-61)
frontend/src/features/auth/helpers.tsx (1)
shared-schemas/src/auth.schema.ts (1)
  • OAuthProvidersSchema (110-110)
🔇 Additional comments (6)
frontend/src/features/visualizer/components/AuthNode.tsx (2)

5-5: LGTM!

The import correctly references the centralized OAuth provider definitions from the new helpers module.


53-77: LGTM!

The dynamic rendering of OAuth providers is well-implemented. The code properly uses provider.id as the key, renders icons with appropriate sizing constraints, and applies conditional styling based on provider configuration state.

frontend/src/features/auth/components/AuthMethodTab.tsx (2)

1-1: LGTM!

All imported hooks (useState, useCallback, useMemo) are properly utilized in the component.


17-17: LGTM!

The import correctly brings in both the centralized provider list and type definition. Good use of the type modifier for type-only imports.

frontend/src/features/auth/helpers.tsx (2)

1-8: LGTM!

All imports are properly structured. The use of Vite's ?react syntax for SVG imports is correct, and importing the OAuthProvidersSchema type from shared schemas ensures type consistency across the codebase.


10-16: LGTM!

The OAuthProviderInfo interface is well-defined with appropriate types. Using OAuthProvidersSchema for the id field ensures type safety across provider references.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
frontend/src/features/auth/components/AddOAuthDialog.tsx (1)

12-12: Consider using inline type import syntax for consistency.

The import is functionally correct, but for consistency with the other files in this PR (OAuthConfigDialog.tsx line 23 and AuthMethodTab.tsx line 17), consider using the inline type import syntax:

-import type { OAuthProviderInfo } from '../helpers';
+import { type OAuthProviderInfo } from '../helpers';

This allows mixing runtime and type imports in the same statement if needed in the future.

frontend/src/features/auth/components/AuthMethodTab.tsx (1)

17-17: Optional: Consider import path consistency across related files.

This file uses an absolute import path (@/features/auth/helpers), while OAuthConfigDialog.tsx and AddOAuthDialog.tsx use relative paths (../helpers). All three files are in the same directory importing from the same module.

For better consistency, consider using the same import style across all three files. Either approach is valid, but consistency improves readability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 335bcc9 and 0848fd5.

📒 Files selected for processing (3)
  • frontend/src/features/auth/components/AddOAuthDialog.tsx (1 hunks)
  • frontend/src/features/auth/components/AuthMethodTab.tsx (5 hunks)
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use TypeScript for all code files
Use ES modules (import/export syntax)
Prefer descriptive, unabbreviated variable and function names
Implement proper error handling with try-catch blocks and logging where appropriate
Use single quotes for strings
Include semicolons at the end of statements
Use arrow functions for callbacks and inline functions
Prefer const over let; avoid var
Use template literals for string interpolation
Maintain 2-space indentation
Format code with the repository Prettier configuration
Variables, parameters, properties, and functions must use camelCase
Constants and enum members must use UPPER_CASE
Include JSDoc comments for complex functions

Files:

  • frontend/src/features/auth/components/AddOAuthDialog.tsx
  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx
frontend/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.{tsx,ts}: Use functional React components with hooks exclusively
Use Radix UI primitives for accessibility
Optimize React component re-renders

Files:

  • frontend/src/features/auth/components/AddOAuthDialog.tsx
  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx
frontend/src/**/*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.tsx: Implement TypeScript interfaces/types for all component props
Follow component composition patterns; keep components focused and single-purpose
Implement proper loading and error states in UI
Use a consistent icon set from lucide-react

Files:

  • frontend/src/features/auth/components/AddOAuthDialog.tsx
  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx
frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

frontend/src/**/*.{ts,tsx}: Use TanStack Query for server state management
Use React Hook Form for form handling with Zod validation
Optimize bundle size with proper imports

Files:

  • frontend/src/features/auth/components/AddOAuthDialog.tsx
  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

React components and TypeScript types/interfaces must use PascalCase

Files:

  • frontend/src/features/auth/components/AddOAuthDialog.tsx
  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx
frontend/src/**/[A-Z]*.tsx

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Component files must use PascalCase filenames (e.g., DataGrid.tsx)

Files:

  • frontend/src/features/auth/components/AddOAuthDialog.tsx
  • frontend/src/features/auth/components/AuthMethodTab.tsx
  • frontend/src/features/auth/components/OAuthConfigDialog.tsx
🧬 Code graph analysis (1)
frontend/src/features/auth/components/AuthMethodTab.tsx (2)
frontend/src/features/auth/helpers.tsx (1)
  • oauthProviders (18-61)
shared-schemas/src/auth.schema.ts (1)
  • OAuthProvidersSchema (110-110)
🔇 Additional comments (2)
frontend/src/features/auth/components/OAuthConfigDialog.tsx (1)

23-23: LGTM! Type import correctly updated to centralized helpers.

The change to import OAuthProviderInfo from the centralized helpers module is correct and maintains type safety. The inline type import syntax (import { type X }) is appropriate.

frontend/src/features/auth/components/AuthMethodTab.tsx (1)

1-1: LGTM! Provider centralization refactoring is well-executed.

The refactoring successfully centralizes OAuth provider data into the shared helpers module. All references to the local providers array have been correctly updated to use oauthProviders, and the imports are properly structured.

The change improves maintainability by eliminating duplicate provider definitions across components.

Also applies to: 17-17, 74-77, 82-82, 87-87, 134-134, 206-206

@tonychang04 tonychang04 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The effect LGTM. Just a general question for discussion.As we have more oauth providers now should we keep the enabled/disabled. Or rather show up = enabled, hidden = disabled

@Fermionic-Lyu

Copy link
Copy Markdown
Member Author

The effect LGTM. Just a general question for discussion.As we have more oauth providers now should we keep the enabled/disabled. Or rather show up = enabled, hidden = disabled

Yeah I am about to discuss about this on our next design meeting!

@Fermionic-Lyu
Fermionic-Lyu merged commit 6d014a3 into main Oct 27, 2025
@Fermionic-Lyu
Fermionic-Lyu deleted the sync-visualizer-auth-node branch October 27, 2025 16:56
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.

2 participants