Skip to content
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: hidden page was not being checked for route change #35558

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Aug 8, 2024

Description

There was a selector which was returning the pages array without hidden pages, that array was being used to update the app viewer component to render the page, since the hidden page object was not present in the array, hence the UI was not updating for the hidden page.

Fixes #35557
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/10312684750
Commit: e8064dc
Cypress dashboard.
Tags: @tag.All
Spec:


Fri, 09 Aug 2024 03:28:11 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced page list retrieval now includes hidden pages in the AppViewer component.
    • Introduced a new selector for improved filtering of pages based on their visibility status.
    • Updated the source of page list data to improve navigation and display functionality.

These changes aim to provide users with a more comprehensive view of available content, improving overall user experience.

@github-actions github-actions bot added Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Framework Functions Cases related to internal functions like showAlert(), navigateTo() etc... Javascript Product Issues related to users writing javascript in appsmith Needs Triaging Needs attention from maintainers to triage Production Query & JS Pod Issues related to the query & JS Pod labels Aug 8, 2024
Copy link
Contributor

coderabbitai bot commented Aug 8, 2024

Walkthrough

The recent updates improve the AppViewer component by transitioning from the previous page retrieval function to getPageList. This transition enhances the handling of pages, including hidden ones, potentially resolving issues related to navigation and improving the overall user experience. The changes ensure that users can access pages more effectively, addressing critical bugs that impacted application performance in production environments.

Changes

Files Change Summary
app/client/src/pages/AppViewer/index.tsx Replaced getViewModePageList with getPageList, enhancing the logic for page retrieval.
app/client/src/selectors/editorSelectors.tsx Introduced getViewModePageListWithHiddenPages for improved visibility handling of pages.

Assessment against linked issues

Objective Addressed Explanation
NavigateTo function should allow access to hidden pages without showing blank screens. (35557)
Preserve query parameters when navigating to hidden pages. (35557) The changes do not explicitly ensure query parameters are preserved.

In the halls of code where changes reside,
Navigating hidden paths, our spirits abide.
No more blank pages, the journey is clear,
With logic improved, we bring forth good cheer.
Let us celebrate progress, as solutions appear!


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?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Aug 8, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10307698939.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 35558.
recreate: .

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

Commits

Files that changed from the base of the PR and between 4bbbaec and a9bc4e4.

Files selected for processing (2)
  • app/client/src/pages/AppViewer/index.tsx (2 hunks)
  • app/client/src/selectors/editorSelectors.tsx (1 hunks)
Additional context used
Biome
app/client/src/selectors/editorSelectors.tsx

[error] 266-266: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

Additional comments not posted (1)
app/client/src/pages/AppViewer/index.tsx (1)

22-22: Good use of the new selector for page retrieval.

The change to use getViewModePageListWithHiddenPages ensures hidden pages are included, addressing the navigation issue. This aligns well with the PR objectives.

Also applies to: 91-91

const currentPage = pageList.find(
(page) => page.pageId === currentPageId,
);
if (!!currentPage?.isHidden) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove redundant double-negation.

The double-negation !! is unnecessary as the condition will already be coerced to a boolean.

-      if (!!currentPage?.isHidden) {
+      if (currentPage?.isHidden) {
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!!currentPage?.isHidden) {
if (currentPage?.isHidden) {
Tools
Biome

[error] 266-266: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

Copy link

github-actions bot commented Aug 8, 2024

Deploy-Preview-URL: https://ce-35558.dp.appsmith.com

@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Aug 8, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10308236138.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 35558.
recreate: .

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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a9bc4e4 and e8064dc.

Files selected for processing (1)
  • app/client/src/pages/AppViewer/index.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/AppViewer/index.tsx

Copy link

github-actions bot commented Aug 8, 2024

Deploy-Preview-URL: https://ce-35558.dp.appsmith.com

@nidhi-nair nidhi-nair added the ok-to-test Required label for CI label Aug 9, 2024
@AmanAgarwal041 AmanAgarwal041 merged commit 2ca40ec into release Aug 9, 2024
83 checks passed
@AmanAgarwal041 AmanAgarwal041 deleted the fix/35557-hidden-page branch August 9, 2024 05:03
@btsgh
Copy link
Collaborator

btsgh commented Aug 9, 2024

@AmanAgarwal041 - checking back here, is there automation test added for this bug fix so that we don't regress on this in the future?

@AmanAgarwal041
Copy link
Contributor Author

@btsgh There is no such automation I think. @nidhi-nair Can you ask the person who was working on this piece to add an automation test for the above scenario ?

AmanAgarwal041 added a commit that referenced this pull request Aug 9, 2024
@btsgh
Copy link
Collaborator

btsgh commented Aug 9, 2024

Sorry @AmanAgarwal041 - Probably @rishabhrathod01 is the right person to be adding an automation test for this case?

@AmanAgarwal041
Copy link
Contributor Author

@btsgh I think this comes under IDE pod. Maybe anyone from that pod can take that over, if they are occupied we can also pick that up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Framework Functions Cases related to internal functions like showAlert(), navigateTo() etc... Javascript Product Issues related to users writing javascript in appsmith Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production Query & JS Pod Issues related to the query & JS Pod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: navigateTo hidden pages is not working properly and breaking apps in deployed mode
3 participants