Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Review of the diff
Overall the change is reasonable: making the nickname the only shrinkable item and giving it
truncate+ atitletooltip is the standard way to stop a long nickname from pushing “创建于 / date” out of the container. A few things to tighten:Potential issues
titledoesn’t work on touch devices. On mobile/tablet the truncated nickname becomes unreadable with no way to reveal it. Consider a tap-to-expand, a proper tooltip component, or allowing the name to wrap (e.g.line-clamp-2) under asm:breakpoint.titleis always present, so short names also get a redundant tooltip. Minor UX noise; only fixable with JS overflow detection, so may be acceptable.min-w-0fixes the flex-itemmin-width:autoproblem on this<span>, but if the wrappingdiv.text-sm.text-N600(or its parent) is itself a flex/grid item, it also needsmin-w-0(oroverflow-hidden), otherwise the row will still overflow instead of ellipsizing. Worth verifying in the surrounding template.shrink-0on the date can cause overflow in very narrow containers. With both “创建于” and the date locked to their intrinsic width, a very narrow card can overflow horizontally; considerflex-wrapon the row or hiding the date at the smallest breakpoint.v-ifisslots.subtitle || create_time || nick_name, so if onlynick_nameexists you still render a dangling “创建于” with an empty/invalid date (dateFormat(undefined)). GuarddateFormatagainst falsy/invalid input, or conditionally render the “创建于 + date” pair.<span title>is not focusable, so keyboard and screen-reader users may not get the full value. If the full name matters, consider anaria-labelor a focusable disclosure.@@ -94,9 +94,9 @@is consistent (3 context + 3 removed + 3 added on each side), so no diff-format problem.Optimization suggestions
const formattedTime = computed(() => dateFormat(props.create_time))) rather than callingdateFormaton every render; also makes guarding invalid dates easier.props.prefix in the template if the component uses<script setup>—nick_nameandcreate_timeare directly accessible; it’s only cosmetic, but more idiomatic."创建于"is hard-coded. Since the file is being touched anyway, consider moving it to i18n if the project supports it.truncateimpliesoverflow-hidden, which can clip focus rings/descenders on the span; if you later add interactivity there, useoverflow-hiddenon a wrapper instead.flex-1 min-w-0 truncateif you want the nickname to consume the remaining space predictably;min-w-0 truncatealone already works, butflex-1makes the layout intent explicit.:title="props.nick_name?.trim()"avoids odd tooltips.Net
No functional bug introduced; the change is an improvement. The main real-world risks are (3) missing
min-w-0higher up the tree and (1) the tooltip being invisible on touch devices.