Skip to content

chore: use margin instead of padding in WDS textarea#39551

Merged
jsartisan merged 1 commit intoreleasefrom
chore/max-height-for-textarea
Mar 4, 2025
Merged

chore: use margin instead of padding in WDS textarea#39551
jsartisan merged 1 commit intoreleasefrom
chore/max-height-for-textarea

Conversation

@jsartisan
Copy link
Contributor

@jsartisan jsartisan commented Mar 4, 2025

/ok-to-test tags="@tag.Anvil"

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13654597103
Commit: 1a55cb7
Cypress dashboard.
Tags: @tag.Anvil
Spec:


Tue, 04 Mar 2025 13:41:18 UTC

@jsartisan jsartisan requested a review from a team as a code owner March 4, 2025 13:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Walkthrough

The pull request alters the height calculation in the TextArea component. Instead of using padding values, the component now adds the margin values (marginTop and marginBottom) to determine its height. The updated logic directly assigns the input.scrollHeight to set the input's height. No changes were made to any exported or public entities.

Changes

File Change Summary
app/client/.../TextArea.tsx Replaced padding-based height adjustments with margin-based calculation; simplified input height assignment to use input.scrollHeight directly.

Possibly related PRs

Suggested labels

skip-changelog, ok-to-test

Suggested reviewers

  • KelvinOm

Poem

In the realm of code, a change takes flight,
Margins now lead with a new kind of light.
The TextArea dances, its height reborn,
ScrollHeight steers it from dusk till morn.
A joyful tweak – cheers to code shining bright!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4eb4e7 and 1a55cb7.

📒 Files selected for processing (1)
  • app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-build / client-build
  • GitHub Check: storybook-tests
  • GitHub Check: chromatic-deployment
  • GitHub Check: chromatic-deployment
🔇 Additional comments (3)
app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx (3)

71-72: Clean addition of margin variables.

The addition of these margin-related variables aligns well with the PR objective to use margins instead of padding.


74-74: Height calculation modified to use margin values.

This correctly implements the switch from padding to margin for height calculation. The change is consistent with the PR objective and maintains the same logical structure.


76-76: Height setting simplified.

The direct assignment of scrollHeight is more straightforward than the previous implementation that likely involved padding subtraction. This simplification improves code readability while maintaining functionality.

✨ Finishing Touches
  • 📝 Generate Docstrings

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 generate docstrings to generate docstrings for this 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 skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Mar 4, 2025
@jsartisan jsartisan requested a review from KelvinOm March 4, 2025 13:15
@jsartisan jsartisan added the ok-to-test Required label for CI label Mar 4, 2025
@jsartisan jsartisan merged commit d25c6f1 into release Mar 4, 2025
56 checks passed
@jsartisan jsartisan deleted the chore/max-height-for-textarea branch March 4, 2025 15:35
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
/ok-to-test tags="@tag.Anvil"

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13654597103>
> Commit: 1a55cb7
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13654597103&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Anvil`
> Spec:
> <hr>Tue, 04 Mar 2025 13:41:18 UTC
<!-- end of auto-generated comment: Cypress test results  -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants