Skip to content

feat(platform): add isInvalid input prop, refactor auth errors, drop custom integrations#962

Merged
Israeltheminer merged 3 commits into
mainfrom
feat/auth-input-validation-and-integrations-cleanup
Apr 3, 2026
Merged

feat(platform): add isInvalid input prop, refactor auth errors, drop custom integrations#962
Israeltheminer merged 3 commits into
mainfrom
feat/auth-input-validation-and-integrations-cleanup

Conversation

@Israeltheminer
Copy link
Copy Markdown
Collaborator

@Israeltheminer Israeltheminer commented Apr 3, 2026

Summary

  • Input component: Add isInvalid prop to show visual error state (border + shake) without requiring an error message string
  • Login page: Refactor error display — both email and password fields highlight on error, with a standalone alert message below the form fields instead of attaching to the password input
  • Sign-up page: Guard against access when users already exist by redirecting to login
  • Integrations: Remove the "custom" integration concept — drop the custom tab, badge variant, and filtering logic; all integrations are now treated uniformly with a single "Connected" badge and always-visible delete button
  • CRM assistant: Make agent visible in chat, reorder JSON fields

Test plan

  • Verify login form shows red borders on both email and password fields when credentials are wrong
  • Verify error message appears as standalone text below password field
  • Verify typing in either field clears the error state
  • Verify sign-up page redirects to login when users already exist
  • Verify integrations page shows only "All integrations" and "Connected" tabs
  • Verify delete button appears for all integrations in the panel
  • Verify uploading a new integration no longer adds source: 'custom' metadata
  • Run existing integration and auth tests

Summary by CodeRabbit

Release Notes

  • New Features

    • Added optional validation state support to input components for enhanced error feedback
  • Improvements

    • Improved login error display with dedicated alert messaging below input fields
    • Sign-up page now redirects to login when users already exist
    • CRM Assistant updated for chat visibility
  • Refactor

    • Removed "custom" integrations tab and associated functionality
    • Simplified integration management UI and related logic
    • Updated integration button labels for clarity

…custom integrations

- Add `isInvalid` prop to Input component for visual error state without requiring an error message
- Refactor login page to show error as standalone alert instead of attaching to password field
- Guard sign-up page: redirect to login if users already exist
- Remove "custom" integration tab, badge, and filtering logic — all integrations are now treated uniformly
- Always show delete button in integration panel
- Make CRM assistant agent visible in chat
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

This pull request removes the "custom" integrations classification across the platform, refactors login form error display to use a separate alert block instead of form field error messages, adds a user existence check to the sign-up page, and updates the CRM assistant agent configuration. Changes span example configurations, UI components (Input, IntegrationCard, IntegrationPanel, Integrations list), route logic (login, sign-up), tests, and localization strings. The isCustom prop and related metadata source tracking are eliminated throughout the integrations feature, the login form error handling now uses an explicit isInvalid flag with a dedicated error message block, and sign-up now redirects to login when users already exist.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title comprehensively covers all major changes: adding the isInvalid input prop, refactoring auth error handling, and removing custom integrations feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/auth-input-validation-and-integrations-cleanup
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/auth-input-validation-and-integrations-cleanup

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

Copy link
Copy Markdown

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
services/platform/app/features/settings/integrations/components/integrations.tsx (1)

22-33: 🧹 Nitpick | 🔵 Trivial

Consider adding isActive to IntegrationListItem interface.

The code accesses integration.isActive at lines 68 and 149, but isActive is not explicitly declared in the IntegrationListItem interface. It currently relies on the catch-all [key: string]: unknown index signature, which defeats type safety—isActive could be any type or missing entirely.

♻️ Proposed fix to add explicit property
 export interface IntegrationListItem {
   _id: string;
   slug: string;
   title: string;
   description?: string;
   installed: boolean;
+  isActive?: boolean;
   type?: 'rest_api' | 'sql';
   authMethod: string;
   operationCount: number;
   hash: string;
   [key: string]: unknown;
 }

