Skip to content

Conversation

@IKEYCY
Copy link
Contributor

@IKEYCY IKEYCY commented Nov 18, 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: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features
    • Added a public description property to the timeline component, enabling customizable item descriptions across PC and mobile-first views.
    • Timeline items now display the description property when provided, falling back to existing item content otherwise.

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

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

coderabbitai bot commented Nov 18, 2025

Walkthrough

Added a new public string prop description to timeline components and updated timeline-item rendering to use the description prop when provided, falling back to node.description. Prop is documented in the demo API file and implemented in the Vue component.

Changes

Cohort / File(s) Summary
Timeline API demo
examples/sites/demos/apis/time-line.js
Added public description prop (type: string, default: '') to the timeline demo API, including Chinese and English descriptions and mfDemo metadata.
Timeline item implementation
packages/vue/src/timeline-item/src/pc.vue
Added description prop to component props. Updated render logic so the description slot outputs the description prop when defined, otherwise falls back to node.description.

Sequence Diagram(s)

sequenceDiagram
    participant Consumer as Consumer (uses timeline)
    participant TimelineItem as TimelineItem (pc.vue)
    alt description prop provided
        Consumer->>TimelineItem: pass prop description="..."
        TimelineItem->>TimelineItem: render description prop
        note right of TimelineItem `#DFF0D8`: primary path (uses prop)
    else no description prop
        Consumer->>TimelineItem: pass node with node.description
        TimelineItem->>TimelineItem: render node.description
        note right of TimelineItem `#FDF2D7`: fallback path (node.description)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify prop signature, default value, and i18n documentation in examples/sites/demos/apis/time-line.js.
  • Confirm packages/vue/src/timeline-item/src/pc.vue prop list includes description and rendering correctly prioritizes the prop over node.description.
  • Check for any missing prop typing/validation and ensure no unintended template regressions.

Poem

🐰 I nibble lines and stitch a word,
A tidy tag for each small bird,
If you give me text, I'll wear it proud,
Else I whisper what the node avowed. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a description prop to the timeline component for configuration mode display. It directly relates to the primary objective and aligns with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 8307423 and 89e87ef.

📒 Files selected for processing (1)
  • examples/sites/demos/apis/time-line.js (1 hunks)
🔇 Additional comments (1)
examples/sites/demos/apis/time-line.js (1)

248-261: I'm unable to clone the repository to verify the specific implementation details. However, based on the provided review comment and context, I can assess what verification would be needed.

Let me provide the rewritten review comment based on the information available:


Add missing description prop to timeline-item component props section and provide demo examples.

The description prop has been added to the time-line component (lines 248-261) but appears to be missing from the timeline-item component's props section (lines 339-375), despite implementation evidence suggesting it should be documented there. Additionally, both pcDemo and mfDemo fields are empty, leaving users without usage examples for this new feature.

The description text should also clarify the relationship between this prop, the existing description slot (lines 296-302), and the fallback behavior (description prop → node.description).

Required actions:

  • Verify and document the description prop in the timeline-item component props section with appropriate mode and demo references
  • Add or reference demo examples showing the prop in use (pcDemo field)
  • Clarify the description text to explain the prop's priority and interaction with existing slot and node data

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/vue/src/timeline-item/src/pc.vue (1)

174-180: Update API documentation to include description prop for timeline-item component

The description prop is actively used in the timeline-item component (pc.vue line 176 and template lines 54-58) but is not documented in the API docs. The timeline-item section in examples/sites/demos/apis/time-line.js currently only documents line-width, node, and space props.

Add a description prop entry to the timeline-item component's props array in examples/sites/demos/apis/time-line.js (after the space prop) to match the parent component's documentation style.

🧹 Nitpick comments (2)
packages/vue/src/timeline-item/src/pc.vue (1)

52-60: Description fallback logic works but consider layout consistency and simpler checks

The new fallback (description prop → node.description) is reasonable and backward compatible, but two points:

  • In the vertical layout (Lines 155–159), description rendering still uses only node.description. If description is meant to override the node text in all layouts, you may want to apply the same fallback there for consistency, or explicitly confirm it is only for the horizontal/text-position='right' mode.
  • The explicit !== undefined && !== null checks are a bit verbose; description != null (and similarly for node.description) would keep behavior while simplifying the template.
examples/sites/demos/apis/time-line.js (1)

247-257: Clarify semantics of new description prop and align with existing API

The new description prop for time-line is fine mechanically, but its role is a bit unclear compared to existing API:

  • Other similar props (name-field, time-field, tips-field, auto-color-field) are field selectors, while description here is described generically as "Timeline description". If this is also a field selector for node.description, consider naming it description-field (or adjusting the description text) to match the pattern.
  • Templates in packages/vue/src/timeline-item/src/pc.vue already read node.description, and timeline-item now exposes a description prop. It might be worth tightening the doc copy to specify whether this prop controls the node description field, a global description string, or configuration-mode metadata.

Also consider, in a follow-up, adding an optional description?: string to the ITimelineItem type to document the existing node.description usage.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41a9a9b and 8307423.

📒 Files selected for processing (2)
  • examples/sites/demos/apis/time-line.js (1 hunks)
  • packages/vue/src/timeline-item/src/pc.vue (2 hunks)

@zzcr
Copy link
Member

zzcr commented Nov 20, 2025

您好,感谢您的PR,这个PR提交是为了解决什么样的场景问题呢?能不能描述一下呢?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Hello, thank you for your PR. What kind of scenario problem is this PR submitted to solve? Can you describe it?

@IKEYCY
Copy link
Contributor Author

IKEYCY commented Nov 20, 2025 via email

desc: {
'zh-CN': '时间线描述',
'en-US': 'Timeline description'
},
Copy link
Member

Choose a reason for hiding this comment

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

加上配置项表示整个特性是3.28.0版本添加的哈:meta: {
stable: '3.28.0'
}

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