x icon indicating copy to clipboard operation
x copied to clipboard

feat(Sender): implement maxLength and showCount support

Open pingtougea opened this issue 2 months ago • 5 comments

Related Issue

close #1151

Changes

  • Implemented maxLength input limitation using Ant Design's native TextArea capability
  • Added showCount character counter with design token styling
  • Verified functionality manually in dev server

Environment Note

Local tests failed on Windows due to jsdom compatibility issue (nodejs/node#49173).
✅ Functionality verified manually
✅ CI will validate tests (Linux/Node 18)

Screenshots

屏幕截图 2025-11-11 151413 屏幕截图 2025-11-11 151428 ## Notes for Reviewers As a first-time contributor, I welcome guidance on: - Test case completeness - Design token usage - API consistency

Summary by CodeRabbit

发布说明

  • 新功能

    • Sender 组件新增 maxLength 最大长度与 showCount 字符计数显示,输入长度实时更新。
  • 示例

    • 在演示页面新增带 maxLength 与 showCount 的 Sender 示例。
  • 测试

    • 新增围绕最大长度与计数显示的单元测试用例。
  • 样式

    • 为计数显示添加对应样式调整。

您好,各位维护者~

我在提交这个 PR 时遇到了一些问题,尝试了一些方法但未能解决,想请大家帮忙指导一下: 测试失败问题: 所有测试用例都报 TypeError: Cannot read properties of undefined (reading 'get'),错误堆栈指向 jsdom 及其依赖(whatwg-urlwebidl-conversions)。 我已尝试过: 切换 Node.js 版本到 18.x(之前可能使用了其他版本),并重新安装了依赖,但 jsdom 相关的 TypeError: Cannot read properties of undefined (reading 'get') 错误仍然存在。 查了一些资料,这个错误可能和 jsdom 与 Node.js 18+ 的内置 URL 模块冲突有关,或者是项目中某些依赖(如 whatwg-url)的版本与 jsdom 不兼容,但我不太确定具体如何调整。

pingtougea avatar Nov 11 '25 14:11 pingtougea