-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: enhance navigation state handling in PageEntity and saga #41081
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
Updated the PageEntity component to include navigation state when dispatching the navigateToAnotherPage action, ensuring that the invokedBy property is set to NavigationMethod.EntityExplorer. Additionally, refactored the pushToHistory function in the NavigateActionSaga to handle navigation with state more effectively, maintaining backward compatibility with existing navigation patterns. Updated the NavigateToAnotherPagePayload type to make the state and query properties optional for improved flexibility.
WalkthroughThis change updates how navigation actions are dispatched and handled. It modifies the navigation payload to include contextual information, adjusts the saga to support multiple payload variants for backward compatibility, and makes certain payload properties optional in their type definition. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PageEntity
participant Redux
participant Saga
participant History
User->>PageEntity: Triggers page switch
PageEntity->>Redux: Dispatch navigateToAnotherPage({ pageURL, state })
Redux->>Saga: Handles navigateToAnotherPage action
Saga->>History: Calls pushToHistory with payload
History-->>Saga: Navigates using payload (handles string/object/state/query)
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings
app/client/src/sagas/ActionExecution/NavigateActionSaga/types.ts (4)
app/client/src/pages/AppIDE/components/PageList/PageEntity.tsx (3)
app/client/src/sagas/ActionExecution/NavigateActionSaga/index.ts (8)
🧬 Code Graph Analysis (1)app/client/src/pages/AppIDE/components/PageList/PageEntity.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (5)
✨ 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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
|
Description
Problem
Navigation state was not included when dispatching the navigateToAnotherPage action, causing the invokedBy property to be unset and leading to flakiness in the cypress spec:
app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Selected_Widgets_spec.js
Root cause
The PageEntity component did not pass navigation state, and the NavigateActionSaga’s pushToHistory function did not effectively handle navigation with state, leading to incomplete navigation data.
Solution
This PR handles updating the PageEntity component to include navigation state when dispatching the navigateToAnotherPage action, ensuring the invokedBy property is set to NavigationMethod.EntityExplorer. It also refactors the pushToHistory function in the NavigateActionSaga to better support navigation with state, preserving backward compatibility. The NavigateToAnotherPagePayload type is updated to make state and query optional for greater flexibility.
Fixes a regression introduced here: #41074
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/16065286850
Commit: 548dd7e
Cypress dashboard.
Tags:
@tag.All
Spec:
Fri, 04 Jul 2025 05:06:13 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation