Skip to content

feat(pie-textarea): DSW-3891 Add rows prop#2962

Open
KatarinaNeskovic wants to merge 6 commits into
mainfrom
dsw-3891-textarea-rows-prop
Open

feat(pie-textarea): DSW-3891 Add rows prop#2962
KatarinaNeskovic wants to merge 6 commits into
mainfrom
dsw-3891-textarea-rows-prop

Conversation

@KatarinaNeskovic

@KatarinaNeskovic KatarinaNeskovic commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Adds a rows prop to pie-textarea to set the number of rows (defaults to 2 in auto mode). Prop was tested locally in Aperture across all 4 apps. Existing draft Aperture PR wasn't updated with the prop change to avoid pushing changes for each prop test.

Logic changes in updated():

  • Added rows to the auto-mode condition so changing rows also applies the correct height.
  • Added a manual-mode condition that resets the inline height (set by auto-resize), so switching automanual doesn't keep a stale height.

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have added thorough tests where applicable (unit / component / visual).
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /test-aperture command.

Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Reviewer 2

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

@KatarinaNeskovic KatarinaNeskovic requested a review from a team as a code owner June 23, 2026 15:42
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f5f81d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@justeattakeaway/pie-textarea Minor
@justeattakeaway/pie-webc Patch
@justeattakeaway/pie-docs Patch
@justeattakeaway/pie-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@KatarinaNeskovic KatarinaNeskovic changed the title DSW-3891: Textarea Rows Prop feat(pie-textarea): DSW-3891 Add rows prop Jun 23, 2026
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2962 June 23, 2026 15:47 Inactive
@KatarinaNeskovic

Copy link
Copy Markdown
Contributor Author

/test-aperture

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app pie-design-system-app Bot requested a deployment to storybook-testing-pr-2962 June 23, 2026 15:59 Pending
@KatarinaNeskovic KatarinaNeskovic force-pushed the dsw-3891-textarea-rows-prop branch from afb58e6 to 0da0c6e Compare June 23, 2026 16:00
@KatarinaNeskovic KatarinaNeskovic changed the title feat(pie-textarea): DSW-3891 Add rows prop feat(pie-textarea) : DSW-3891 Add rows prop Jun 23, 2026
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2962 June 23, 2026 16:05 Inactive
@pie-design-system-app

Copy link
Copy Markdown
Contributor

@KatarinaNeskovic Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20260623160452 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20260623160452 --mode=update-lockfile

Then finally:

yarn install

@pie-design-system-app

pie-design-system-app Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🚀 Aperture PR updated: justeattakeaway/pie-aperture#507

App deployments will appear under the Deployments section of this PR shortly!

Updated 26 Jun 2026, 15:31 UTC · PIE @ fdecde3 · workflow run

@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2962 June 26, 2026 08:50 Inactive
@KatarinaNeskovic

Copy link
Copy Markdown
Contributor Author

/test-aperture

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

@KatarinaNeskovic Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-textarea@0.0.0-snapshot-release-20260626152859 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20260626152859 --mode=update-lockfile

Then finally:

yarn install

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a rows prop to pie-textarea so consumers can control the initial visible height (via the native <textarea rows> attribute), and updates supporting styles/docs/stories/tests within the PIE design system monorepo.

Changes:

  • Added rows to TextareaProps and wired it through to the internal <textarea> rendering.
  • Updated resize/height handling (including manual-mode CSS variable changes) and Storybook controls/docs to expose rows.
  • Added Playwright component tests for the rows attribute and a changeset for a minor release.

Reviewed changes

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

Show a summary per file
File Description
packages/components/pie-textarea/src/index.ts Adds rows reactive prop, passes it to <textarea>, and adjusts updated() resize logic.
packages/components/pie-textarea/src/defs.ts Extends public props/types to include rows and updates inline docs.
packages/components/pie-textarea/src/textarea.scss Adjusts manual resize mode height variable (--textarea-height) to support rows-driven sizing.
packages/components/pie-textarea/test/component/pie-textarea.spec.ts Adds component tests asserting the rows attribute is set.
packages/components/pie-textarea/README.md Documents the new rows prop in the public README property table.
apps/pie-storybook/stories/pie-textarea.stories.ts Exposes rows in Storybook controls and template wiring.
apps/pie-storybook/stories/testing/pie-textarea.test.stories.ts Adds rows control to testing stories and wires it into the template.
.changeset/blue-moments-matter.md Declares a minor release for @justeattakeaway/pie-textarea due to the new prop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +119 to +121
if (this.resize === 'manual' && ((changedProperties.has('rows') || changedProperties.has('size')))) {
this._textarea.style.height = '';
}
Comment on lines +85 to +87
* The number of visible rows in the textarea. Defaults to 2 when resize is auto, with a maximum of 6 rows.
* Can be set to 1 when resize is manual, which has no maximum height on pointer devices but is capped at 6 rows on touch devices.
*/
| `readonly` | `true`, `false` | When true, the user cannot edit the textarea. Not the same as disabled. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly). | `false` |
| `required` | `true`, `false` | If true, textarea must have a value for valid form submission. Does not block form submission by itself. | `false` |
| `resize` | `"auto"`, `"manual"` | Controls resizing behavior. `auto` resizes vertically as needed; `manual` allows user resizing but no auto resizing. | `"auto"` |
| `rows` | `number` | The number of visible text rows. Defaults to 2 when `resize` is `auto`, with a maximum of 6 rows. Can be set to 1 when `resize` is `manual`, which has no maximum height on pointer devices but is capped at 6 rows on touch devices. | `undefined` |
Comment on lines +125 to +131
rows: {
description: 'The number of visible rows in the textarea. Defaults to 2 when `resize` is `auto`, with a maximum of 6 rows. Can be set to 1 when `resize` is `manual`, which has no maximum height on pointer devices but is capped at 6 rows on touch devices.',
control: 'number',
defaultValue: {
summary: '2',
},
},
Comment on lines +115 to +119
if (this.resize === 'auto' && ((changedProperties.has('resize') || changedProperties.has('size')) || changedProperties.has('rows'))) {
this.handleResize();
}

if (this.resize === 'manual' && ((changedProperties.has('rows') || changedProperties.has('size')))) {
@pie-design-system-app

Copy link
Copy Markdown
Contributor



Fails
🚫 You have unchecked checklist items outside the "Not-applicable Checklist items" section.

Please ensure all unchecked checkboxes are moved to the appropriate section.

🚫 You have unchecked checklist items in Reviewer 1's section.

Please ensure all items are addressed before approval.

🚫 You have unchecked checklist items in Reviewer 2's section.

Please ensure all items are addressed before approval.

Generated by 🚫 dangerJS against 4f5f81d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants