-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
fix(@vben/common-ui): text omission component expansion exception #4139
Conversation
|
WalkthroughThe recent changes streamline the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/effects/common-ui/src/components/ellipsis-text/tests/ellipsis-text.test.ts (1 hunks)
- packages/effects/common-ui/src/components/ellipsis-text/ellipsis-text.vue (5 hunks)
Additional comments not posted (7)
packages/effects/common-ui/src/components/ellipsis-text/__tests__/ellipsis-text.test.ts (1)
35-44
: Enhanced test coverage forexpandChange
event.The test now correctly verifies that the
expandChange
event is emitted with the expected values (true
on first click andfalse
on second click). This improvement ensures that the component behaves as expected during user interactions.packages/effects/common-ui/src/components/ellipsis-text/ellipsis-text.vue (6)
2-2
: Simplified imports and improved readability.The imports are well-organized, and the use of
ref
andcomputed
from Vue enhances the component's reactivity and readability.
76-78
: Introduction ofisExpand
state for managing text expansion.The
isExpand
state is now used to manage the text expansion logic, simplifying the component's control flow. This change improves the readability and maintainability of the code.
89-90
: StreamlinedonExpand
function.The
onExpand
function now directly toggles theisExpand
state and emits theexpandChange
event. This simplification eliminates unnecessary complexity in the component's logic.
94-94
: Improved conditional logic inhandleExpand
.The
handleExpand
function now uses short-circuit evaluation to callonExpand
only whenprops.expand
is true. This enhances the readability and efficiency of the code.
106-106
: Updated tooltip logic for better user experience.The tooltip is now disabled when there is no tooltip text or when the text is expanded, aligning the tooltip behavior with user expectations and reducing unnecessary tooltip displays.
121-124
: Dynamic styling for ellipsis element.The ellipsis element's style is now dynamically adjusted based on the
isExpand
state, improving the component's responsiveness and visual consistency.
Description
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
Bug Fixes
expandChange
event during user interactions.Refactor