-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix: [IDE] Page switch and State switch have deep links to entity to avoid interim load state #32980
Conversation
WalkthroughWalkthroughThe recent updates primarily focus on refining the navigation and focus mechanisms within the AppIDE environment. This involves the removal of outdated or unused imports and functions, the introduction of new key generation functions for editor focus, and adjustments in focus handling logic. These changes aim to streamline the codebase and enhance the user experience by addressing inconsistencies in the display of queries and JavaScript objects when switching between pages. Changes
Assessment against linked issues
The current changes do not directly address the bug specified in the linked issue (#31556). Further modifications might be necessary to specifically target and resolve the intermittent display of a blank state during page transitions. Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (5)
Files skipped from review as they are similar to previous changes (3)
Additional comments not posted (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 1
export const getSelectedEntityUrl = (path: string): string | undefined => { | ||
const ideType = getIDETypeByUrl(path); | ||
const basePaths = getBaseUrlsForIDEType(ideType); | ||
const entityPaths = basePaths.map((p) => `${p}/:entity*`); | ||
const match = matchPath<{ entity: string }>(path, entityPaths); | ||
if (match) { | ||
return match.params.entity; |
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.
Consider handling the case where no URL match is found explicitly, to improve clarity and maintainability.
if (match) {
return match.params.entity;
}
+ else {
+ return null; // or appropriate default value
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
export const getSelectedEntityUrl = (path: string): string | undefined => { | |
const ideType = getIDETypeByUrl(path); | |
const basePaths = getBaseUrlsForIDEType(ideType); | |
const entityPaths = basePaths.map((p) => `${p}/:entity*`); | |
const match = matchPath<{ entity: string }>(path, entityPaths); | |
if (match) { | |
return match.params.entity; | |
export const getSelectedEntityUrl = (path: string): string | undefined => { | |
const ideType = getIDETypeByUrl(path); | |
const basePaths = getBaseUrlsForIDEType(ideType); | |
const entityPaths = basePaths.map((p) => `${p}/:entity*`); | |
const match = matchPath<{ entity: string }>(path, entityPaths); | |
if (match) { | |
return match.params.entity; | |
} | |
else { | |
return null; // or appropriate default value | |
} |
Description
Page and State switches would navigate to the last selected segment which in turn would navigate to the last selected entity in that segment. This was causing a split second delay showing the segment in a loading / blank state till the entity navigation was processed. By changing the navigation links, we will now navigate directly to the last selected entity, avoiding multiple url changes and hence renders in intermediate states
Fixes #31556
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/8847779176
Commit: 0cd085a
Cypress dashboard url: Click here!
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit