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

feat: center align action forms #37763

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

albinAppsmith
Copy link
Collaborator

@albinAppsmith albinAppsmith commented Nov 27, 2024

Description

This PR will align the action forms to the center.

Fixes #37951

Automation

/ok-to-test tags="@tag.Sanity, @tag.Datasource"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12156033628
Commit: 707ec4f
Cypress dashboard.
Tags: @tag.Sanity, @tag.Datasource
Spec:


Wed, 04 Dec 2024 14:21:33 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced styling for the form components, improving layout flexibility and responsiveness.
    • Introduced a new class for form information text to allow for specific styling.
  • Bug Fixes

    • Adjusted styles to ensure proper display of text and layout in various form components.

Copy link
Contributor

coderabbitai bot commented Nov 27, 2024

Walkthrough

The changes in this pull request involve modifications to several components related to layout and styling adjustments. The CSS for the Zone component has been updated to enhance layout flexibility, particularly for the .zone class. Additionally, the UQIEditorForm component has received minor enhancements to its properties, and the StyledFormInfo component has been adjusted to improve text handling and styling. These changes collectively aim to refine the user interface and improve responsiveness.

Changes

File Change Summary
app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Zone/styles.module.css Updated .zone class for layout flexibility, added global class .ar-form-info-text, refined global styles.
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx Enhanced Flex component with alignItems property; structure and functionality unchanged.
app/client/src/components/editorComponents/form/fields/StyledFormComponents.tsx Modified StyledFormInfo with new CSS properties; updated FormInfoText to include new class name.

Possibly related PRs

Suggested labels

UI Improvement, IDE Product, Task, IDE Pod, ok-to-test

Suggested reviewers

  • AmanAgarwal041
  • hetunandu
  • ankitakinger

🎉 In code we trust, with styles refined,
A layout so flexible, it's truly aligned.
From zones to forms, each change is a gem,
Enhancing our UI, we’re proud of our stem!
So here’s to the tweaks, both big and small,
Together we build, together we stand tall! 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f526f7d and 707ec4f.

📒 Files selected for processing (1)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx

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>, 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 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.

@github-actions github-actions bot added the Enhancement New feature or request label Nov 27, 2024
@albinAppsmith
Copy link
Collaborator Author

/build-deploy-preview skip-test=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12043358561.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 37763.
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

Reviewing files that changed from the base of the PR and between f41cf12 and f526f7d.

