Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(alert): optimize collapse behavior #3281

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

miownag
Copy link
Contributor

@miownag miownag commented Dec 15, 2024

When message's length is less than maxLine prop, it will not show the collapse button.

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

暂无

💡 需求背景和解决方案

  1. 当maxLine数量 >= 传入的message数量时,依然会展示【展开更多/收起】按钮,但点击无效果,如图,仅仅是按钮文字变化
    image
    image
    优化:当maxLine数量 < 传入的message数量时,即具备折叠条件时,才显示折叠按钮“
    image
    (注:图中示例的 maxLine 改为了 5)
  2. 代码中的 collpased 布尔值用反了,collpased应该是【已折叠】的状态,根据组件的行为,初始应该为true
  3. 增加了代码中的 maxLine 变量的健壮性处理
  4. 补充了对应的单元测试,修正了单元测试代码中 message 误写为 massage 的错误

📝 更新日志

  • feat(Alert): 在 maxLine >= message 数组长度时,不再展示【展开更多/收起】按钮

  • 本条 PR 不需要纳入 Changelog

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Copy link
Contributor

github-actions bot commented Dec 15, 2024

完成

When message's length is less than maxLine prop, it will not show the
collapse button.

Optimize message not collapse test
@miownag miownag force-pushed the feat/alert/collapse-opt branch from 8e710d1 to 3eb3029 Compare December 16, 2024 02:45
@uyarn uyarn merged commit cd90b04 into Tencent:develop Dec 17, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Dec 19, 2024
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants