Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesPresence animation event handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/core/src/Presence/Presence.test.ts (1)
150-157: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
@testing-library/vuefor the added component test.The test adds another
mountcall from@vue/test-utils. The path guideline requires@testing-library/vuefor tests in this directory. Use the required renderer and query helpers for this regression test.As per coding guidelines, tests matching
packages/core/src/**/*.test.tsmust use Vitest, jsdom,@testing-library/vue, andvitest-axe.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/Presence/Presence.test.ts` around lines 150 - 157, Update the added component test around the mount call to use `@testing-library/vue` instead of `@vue/test-utils`, including its render and query helpers. Preserve the regression scenario and ensure the test remains compatible with the existing Vitest, jsdom, and vitest-axe setup.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/core/src/Presence/Presence.test.ts`:
- Around line 149-180: Move the Presence component mount into the existing
try/finally block so any exception during mount still reaches the cleanup path.
Keep getComputedStyleSpy restoration in finally, ensuring the global spy is
always restored while preserving the current test assertions and unmount
cleanup.
---
Nitpick comments:
In `@packages/core/src/Presence/Presence.test.ts`:
- Around line 150-157: Update the added component test around the mount call to
use `@testing-library/vue` instead of `@vue/test-utils`, including its render and
query helpers. Preserve the regression scenario and ensure the test remains
compatible with the existing Vitest, jsdom, and vitest-axe setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ede024a3-8378-4ede-8283-2b54a37cb2a9
📒 Files selected for processing (2)
packages/core/src/Presence/Presence.test.tspackages/core/src/Presence/usePresence.ts
commit: |
Linked issue
Closes #2838
Type of change
Description
animationendandanimationcancelbubble from descendants. Presence wascalling
getAnimationName(node.value), and thereforegetComputedStyle,before checking whether the event originated from its own host element. The
result was discarded for descendant events because both behavior branches
already required
event.target === node.value.I moved that target check to an early return. Events from the Presence host
retain the same behavior, while descendant events no longer trigger
unnecessary style reads. This also aligns
handleAnimationEndwith theexisting target guard in
handleAnimationStart.I added a regression test with a direct-event positive control before
asserting that a bubbled descendant event does not read the Presence host
styles.
Screenshots
Not applicable.
Checklist
internal, behavior-preserving performance change with no public API changes.
Validation
pnpm --filter reka-ui exec vitest run src/Presence/Presence.test.tspnpm exec eslint packages/core/src/Presence/usePresence.ts packages/core/src/Presence/Presence.test.tspnpm --filter reka-ui type-checkpnpm --filter reka-ui buildSummary by CodeRabbit