Conversation
WalkthroughThis update enhances the filtering logic in function calling configuration selectors. It imports Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Selector
participant EditorSelectors as getCurrentPageId
Client->>Selector: Invoke selectQueryEntityOptions/selectJsFunctionEntityOptions(state)
Selector->>EditorSelectors: getCurrentPageId(state)
EditorSelectors-->>Selector: Return currentPageId
Selector->>Selector: Filter actions based on currentPageId
Selector-->>Client: Return filtered options
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ 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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/components/formControls/FunctionCallingConfigControl/components/selectors.ts(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: perform-test / rts-build / build
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-lint / client-lint
🔇 Additional comments (3)
app/client/src/components/formControls/FunctionCallingConfigControl/components/selectors.ts (3)
8-8: Appropriate new import.The import of
getCurrentPageIdis correctly placed with other imports and necessary for the new page filtering functionality.
18-18: Good implementation of page filtering for query entities.The code correctly retrieves the current page ID and applies filtering to ensure only actions from the current page are included in the options. The filter is properly positioned after the existing AI plugin filter.
Also applies to: 29-29
53-64: Proper page filtering implementation for JS functions.The code correctly retrieves and uses the current page ID to filter JS functions. The restructuring of the return statement maintains readability while adding the necessary filtering logic.
| state: AppState, | ||
| ): FunctionCallingEntityTypeOption[] => { | ||
| const plugins = getPlugins(state); | ||
| const currentPageId = getCurrentPageId(state); |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Consider adding test coverage for the new filtering.
Ensure there are tests covering various scenarios of the new page filtering functionality, including what happens when no page is currently selected.
Also applies to: 53-53
🏁 Script executed:
#!/bin/bash
# Find tests that might be related to these selectors to check for coverage
# Search for test files that mention these selectors
echo "Searching for tests related to these selectors..."
rg -l "selectQueryEntityOptions|selectJsFunctionEntityOptions|selectEntityOptions" --glob "*.test.*" --glob "*.spec.*"
# Check if there are tests for getCurrentPageId
echo "Checking for tests of getCurrentPageId..."
rg -l "getCurrentPageId" --glob "*.test.*" --glob "*.spec.*"Length of output: 428
Action Required: Expand Test Coverage for New Filtering Functionality
- While we found a test for
getCurrentPageIdinapp/client/src/sagas/EvaluationsSaga.test.ts, the current tests do not appear to validate the new page filtering behavior. - Please add unit tests that explicitly cover:
- The scenario where a page is correctly selected.
- The scenario where no page is currently selected.
- This additional coverage should be applied both at line 18 and line 53 in
app/client/src/components/formControls/FunctionCallingConfigControl/components/selectors.ts.
## Description Fixes appsmithorg#39765 ## Automation /ok-to-test tags="@tag.AIAgents" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13964117859> > Commit: 59a8327 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13964117859&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.AIAgents` > Spec: > <hr>Thu, 20 Mar 2025 07:49:32 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved the filtering of available actions so that only those relevant to the current page are displayed, streamlining configuration and reducing interface clutter. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Fixes #39765
Automation
/ok-to-test tags="@tag.AIAgents"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13964117859
Commit: 59a8327
Cypress dashboard.
Tags:
@tag.AIAgentsSpec:
Thu, 20 Mar 2025 07:49:32 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit