Skip to content

Conversation

@yangyanAurora
Copy link

@yangyanAurora yangyanAurora commented Dec 25, 2025

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

发版说明

  • 样式优化
    • 改进表单项标签的显示效果,长标签文本现可自动换行,避免被截断或溢出,提高了表单在各种场景下的可读性和用户体验。

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added action:review This PR needs more reviews (less than 2 approvals) 3.x Target branch 3.x labels Dec 25, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 25, 2025

Walkthrough

表单项标签样式调整,将两个选择器的 white-space: nowrap 属性改为 word-wrap: break-word,以支持长标签文本换行。

Changes

Cohort / File(s) 变更摘要
表单项样式调整
src/packages/formitem/formitem.scss
替换 .nut-form-item-label-right.nut-form-item-label-left 的换行处理规则,从禁止换行改为允许词断换行

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 分钟

Possibly related issues

Possibly related PRs

Suggested reviewers

  • xiaoyatong
  • irisSong

Poem

🐰 ✨ 长长的标签曾然僵硬,
禁锢在一行不肯弯折,
今日一声 break-word 咒语,
它们欢喜地舒展开来,
换行而舞,不再重叠~

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR描述使用了完整的模板结构,但所有核心部分(变动性质、相关Issue、需求背景、自查清单)均未填写或勾选。 请勾选变动性质(建议选择'组件样式/交互改进'),补充相关Issue链接,说明具体问题和解决方案,并勾选自查清单中的所有项目。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed 标题清晰地概括了主要变动:为表单项标签添加自动换行功能,与代码变更相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 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.

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.15%. Comparing base (2060383) to head (68aa085).

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3409   +/-   ##
==========================================
  Coverage      88.15%   88.15%           
==========================================
  Files            291      291           
  Lines          19212    19212           
  Branches        2988     2988           
==========================================
  Hits           16937    16937           
  Misses          2269     2269           
  Partials           6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@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: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2060383 and 68aa085.

📒 Files selected for processing (1)
  • src/packages/formitem/formitem.scss
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (1)
src/packages/formitem/formitem.scss (1)

142-142: 标签顶部位置应添加 word-wrap: break-word

为左右对齐标签添加 word-wrap: break-word 是正确的,但存在布局位置间的不一致性。.nut-form-item-label-top(顶部标签)缺少此属性,而 .nut-form-item-label-left.nut-form-item-label-right 都已添加。建议在 .nut-form-item-label-top 中也添加 word-wrap: break-word 以保持所有标签位置的换行行为一致。

justify-content: flex-end;
padding-right: 24px;
white-space: nowrap;
word-wrap: break-word;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if file exists and get basic info
if [ -f "src/packages/formitem/formitem.scss" ]; then
  echo "File found"
  wc -l "src/packages/formitem/formitem.scss"
else
  echo "File not found, searching for similar files"
  fd "formitem.*scss" -t f
fi

Repository: jdf2e/nutui-react

Length of output: 111


🏁 Script executed:

# Read the relevant sections of the file to verify the changes
# Reading around lines 136 and 142 (the changed lines)
sed -n '10,25p' src/packages/formitem/formitem.scss | cat -n
echo "---"
sed -n '130,155p' src/packages/formitem/formitem.scss | cat -n

Repository: jdf2e/nutui-react

Length of output: 1244


🏁 Script executed:

# Search for all occurrences of word-wrap, white-space, and overflow-wrap in the file
echo "=== word-wrap occurrences ==="
rg -n "word-wrap" src/packages/formitem/formitem.scss
echo "=== white-space occurrences ==="
rg -n "white-space" src/packages/formitem/formitem.scss
echo "=== overflow-wrap occurrences ==="
rg -n "overflow-wrap" src/packages/formitem/formitem.scss

Repository: jdf2e/nutui-react

Length of output: 271


🏁 Script executed:

# Get the git diff for this file
git diff HEAD -- src/packages/formitem/formitem.scss | head -100

Repository: jdf2e/nutui-react

Length of output: 43


🏁 Script executed:

# If that doesn't show recent changes, check git log
git log --oneline -n 20 -- src/packages/formitem/formitem.scss

Repository: jdf2e/nutui-react

Length of output: 87


🏁 Script executed:

# Show the actual commit with changes
git show 68aa0853 -- src/packages/formitem/formitem.scss

Repository: jdf2e/nutui-react

Length of output: 4240


移除 136 行和 142 行的冗余 word-wrap 声明

这是一个新文件创建。第 18 行的父选择器 .nut-form-item-label 已经设置了 word-wrap: break-word,子选择器 .nut-form-item-label-right(第 136 行)和 .nut-form-item-label-left(第 142 行)无需重复声明该属性——它们会自动继承父样式。

建议删除第 136 行和 142 行的 word-wrap: break-word;,保持样式表的整洁。同时可考虑使用更现代的 CSS 属性 overflow-wrap: break-word 替代第 18 行的 word-wrap(两者功能相同,但 overflow-wrap 是标准属性)。

第 148 行的 .nut-form-item-top 中的 white-space: nowrap 是独立的样式设置,用于列布局的特定场景,与换行功能无直接关系。

🤖 Prompt for AI Agents
In src/packages/formitem/formitem.scss around lines 136 and 142, remove the
redundant "word-wrap: break-word;" declarations from the child selectors
.nut-form-item-label-right (line 136) and .nut-form-item-label-left (line 142);
instead rely on the parent .nut-form-item-label rule (line 18) for wrapping;
additionally, replace the parent rule's non-standard "word-wrap: break-word" at
line 18 with the standard "overflow-wrap: break-word" to modernize the
stylesheet while keeping .nut-form-item-top (line 148) untouched.

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

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant