-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore: fix agent creation bug #40251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change refactors the template selectors in the codebase. The Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant Selectors
participant State
UI->>Selectors: Call getFilteredTemplateList (or related selector)
Selectors->>Selectors: Use getTemplatesByFlagSelector
Selectors->>State: Access state.ui.templates.templates
Selectors->>State: Access isAiAgentFlowEnabled flag
Selectors->>Selectors: Filter templates based on flag logic
Selectors-->>UI: Return filtered templates
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
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 (1)
app/client/src/selectors/templatesSelectors.tsx (1)
31-32
: Changed selector from memoized to direct function.This change converts
getTemplatesSelector
from a memoized selector to a direct function. While this simplifies the code, be aware that removing memoization could potentially impact performance if this selector is called frequently with the same state.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/selectors/templatesSelectors.tsx
(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/client/src/selectors/templatesSelectors.tsx (1)
app/client/src/ce/reducers/index.tsx (1)
AppState
(98-191)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (4)
app/client/src/selectors/templatesSelectors.tsx (4)
34-56
: Good implementation of flag-based template filtering.The new
getTemplatesByFlagSelector
properly implements filtering logic based on theisAiAgentFlowEnabled
flag. The code:
- Uses
createSelector
for memoization- Shows only templates with "Agent" use case when the flag is enabled
- Always filters out templates titled "AI Agent"
The comments clearly explain the filtering logic and include a TODO for future work.
130-130
: Updated to use flag-based filtering.The
getFilteredTemplateList
now correctly uses the newgetTemplatesByFlagSelector
instead of the raw templates list, ensuring consistent application of the AI agent flow filtering logic.
194-194
: Updated to use flag-based filtering.The
templatesDatasourceFiltersSelector
now correctly uses the newgetTemplatesByFlagSelector
, ensuring datasource filters are derived from the properly filtered templates list.
230-230
: Updated to use flag-based filtering.The
getFilterListSelector
now correctly uses the newgetTemplatesByFlagSelector
, ensuring filter lists are derived from the properly filtered templates list.
/ok-to-test tags="@tag.Templates"
Summary by CodeRabbit
New Features
Refactor
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14465699770
Commit: 7050a8b
Cypress dashboard.
Tags:
@tag.Templates
Spec:
Tue, 15 Apr 2025 09:31:34 UTC