Skip to content

feat: filter fc by page#39818

Merged
znamenskii-ilia merged 1 commit intoreleasefrom
feat/39765-filter-fc-by-page-2
Mar 20, 2025
Merged

feat: filter fc by page#39818
znamenskii-ilia merged 1 commit intoreleasefrom
feat/39765-filter-fc-by-page-2

Conversation

@znamenskii-ilia
Copy link
Contributor

@znamenskii-ilia znamenskii-ilia commented Mar 20, 2025

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.AIAgents
Spec:


Thu, 20 Mar 2025 07:49:32 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2025

Walkthrough

This update enhances the filtering logic in function calling configuration selectors. It imports getCurrentPageId from editor selectors and uses the retrieved currentPageId in both selectQueryEntityOptions and selectJsFunctionEntityOptions functions to ensure that only actions corresponding to the current page are included in the returned options.

Changes

File Path Change Summary
app/client/src/components/formControls/FunctionCallingConfigControl/.../selectors.ts Added currentPageId variable in both selectQueryEntityOptions and selectJsFunctionEntityOptions to filter actions by page.

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
Loading

Assessment against linked issues

Objective Addressed Explanation
Prevent listing actions from other pages in function call config (#39765)

Possibly related PRs

Suggested labels

Enhancement, ok-to-test

Suggested reviewers

  • jsartisan
  • AmanAgarwal041

Poem

In lines of code where logic flows,
A filter now distinguishes what clearly shows.
With currentPageId in the mix,
Our functions get their proper fix.
Cheers to clean code and thoughtful prose!

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@znamenskii-ilia znamenskii-ilia added the ok-to-test Required label for CI label Mar 20, 2025
@github-actions github-actions bot added AI Agents Issues related to agentic solutions on Appsmith Anvil Pod Issue related to Anvil project Task A simple Todo Enhancement New feature or request labels Mar 20, 2025
Copy link
Contributor

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8de1de8 and 59a8327.

📒 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 getCurrentPageId is 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);
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 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 getCurrentPageId in app/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.

@znamenskii-ilia znamenskii-ilia merged commit 435897e into release Mar 20, 2025
47 checks passed
@znamenskii-ilia znamenskii-ilia deleted the feat/39765-filter-fc-by-page-2 branch March 20, 2025 08:02
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
## 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Agents Issues related to agentic solutions on Appsmith Anvil Pod Issue related to Anvil project Enhancement New feature or request ok-to-test Required label for CI Task A simple Todo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Actions from other pages being list in function call config

2 participants