📒 Files selected for processing (3)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Zone/styles.module.css (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx (1 hunks)
  • app/client/src/components/editorComponents/form/fields/StyledFormComponents.tsx (2 hunks)
🔇 Additional comments (5)
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx (2)

25-31: LGTM! Center alignment implementation looks good.

The Flex component properties effectively implement the center alignment requirement while maintaining proper layout structure.


29-29: Verify scroll behavior with various form lengths.

The overflowY="scroll" might affect user experience with long forms. Please verify:

  • Scrolling behavior with forms of different lengths
  • Interaction with parent container scrolling
  • Mobile responsiveness
✅ Verification successful

Let me gather more context about the component hierarchy and styling to better understand the scrolling behavior.


Let me gather more information about the component's layout and scroll behavior.


Based on the code analysis, I can now provide a final response about the scroll behavior:

The overflowY="scroll" setting is appropriate and works well with the component hierarchy.

  • The parent Flex component has flex="1" and overflow="hidden", which creates a proper scrollable container
  • Other response components like QueryResponseTab and Table also use scroll behavior, showing this is a consistent pattern
  • The component is part of a form layout that handles variable content lengths
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other scroll configurations in parent components
rg -A 3 'overflow[XYxy]|scroll' app/client/src/PluginActionEditor

Length of output: 6105


Script:

#!/bin/bash
# Search for the parent components and their layout/styling
ast-grep --pattern 'const UQIEditorForm = $$$'

# Search for the Box component's styling and any related layout components
rg -A 5 'styled\(Box\)|Box as' app/client/src/PluginActionEditor

Length of output: 145900


Script:

#!/bin/bash
# Search for the parent component's layout and any scroll-related styles
rg -A 5 'UQIEditorForm|FormRender' app/client/src/PluginActionEditor

# Search for any height/overflow related styles in the parent components
rg -A 3 'height:|max-height:|min-height:|overflow' app/client/src/PluginActionEditor

Length of output: 38950

app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Zone/styles.module.css (2)

Line range hint 19-69: Track temporary overrides with a ticket

The temporary overrides section contains multiple !important flags and hardcoded values. While these overrides serve a purpose, they should be properly tracked and eventually removed.

Let's verify if there's already a ticket tracking these overrides:

If no ticket exists, would you like me to help create one to track the removal of these temporary overrides?


71-74: Document timeline for DB config updates

The comment indicates this style is temporary pending DB config updates for Twilio and Airtable integrations. To prevent this from becoming permanent technical debt, we should:

  1. Document when these DB config updates are planned
  2. Consider adding a TODO with a ticket reference

Let's check if there are related DB config update tasks:

app/client/src/components/editorComponents/form/fields/StyledFormComponents.tsx (1)

183-185: Verify the global style override

The added className creates a dependency on a global style rule. Let's ensure this doesn't cause unintended side effects.

✅ Verification successful

The className addition is safe and intentionally scoped

The ar-form-info-text class is specifically used in the Zone component's CSS module to reset max-width constraints. The CSS is properly scoped and documented as a temporary fix until database configurations are updated. No conflicting styles or unintended side effects were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other usages of ar-form-info-text class
rg "ar-form-info-text" --type css

# Search for other form info text styling that might conflict
ast-grep --pattern 'styled.$_`
  max-width: unset;
`'

Length of output: 230


Script:

#!/bin/bash
# Let's check the content of the CSS file to understand the styling
cat "app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Zone/styles.module.css"

# Check for any other form info text related styling
rg "form-info" --type css

Length of output: 2131

Comment on lines +35 to +37
max-width: 270px;
overflow: hidden;
break-word: break-all;
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve text handling properties for better readability

The current text handling approach could be improved:

-  max-width: 270px;
-  overflow: hidden;
-  break-word: break-all;
+  max-width: min(270px, 100%);
+  overflow: hidden;
+  text-overflow: ellipsis;
+  overflow-wrap: break-word;

This change:

  • Makes max-width responsive
  • Adds ellipsis for truncated text
  • Uses overflow-wrap for better word breaking
📝 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
max-width: 270px;
overflow: hidden;
break-word: break-all;
max-width: min(270px, 100%);
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;

@albinAppsmith
Copy link
Collaborator Author

/build-deploy-preview skip-test=true

Copy link

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

Copy link

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

1 similar comment
Copy link

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

@albinAppsmith albinAppsmith added the ok-to-test Required label for CI label Dec 4, 2024
@github-actions github-actions bot added IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo labels Dec 5, 2024
@albinAppsmith albinAppsmith merged commit 4de9c51 into release Dec 5, 2024
53 checks passed
@albinAppsmith albinAppsmith deleted the action-redesign/form-center-align branch December 5, 2024 05:44
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Dec 9, 2024
## Description

This PR will align the action forms to the center. 

Fixes appsmithorg#37951


## Automation

/ok-to-test tags="@tag.Sanity, @tag.Datasource"

### 🔍 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/12156033628>
> Commit: 707ec4f
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12156033628&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity, @tag.Datasource`
> Spec:
> <hr>Wed, 04 Dec 2024 14:21:33 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced styling for the form components, improving layout flexibility
and responsiveness.
- Introduced a new class for form information text to allow for specific
styling.
  
- **Bug Fixes**
- Adjusted styles to ensure proper display of text and layout in various
form components.
<!-- 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
Enhancement New feature or request IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product ok-to-test Required label for CI Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] - Center align action forms
2 participants