feat(Toast): allow action without dismissing toast - #2673
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a ChangesToastAction closeOnClick feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@docs/content/docs/components/toast.md`:
- Around line 142-154: The keyboard-interaction docs incorrectly state that
ToastAction always closes on Space/Enter; update the keyboard table and any
related text to qualify that closing on Space/Enter is conditional on the prop
closeOnClick being true. Locate mentions of ToastAction and the keyboard table
in this doc (references: ToastAction, closeOnClick) and change the wording to
something like "closes on Space/Enter when closeOnClick === true" or equivalent
concise phrasing so the docs consistently reflect the conditional behavior.
🪄 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
Run ID: d67d0a50-1ec0-455c-a938-42671e607cc2
📒 Files selected for processing (4)
docs/content/docs/components/toast.mddocs/content/meta/ToastAction.mdpackages/core/src/Toast/Toast.test.tspackages/core/src/Toast/ToastAction.vue
|
Thanks for the PR @yan-ad ! Two notes before merge: Add a default-path test. The new test only covers Optional — collapse the render fork. Instead of <ToastAnnounceExclude v-if="altText" :alt-text="altText" as-child>
<Primitive
:ref="forwardRef"
:as="as"
:as-child="asChild"
:type="as === 'button' ? 'button' : undefined"
@click="closeOnClick ? rootContext.onClose() : undefined"
>
<slot />
</Primitive>
</ToastAnnounceExclude>This needs |
|
Resolved both notes — added the default-path |
|
Thanks for the notes! I added the default-path test for |
🔗 Linked issue
Resolves #2626
❓ Type of change
📚 Description
Adds a
closeOnClickprop toToastActionso action buttons can run without always dismissing their toast. The default remainstrue, preserving the existing dismiss-on-click behavior.This also documents the new prop and adds a regression test covering
closeOnClick: falsekeeping the toast open after clicking the action.📸 Screenshots (if appropriate)
N/A
📝 Checklist
Summary by CodeRabbit
New Features
Changes
Documentation
Tests