-
Notifications
You must be signed in to change notification settings - Fork 330
fix(timeline): add description prop for configuration mode display Fixes #3070 #3822
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
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughA new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
There was a problem hiding this 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 includedescriptionprop fortimeline-itemcomponentThe
descriptionprop 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. Thetimeline-itemsection inexamples/sites/demos/apis/time-line.jscurrently only documentsline-width,node, andspaceprops.Add a
descriptionprop entry to thetimeline-itemcomponent's props array inexamples/sites/demos/apis/time-line.js(after thespaceprop) 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 checksThe new fallback (
descriptionprop →node.description) is reasonable and backward compatible, but two points:
- In the vertical layout (Lines 155–159), description rendering still uses only
node.description. Ifdescriptionis 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 && !== nullchecks are a bit verbose;description != null(and similarly fornode.description) would keep behavior while simplifying the template.examples/sites/demos/apis/time-line.js (1)
247-257: Clarify semantics of newdescriptionprop and align with existing APIThe new
descriptionprop fortime-lineis 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, whiledescriptionhere is described generically as "Timeline description". If this is also a field selector fornode.description, consider naming itdescription-field(or adjusting the description text) to match the pattern.- Templates in
packages/vue/src/timeline-item/src/pc.vuealready readnode.description, andtimeline-itemnow exposes adescriptionprop. 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?: stringto theITimelineItemtype to document the existingnode.descriptionusage.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/sites/demos/apis/time-line.js(1 hunks)packages/vue/src/timeline-item/src/pc.vue(2 hunks)
|
您好,感谢您的PR,这个PR提交是为了解决什么样的场景问题呢?能不能描述一下呢? |
Hello, thank you for your PR. What kind of scenario problem is this PR submitted to solve? Can you describe it? |
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Release Notes
descriptionproperty to timeline component for customizable item descriptions across PC and mobile-first modes.