Skip to content

feat(apollo-wind): add autoGrow in textArea [MST-12041]#926

Open
ayush578 wants to merge 1 commit into
mainfrom
feat/textArea/autoGrow
Open

feat(apollo-wind): add autoGrow in textArea [MST-12041]#926
ayush578 wants to merge 1 commit into
mainfrom
feat/textArea/autoGrow

Conversation

@ayush578

@ayush578 ayush578 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds opt-in auto-grow to the apollo-wind Textarea via new minRows / maxRows props (mirroring how ApTextArea in apollo-react exposes them, but implemented natively — apollo-wind has no MUI dependency).

Behavior

  • Backward compatible: with neither prop set, the component is byte-for-byte the same plain <textarea> as before.
  • Auto-grow: floors at minRows, grows with content up to maxRows, then scrolls.
  • Uncapped manual resize: the ceiling is enforced in JS (height), never via CSS max-height, so the bottom-right resize handle can be dragged past maxRows. A ResizeObserver detects the drag and hands sizing control to the user.
  • Row heights are derived from the element's computed line-height + padding/border, so sizing is correct across text-base/text-sm and all themes.

demo

Screen.Recording.2026-07-17.at.11.39.11.AM.mov

Note: jsdom has no layout engine, so the tests cover the structural guarantees; the pixel-level grow/scroll is best confirmed in the new Storybook AutoGrow story.

Copilot AI review requested due to automatic review settings July 17, 2026 06:12
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-design 🟢 Ready Preview, Logs Jul 17, 2026, 04:37:35 AM
apollo-docs 🟢 Ready Preview, Logs Jul 17, 2026, 04:37:35 AM
apollo-landing 🟢 Ready Preview, Logs Jul 17, 2026, 04:37:35 AM
apollo-vertex 🟢 Ready Preview, Logs Jul 17, 2026, 04:37:35 AM

@github-actions github-actions Bot added the size:L 100-499 changed lines. label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1950 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1720
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds opt-in auto-grow behavior to the packages/apollo-wind Textarea component via new minRows / maxRows props, aligning the API shape with apollo-react while keeping the implementation native (no MUI dependency).

Changes:

  • Extends Textarea with minRows / maxRows and auto-sizing logic (including a manual-resize escape hatch via ResizeObserver).
  • Adds a new Storybook AutoGrow story demonstrating minRows={3} maxRows={5}.
  • Adds unit tests covering the “plain textarea” mode and basic auto-grow structural guarantees.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/apollo-wind/src/components/ui/textarea.tsx Adds minRows/maxRows props and JS-based auto-grow sizing logic.
packages/apollo-wind/src/components/ui/textarea.test.tsx Adds test cases for auto-grow mode and “plain textarea” invariants.
packages/apollo-wind/src/components/ui/textarea.stories.tsx Adds an AutoGrow Storybook example for the new props.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.stories.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.stories.tsx
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core 9.0% 43.82 MB 57.31 MB ±0
@uipath/apollo-react 37.2% 7.38 MB 28.12 MB +2.0 KB
@uipath/apollo-wind 41.0% 81.1% (60/74) 397.5 KB 2.58 MB +2.3 KB
@uipath/ap-chat 85.8% 43.43 MB 55.91 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

Copilot AI review requested due to automatic review settings July 17, 2026 06:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.stories.tsx
Copilot AI review requested due to automatic review settings July 17, 2026 06:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.stories.tsx Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.stories.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 06:49
@ayush578
ayush578 force-pushed the feat/textArea/autoGrow branch from ca54506 to 2e540b9 Compare July 17, 2026 06:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.stories.tsx Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Copilot AI review requested due to automatic review settings July 17, 2026 09:39
@ayush578
ayush578 force-pushed the feat/textArea/autoGrow branch from 0935eeb to 2333ee1 Compare July 17, 2026 09:39
Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx Fixed
Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx Outdated
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.test.tsx
Copilot AI review requested due to automatic review settings July 17, 2026 11:30
@ayush578
ayush578 force-pushed the feat/textArea/autoGrow branch from 2333ee1 to 0facaa5 Compare July 17, 2026 11:30
@ayush578
ayush578 force-pushed the feat/textArea/autoGrow branch from 0facaa5 to 3c3d798 Compare July 17, 2026 11:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +184 to +187
onChange={(event) => {
onChange?.(event);
resize();
}}
Copilot AI review requested due to automatic review settings July 17, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Comment thread packages/apollo-wind/src/components/ui/textarea.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-wind size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants