Skip to content

fix(components): [transfer] prevent title width overflow#23166

Merged
rzzf merged 13 commits into
element-plus:devfrom
E66Crisp:fix/transfer
Feb 22, 2026
Merged

fix(components): [transfer] prevent title width overflow#23166
rzzf merged 13 commits into
element-plus:devfrom
E66Crisp:fix/transfer

Conversation

@E66Crisp
Copy link
Copy Markdown
Contributor

@E66Crisp E66Crisp commented Dec 19, 2025

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

As you can see, when the title content is too long, it covers the elements on the right, and when the footer content is too long, it also fails to stay centered.

demo

Expected behavior:
demo2

Summary by CodeRabbit

  • Style
    • Improved Transfer header and footer layout, spacing, and text truncation for better alignment and visual consistency.
  • Tests
    • Updated Transfer test to more reliably target the header count, improving test stability.
  • Chores
    • Adjusted header markup to wrap title and count into semantic elements for clearer structure and easier maintenance.

@pull-request-triage
Copy link
Copy Markdown

👋 @E66Crisp, seems like this is your first time contribution to element-plus.
Please make sure that you have read our guidelines and code of conduct before making a contribution.

@pull-request-triage pull-request-triage Bot added 1st contribution Their very first contribution Needs Review labels Dec 19, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 19, 2025

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Dec 20, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus/element-plus@23166
npm i https://pkg.pr.new/element-plus/element-plus@23166
yarn add https://pkg.pr.new/element-plus/[email protected]

commit: 45566fd

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

🧪 Playground Preview: https://element-plus.run/?pr=23166
Please comment the example via this playground if needed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 29, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Header title and checked-summary in the transfer panel were wrapped in dedicated spans with class names; related SCSS was adjusted to a flex layout and new classes added; a unit test selector was updated to target .el-transfer-panel__header-count.

Changes

Cohort / File(s) Summary
Template
packages/components/transfer/src/transfer-panel.vue
Header label markup split into two spans with classes (header-title, header-count) replacing previous text nodes inside the checkbox.
Styles
packages/theme-chalk/src/transfer.scss
Header label changed to flex layout; added .el-transfer-panel__header-title (ellipsis) and .el-transfer-panel__header-count (spacing, font) rules; footer made flex and checkbox padding adjusted.
Tests
packages/components/transfer/__tests__/transfer.test.tsx
Test selector updated to target .el-transfer-panel__header-count when asserting header count text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • btea
  • rzzf

Poem

🐰 I hopped through spans to tidy the view,
A title tucked left, a bright count on cue,
Flexbox paws lengthen, margins in tow,
Tests now seek the little count they know,
A soft, happy hop — the panel's anew.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description includes all required checklist items checked off, provides a clear problem statement with visual evidence, and explains the expected behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title 'fix(components): [transfer] prevent title width overflow' directly addresses the main issue of preventing header title overflow, which aligns with the primary change of wrapping the title in a span with text-ellipsis styling.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread packages/components/transfer/src/transfer-panel.vue Outdated
@E66Crisp E66Crisp requested a review from rzzf January 16, 2026 00:43
Comment thread packages/theme-chalk/src/transfer.scss
Comment thread packages/components/transfer/src/transfer-panel.vue Outdated
@E66Crisp E66Crisp requested a review from rzzf January 17, 2026 12:23
Comment thread packages/theme-chalk/src/transfer.scss Outdated
Copy link
Copy Markdown
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/theme-chalk/src/transfer.scss`:
- Around line 159-163: The rule violation is caused by the blockless `@include`
utils-ellipsis; immediately followed by a declaration, so update the
.#{$namespace}-transfer-panel__header-title rule to add a blank line after the
`@include` utils-ellipsis; and before the subsequent declaration (flex: 1) so the
declaration-empty-line-before lint rule is satisfied; locate the selector
.#{$namespace}-transfer-panel__header-title and insert one empty line between
the `@include` utils-ellipsis; line and the flex: 1 declaration.
- Around line 173-189: The footer styles for
.#{$namespace}-transfer-panel__footer currently remove left spacing and set an
unnecessary flex-direction; restore left offset by adding the same left padding
used in the header (e.g., padding-left: 15px or the equivalent CSS var) and
remove flex-direction: column to simplify the layout, and ensure the nested
.#{$namespace}-checkbox inherits/keeps its color rule — update the
.#{$namespace}-transfer-panel__footer block accordingly.

Comment thread packages/theme-chalk/src/transfer.scss
Comment thread packages/theme-chalk/src/transfer.scss
@E66Crisp E66Crisp requested a review from rzzf February 22, 2026 09:00
Comment thread packages/theme-chalk/src/transfer.scss
Comment thread packages/theme-chalk/src/transfer.scss Outdated
Comment thread packages/theme-chalk/src/transfer.scss
Comment thread packages/theme-chalk/src/transfer.scss Outdated
Comment thread packages/theme-chalk/src/transfer.scss
@rzzf rzzf changed the title fix(components): [transfer] fix header and footer layout issues fix(components): [transfer] prevent title width overflow Feb 22, 2026
@rzzf rzzf merged commit e5ec61d into element-plus:dev Feb 22, 2026
17 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@E66Crisp Thanks for your contribution! ❤️

@element-bot element-bot mentioned this pull request Feb 28, 2026
3 tasks
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.

3 participants