fix: Refactor GitSyncModalV2 component
Description
This PR updates the GitSyncModalV2 component to conditionally display the Deploy and Merge components based on the currently active tab.
Changes:
The Deploy component is now only visible when the DEPLOY tab is active. The Merge component is now only visible when the MERGE tab is active. These changes improve the user experience by ensuring that messages within the 'Deploy' component persist and remain visible to the user when switching between tabs. This resolves the issue of disappearing messages upon tab switch, providing a more consistent and reliable user interface.
Videos for reference -
Before - https://www.loom.com/share/43ee69d458f4444b98d828291adaddf3
After - https://www.loom.com/share/d417d058d3fa49429764c0fb55d25dc8?sid=3f0c39d5-6022-4ba8-ab87-28967fb0aec1
Fixes #24988
Automation
/ok-to-test tags="@tag.Git"
:mag: Cypress test results
[!CAUTION]
If you modify the content in this section, you are likely to disrupt the CI result for your PR.
Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
Walkthrough
The changes involve a refactoring in the GitSyncModalV2.tsx file, specifically around the rendering of the Deploy and Merge components. The components are now wrapped in div elements with conditional display styles based on the activeTabKey, providing a cleaner and potentially more maintainable approach to conditional rendering within the modal.
Changes
| File Path | Change Summary |
|---|---|
app/client/src/pages/.../GitSyncModalV2.tsx |
Refactored rendering of Deploy and Merge components using div wrappers with conditional display styles. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Preserve commit message when switching tabs (#24988) | ❌ | The provided summary does not mention changes that would preserve the commit message state when switching tabs, which is the main issue reported. |
The refactoring described does not appear to address the core issue of the disappearing commit message upon tab switching, as no changes related to state management or preservation of form inputs are mentioned.
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?
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
@coderabbitaiin 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
@coderabbitaiin 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.
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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
Hi @Saadat-B thanks for raising this PR. Could you also add a couple of unit test cases for the solution you have raised?
Hi @brayn003 I've added the unit test cases as requested
I will need to create a separate PR to run tests
Using PR #33473 for running tests
Hi @Saadat-B I have raised a PR to run the complete test suite for these changes. You can find the PR reference in the thread. A couple of Cypress tests are failing for the changes. Would appreciate if we could resolve them before merging
Cool will have a look at them thanks @brayn003
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.
This PR has been closed because of inactivity.