Also applies to: 68-68, 149-149

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@services/platform/app/features/settings/integrations/components/integrations.tsx`
around lines 22 - 33, The IntegrationListItem interface is missing an explicit
isActive property which is accessed as integration.isActive in the component;
add isActive?: boolean to the IntegrationListItem declaration so TypeScript
enforces its type, then update call sites that read integration.isActive (e.g.,
the checks in the integrations component where integration.isActive is used) to
treat it as a boolean (coalesce to false if undefined) or ensure providers
supply it, ensuring type safety across the component.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@services/platform/app/routes/_auth/log-in.tsx`:
- Around line 173-181: The error block rendering loginError should include the
same icon used by the Input error messages for visual consistency: import and
render the same icon (e.g., XCircle or Info) before the {loginError} text inside
the paragraph that currently uses className="text-destructive flex items-center
gap-1.5 text-sm"; update the JSX for the loginError block in the
_auth/log-in.tsx route to place the icon component (matching the Input
component's usage) as the first child while preserving role="alert" and
aria-live="polite" so styling and accessibility remain consistent with the Input
component.

In `@services/platform/app/routes/_auth/sign-up.tsx`:
- Around line 130-132: The current check in the SignUp route that returns null
when isLoadingUsers or hasUsers === true should instead render an accessible
status message; replace the blank return with an element using an aria-live
region (e.g., <div role="status" aria-live="polite">) that displays a translated
message so screen readers receive feedback. Use the existing translation
function (e.g., t or i18n) with a key like "signUp.loading" or
"signUp.redirecting" and render that string when isLoadingUsers or hasUsers is
true; ensure the element is lightweight and visually unobtrusive but present in
the DOM instead of returning null.

---

Outside diff comments:
In
`@services/platform/app/features/settings/integrations/components/integrations.tsx`:
- Around line 22-33: The IntegrationListItem interface is missing an explicit
isActive property which is accessed as integration.isActive in the component;
add isActive?: boolean to the IntegrationListItem declaration so TypeScript
enforces its type, then update call sites that read integration.isActive (e.g.,
the checks in the integrations component where integration.isActive is used) to
treat it as a boolean (coalesce to false if undefined) or ensure providers
supply it, ensuring type safety across the component.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b2155095-d287-44c6-ac56-07afd7bd1200

📥 Commits

Reviewing files that changed from the base of the PR and between cfd98ff and 91b8486.

📒 Files selected for processing (12)
  • examples/agents/crm-assistant.json
  • services/platform/app/components/ui/forms/input.tsx
  • services/platform/app/features/auth/__tests__/login-form-error-clearing.test.tsx
  • services/platform/app/features/settings/integrations/components/__tests__/integration-card.test.tsx
  • services/platform/app/features/settings/integrations/components/__tests__/integrations.test.tsx
  • services/platform/app/features/settings/integrations/components/integration-card.tsx
  • services/platform/app/features/settings/integrations/components/integration-panel.tsx
  • services/platform/app/features/settings/integrations/components/integration-upload/integration-upload-dialog.tsx
  • services/platform/app/features/settings/integrations/components/integrations.tsx
  • services/platform/app/routes/_auth/log-in.tsx
  • services/platform/app/routes/_auth/sign-up.tsx
  • services/platform/messages/en.json
💤 Files with no reviewable changes (1)
  • services/platform/app/features/settings/integrations/components/tests/integrations.test.tsx

Comment on lines +173 to +181
{loginError && (
<p
role="alert"
aria-live="polite"
className="text-destructive flex items-center gap-1.5 text-sm"
>
{loginError}
</p>
)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider adding an icon to match the Input component's error styling.

The standalone error block uses the same classes as the Input component's error message (text-destructive flex items-center gap-1.5 text-sm) but omits the icon. The Input component renders <XCircle> or <Info> before the error text. Adding an icon here would maintain visual consistency.

🎨 Optional: Add icon for visual consistency
+import { XCircle } from 'lucide-react';
+
 // ... in JSX:
 {loginError && (
   <p
     role="alert"
     aria-live="polite"
     className="text-destructive flex items-center gap-1.5 text-sm"
   >
+    <XCircle className="size-4" aria-hidden="true" />
     {loginError}
   </p>
 )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@services/platform/app/routes/_auth/log-in.tsx` around lines 173 - 181, The
error block rendering loginError should include the same icon used by the Input
error messages for visual consistency: import and render the same icon (e.g.,
XCircle or Info) before the {loginError} text inside the paragraph that
currently uses className="text-destructive flex items-center gap-1.5 text-sm";
update the JSX for the loginError block in the _auth/log-in.tsx route to place
the icon component (matching the Input component's usage) as the first child
while preserving role="alert" and aria-live="polite" so styling and
accessibility remain consistent with the Input component.

Comment on lines +130 to +132
if (isLoadingUsers || hasUsers === true) {
return null;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid null for loading/redirect state; provide accessible status feedback.

Line 130-132 currently renders a blank screen, which gives no visual or screen-reader feedback during loading/redirect. Render a translated status message in an aria-live region instead.

Suggested patch
-  if (isLoadingUsers || hasUsers === true) {
-    return null;
-  }
+  if (isLoadingUsers) {
+    return (
+      <p aria-live="polite" className="text-sm text-muted-foreground">
+        {t('signup.checkingAccess')}
+      </p>
+    );
+  }
+
+  if (hasUsers === true) {
+    return (
+      <p aria-live="polite" className="text-sm text-muted-foreground">
+        {t('signup.redirectingToLogin')}
+      </p>
+    );
+  }

As per coding guidelines, "Use aria-live regions for dynamic content updates."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (isLoadingUsers || hasUsers === true) {
return null;
}
if (isLoadingUsers) {
return (
<p aria-live="polite" className="text-sm text-muted-foreground">
{t('signup.checkingAccess')}
</p>
);
}
if (hasUsers === true) {
return (
<p aria-live="polite" className="text-sm text-muted-foreground">
{t('signup.redirectingToLogin')}
</p>
);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@services/platform/app/routes/_auth/sign-up.tsx` around lines 130 - 132, The
current check in the SignUp route that returns null when isLoadingUsers or
hasUsers === true should instead render an accessible status message; replace
the blank return with an element using an aria-live region (e.g., <div
role="status" aria-live="polite">) that displays a translated message so screen
readers receive feedback. Use the existing translation function (e.g., t or
i18n) with a key like "signUp.loading" or "signUp.redirecting" and render that
string when isLoadingUsers or hasUsers is true; ensure the element is
lightweight and visually unobtrusive but present in the DOM instead of returning
null.

Merge main's supportedModels field with our description and visibleInChat changes.
@Israeltheminer Israeltheminer merged commit fe08e8c into main Apr 3, 2026
16 checks passed
@Israeltheminer Israeltheminer deleted the feat/auth-input-validation-and-integrations-cleanup branch April 3, 2026 14:47
yannickmonney pushed a commit that referenced this pull request Apr 8, 2026
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