Skip to content

fix(connectors): align connector scopes with oauth config and fix kb modal UX#3573

Merged
waleedlatif1 merged 7 commits intostagingfrom
fix/connector
Mar 14, 2026
Merged

fix(connectors): align connector scopes with oauth config and fix kb modal UX#3573
waleedlatif1 merged 7 commits intostagingfrom
fix/connector

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Fix connector OAuth scope mismatches causing "Additional permissions required" for Gmail, Google Sheets, Google Calendar
  • Add missing requiredScopes for Reddit connector
  • Switch GitHub connector from OAuth to PAT (apiKey) — no OAUTH_PROVIDERS entry existed
  • Remove duplicate "Connected Sources" heading in connectors modal
  • Fix checkbox click not toggling metadata tags in add-connector modal
  • Show API key text while typing, mask on blur

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 14, 2026 10:30am

Request Review

@cursor
Copy link

cursor bot commented Mar 14, 2026

PR Summary

Medium Risk
Medium risk because it changes connector authentication requirements (OAuth scopes and GitHub switching to API-key/PAT) and adds new dependency/canonical-field resolution logic in the add-connector modal that could affect connector creation if misconfigured.

Overview
Improves the knowledge-base add-connector UX by adding support for dynamic selector config fields with canonical pairs (selector vs manual input), dependency-based option loading, and automatic clearing of dependent fields; submit now resolves canonical pairs into a normalized sourceConfig.

Updates multiple connector configs to use the new selector fields (e.g., Airtable base/table cascade, Jira/Confluence space/project, Slack channel, etc.), and fixes auth mismatches by adjusting OAuth requiredScopes (Gmail/Calendar/Sheets, Reddit) and switching the GitHub connector from OAuth to API-key PAT.

Also includes small UI/docs tweaks: modal sizing/scroll behavior, API key input masking only when blurred, fix tag checkbox click handling, remove duplicate “Connected Sources” heading, change navbar Docs link to external, simplify docs-site AnimatedBlocks, and document selector/canonical-pair rules in .claude/commands/add-connector.md.

Written by Cursor Bugbot for commit b4cd61a. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 14, 2026

Greptile Summary

This PR fixes OAuth scope mismatches that were causing false "Additional permissions required" warnings for Gmail, Google Sheets, and Google Calendar connectors, adds missing requiredScopes for Reddit, switches the GitHub connector to PAT (apiKey) auth since no OAuth provider existed for it, and addresses several KB modal UX issues (duplicate heading, checkbox double-toggle, API key masking on blur).

The connector scope fixes correctly align requiredScopes with what getMissingRequiredScopes actually finds on the stored credential (exact-match comparison), matching the shared OAuth provider scopes used across multiple tools. The modal UX improvements are clean and the resolveDepValue helper correctly resolves canonical-pair field values through the active mode.

Key changes:

  • gmail, google-calendar, google-sheets connectors: requiredScopes aligned to the OAuth provider's actual granted scopes to eliminate false warnings
  • reddit connector: requiredScopes: ['read'] added
  • github connector: switched to apiKey (PAT) mode — no OAuth provider config existed
  • add-connector-modal: checkbox onCheckedChange + onClick stopPropagation fix; API key input shows as text while focused, masks on blur; apiKeyFocused is not reset in handleSelectType (minor)
  • connector-selector-field: resolveDepValue helper correctly reads the active canonical-mode's field when building selector context
  • connectors-section: duplicate "Connected Sources" heading removed
  • Unrelated changes not mentioned in PR description: animated-blocks.tsx removes the full cycling animation from the docs landing page, converting it to a static SVG; navbar.tsx changes the Docs link from internal /docs (with chevron) to external https://docs.sim.ai
  • .claude/commands/add-connector.md: comprehensive canonical-pair / selector documentation added

