Skip to content

Conversation

@wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Nov 3, 2025

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #3789

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Breaking Changes
    • The numeric component now strictly validates the modelValue prop, accepting only Number or String types. Undefined values are no longer permitted.

@github-actions github-actions bot added the bug Something isn't working label Nov 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

The modelValue prop in numericProps has been type-narrowed by removing undefined from its accepted type definitions. This transitions the prop from accepting Number, String, or undefined to accepting only Number or String.

Changes

Cohort / File(s) Change Summary
Numeric prop type constraint
packages/vue/src/numeric/src/index.ts
Removed undefined from modelValue prop type array, narrowing accepted types from [Number, String, undefined] to [Number, String]

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification with a straightforward type array update
  • Consider verifying that removing undefined does not break existing component usage patterns in tests or consuming code

Poem

🐰 A number or string now flows,
No undefined shadows in the prop!
The validation tightens, precision grows—
One small tweak makes the logic hop! ✨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "fix(numeric): numeric modelValue type should not include underfined" directly and accurately describes the main change in the changeset. The modification removes undefined from the modelValue prop type definition in numericProps, changing it from [Number, String, undefined] to [Number, String]. The title clearly identifies the component affected (numeric), the specific property (modelValue type), and the fix applied (removing undefined). Despite a minor typo ("underfined" instead of "undefined"), the intent is unambiguous and a teammate scanning the history would immediately understand the primary change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wyp/numeric-bug-1103

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7537e65 and dd04f0b.

📒 Files selected for processing (1)
  • packages/vue/src/numeric/src/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vue/src/numeric/src/index.ts
⏰ 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). (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)

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.

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: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7255592 and 7537e65.

📒 Files selected for processing (1)
  • examples/sites/demos/pc/app/numeric/allow-empty.spec.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: zzcr
Repo: opentiny/tiny-vue PR: 2584
File: packages/renderless/src/numeric/index.ts:124-127
Timestamp: 2024-12-02T08:56:05.176Z
Learning: 在`packages/renderless/src/numeric/index.ts`文件中,在访问`props.step.value`之前,应先判断`props.step`是否为对象,以确保容错处理。
⏰ 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). (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)

@zzcr zzcr merged commit cf3952e into dev Nov 3, 2025
9 of 10 checks passed
@zzcr zzcr deleted the wyp/numeric-bug-1103 branch November 3, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants