Skip to content

Conversation

@RylanBot
Copy link
Collaborator

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

截图来源:demo -> swiper/card

「原先」

「修复后」

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

  • fix(Slider): 修复初始化时精度计算错误的问题

@tdesign-vue-next/chat

@tdesign-vue-next/auto-import-resolver

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

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

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

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Nov 25, 2025

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 25, 2025

tdesign-vue-next-demo

npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/auto-import-resolver@6183
npm i https://pkg.pr.new/Tencent/tdesign-vue-next@6183
npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@6183

commit: 5699b6e

@RylanBot RylanBot force-pushed the fix/slider/precision branch 2 times, most recently from dd6d296 to 0bf0d73 Compare November 25, 2025 10:17
@RylanBot RylanBot force-pushed the fix/slider/precision branch from 0bf0d73 to 28e12ee Compare November 25, 2025 11:21
@Wesley-0808 Wesley-0808 requested a review from Copilot November 26, 2025 08:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a precision calculation issue in the Slider component during initialization. The main change involves moving utility functions to a common package and applying precision formatting when initializing slider values.

Key Changes:

  • Extracted slider utility functions (formatPrecision, formatSliderValue, getStopStyle, formatLabel) from local utils to @tdesign/common-js/slider/utils
  • Applied formatPrecision to initial value calculations in both range and single-value slider modes
  • Updated imports across slider-related files to use the centralized utilities

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/components/slider/utils/index.ts Removed local utility functions (moved to common package)
packages/components/slider/slider.tsx Applied precision formatting to initial values and updated imports
packages/components/slider/slider-button.tsx Replaced manual precision formatting with formatPrecision utility
packages/components/slider/hooks/useSliderTooltip.tsx Updated imports to use common utilities
packages/components/slider/hooks/useSliderMark.tsx Updated imports to use common utilities
packages/components/slider/tests/base.test.tsx Updated test imports to reference common utilities
packages/components/divider/tests/snapshots/divider.test.tsx.snap Unrelated snapshot removal
packages/common Subproject commit update to include new shared utilities

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

@RylanBot RylanBot closed this Nov 26, 2025
@RylanBot RylanBot reopened this Nov 26, 2025
@liweijie0812
Copy link
Collaborator

/update-common

@uyarn uyarn merged commit 3fff516 into develop Nov 27, 2025
1 check passed
@uyarn uyarn deleted the fix/slider/precision branch November 27, 2025 09:03
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.

5 participants