Confidence Score: 4/5

  • Safe to merge with one minor fix and clarification of the two undocumented changes in docs/navbar.
  • The connector scope fixes are well-reasoned and consistent (as confirmed in prior review rounds). The modal UX fixes are correct. The one logic gap is apiKeyFocused not being reset on re-selection, which is a minor UX inconsistency rather than a data or security issue. The two unrelated changes (animated-blocks.tsx animation removal, navbar.tsx docs link change) lower confidence slightly since they are undocumented and affect the docs landing page visually.
  • apps/docs/components/ui/animated-blocks.tsx (undocumented animation removal — visual regression on docs landing page), apps/sim/app/(home)/components/navbar/navbar.tsx (undocumented docs link change)

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx Fixes tag checkbox double-toggle, adds API key show-on-focus/mask-on-blur UX, and passes canonicalModes to ConnectorSelectorField. Minor issue: apiKeyFocused is not reset in handleSelectType, so re-entering the configure step may show the API key field as unmasked text.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/components/connector-selector-field.tsx Adds resolveDepValue helper that reads from the correct canonical-mode field (selector vs manual) when building SelectorContext and checking depsResolved. Cleanly fixes the stale-context bug from a prior review round.
apps/sim/connectors/github/github.ts Switches auth from OAuth to PAT (apiKey mode) since no GitHub OAuth provider existed. Label and placeholder are set appropriately for a GitHub Personal Access Token.
apps/sim/connectors/reddit/reddit.ts Adds missing requiredScopes: ['read'] to fix the "Additional permissions required" warning for the Reddit connector.
apps/docs/components/ui/animated-blocks.tsx Removes the full cycling animation state machine (enter/exit stagger, hold timers) and 'use client' directive, converting to a static SVG renderer. This is a visible regression on the docs landing page not mentioned in the PR description. The React.memo on BlockGroup is now a no-op in an RSC context.
apps/sim/app/(home)/components/navbar/navbar.tsx Changes the Docs nav link from an internal /docs path with a chevron icon to an external https://docs.sim.ai URL. This is an unscoped change not mentioned in the PR description.

Sequence Diagram

sequenceDiagram
    participant UI as ConnectorCard (UI)
    participant CR as CONNECTOR_REGISTRY
    participant OC as useOAuthCredentials
    participant Utils as getMissingRequiredScopes

    UI->>CR: Look up connectorDef by connectorType
    CR-->>UI: connectorDef (auth.requiredScopes)
    UI->>OC: fetch credentials for providerId
    OC-->>UI: credentials[]
    UI->>Utils: getMissingRequiredScopes(credential, requiredScopes)
    Note over Utils: Exact string match of requiredScopes<br/>against credential.grantedScopes
    Utils-->>UI: missingScopes[]
    alt missingScopes.length > 0
        UI->>UI: Show "Additional permissions required" banner
        UI->>UI: Open OAuthRequiredModal on click
    else No missing scopes
        UI->>UI: Normal connector card (no banner)
    end
Loading

Comments Outside Diff (2)

  1. apps/sim/app/(home)/components/navbar/navbar.tsx, line 13-18 (link)

    Docs link changed to external URL — unrelated to PR scope

    The Docs nav entry was changed from an internal /docs path (with a chevron icon) to an external link https://docs.sim.ai. This is not mentioned in the PR description and is unrelated to the connector scope/KB modal fixes. If the internal docs route is being deprecated in favour of the external docs site, this should be called out explicitly so reviewers can verify the external URL is correct and the internal route is no longer needed.

  2. apps/docs/components/ui/animated-blocks.tsx, line 1-10 (link)

    Animation removed without mention in PR description

    The previous version of this file was a client component ('use client') with a full cycling animation: block groups entered with a stagger, held for 3 seconds, exited, and cycled. The entire animation state machine (useState, useEffect, ENTER_STAGGER, EXIT_STAGGER, INITIAL_HOLD, etc.) has been removed — the component is now static SVGs.

    This is a visible regression on the docs landing page. Additionally, React.memo wrapping BlockGroup has no effect in a server component (RSC) and can be removed. If this simplification is intentional, it should be documented in the PR description so reviewers can confirm the change was deliberate.

Last reviewed commit: b4cd61a

…onfig

Replace manual ID text inputs with dynamic selector dropdowns that fetch
options from the existing selector registry. Users can toggle between
selector and manual input via canonical pairs (basic/advanced mode).

Adds selector support to 12 connectors: Airtable (cascading base→table),
Slack, Gmail, Google Calendar, Linear (cascading team→project), Jira,
Confluence, MS Teams (cascading team→channel), Notion, Asana, Webflow,
and Outlook. Dependency clearing propagates across canonical siblings to
prevent stale cross-mode data on submit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

…ctive mode values

Fixes three issues from PR review:
- Dependency clearing now includes canonical siblings of dependent fields
  (e.g., changing base clears both tableSelector AND tableIdOrName)
- Selector context and depsResolved now resolve dependency values through
  the active canonical mode, not just the raw depFieldId
- Tooltip text changed from "Switch to manual ID" to "Switch to manual input"
  to correctly describe dropdown fallbacks (e.g., Outlook folder)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit d06aa1d into staging Mar 14, 2026
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/connector branch March 14, 2026 10:31
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