Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Fix confluence page selector, jira issues and project selectors, teams chat selectors.

Type of Change

  • Bug fix

Testing

Tested manually with @aadamgough

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 Nov 12, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 12, 2025 0:33am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 12, 2025

Greptile Overview

Greptile Summary

Fixed critical hydration issues across Confluence, Jira, and Teams selectors by implementing proper state restoration on component mount. The changes address infinite API calls and missing display names when components reload with persisted values.

Key improvements:

  • Teams selector: Added lastRestoredValueRef to prevent infinite restore loops, and implemented display name caching for channels/chats during fetches
  • Confluence/Jira selectors: Added useEffect hooks to fetch item details on mount when value exists but component state is empty (hydration scenario)
  • Display names hook: Updated to fetch individual items instead of lists, fixed API endpoint paths for Wealthbox and Teams
  • Slack selector: Removed redundant hash symbol rendering (now stored in channel name)
  • Jira project selector: Added state tracking and preview card UI

All changes follow consistent patterns for hydration handling and display name caching across selectors.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes implement well-tested bug fixes for hydration issues with clear patterns. The use of refs to prevent infinite loops, proper useEffect dependencies, and consistent display name caching follow React best practices. The changes are scoped to fixing specific hydration bugs without introducing new features or architectural changes.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/file-selector/components/confluence-file-selector.tsx 5/5 Added useEffect to fetch page info on mount for hydration, standardized file info structure with proper URL construction, added display name caching
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/file-selector/components/teams-message-selector.tsx 5/5 Fixed infinite restore calls by tracking last restored value with ref, added display name caching for channels and chats to improve hydration
apps/sim/hooks/use-display-name.ts 5/5 Updated API calls to fetch individual items instead of lists, fixed endpoint paths and parameter naming for Wealthbox and Teams

Sequence Diagram

sequenceDiagram
    participant User
    participant Component as Selector Component
    participant Store as DisplayNames Store
    participant API as Backend API
    
    Note over Component: On Mount/Hydration
    User->>Component: Component loads with existing value
    Component->>Component: Check if value & credentials exist
    Component->>Store: Check cached display name
    
    alt No cached display name
        Component->>API: Fetch access token
        API-->>Component: Return access token
        Component->>API: Fetch item details (page/issue/chat)
        API-->>Component: Return item data
        Component->>Store: Cache display name
        Component->>Component: Update selectedItem state
    else Display name cached
        Component->>Component: Use cached name
    end
    
    Note over Component: On User Interaction
    User->>Component: Opens dropdown
    Component->>API: Fetch list of items
    API-->>Component: Return items list
    Component->>Store: Cache all item names
    Component->>Component: Display items
Loading

Copy link
Contributor

@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.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 merged commit 679c341 into staging Nov 12, 2025
9 checks passed
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
* fix(jira): issue and project selector

* fix endpoints

* remove # for selector

* fix chat selector

* add preview card for jira

* fix inf calls for teams

* fix inf teams calls

* inf confluence calls

* fix confluence selector

* add small # back for slack channel selector

* fix wealthbox selector
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
* fix(jira): issue and project selector

* fix endpoints

* remove # for selector

* fix chat selector

* add preview card for jira

* fix inf calls for teams

* fix inf teams calls

* inf confluence calls

* fix confluence selector

* add small # back for slack channel selector

* fix wealthbox selector
@waleedlatif1 waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
@waleedlatif1 waleedlatif1 deleted the fix/selectors-hydration branch November 18, 2025 01:28
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