Add standard interaction and lifecycle states to Alert component#91
Add standard interaction and lifecycle states to Alert component#91bradpotts wants to merge 1 commit into
Conversation
…rt component Co-authored-by: bradpotts <4887598+bradpotts@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
WalkthroughThe PR extends the Alert component with interactive state support by adding optional state flags ( ChangesAlert interactive state support
Possibly Related PRs
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/recipes/alert.ts (1)
21-31:⚠️ Potential issue | 🟠 MajorFix release contract/validation for expanded
AlertRecipeOptionssurface
package.jsonhas noci:verify; release validation is handled bynpm run validate:exports,npm run validate:css-contract, andnpm test.ui-contract.manifest.json’sgetAlertClassescontract lists states["default","error","success","disabled","loading"]but no entries forinteractive/hovered/focused/active.- Search results show no
sp-alert--interactive/--hover/--focus/--activereferences in docs/tests/snapshots, so update the alert contract manifest and add/extend alert recipe test/snapshot coverage for these new options.🤖 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 `@src/recipes/alert.ts` around lines 21 - 31, Update the alert contract and tests to cover the expanded AlertRecipeOptions: add the new states "interactive","hovered","focused","active" to the getAlertClasses entry in ui-contract.manifest.json so the manifest expects corresponding CSS classes (e.g. sp-alert--interactive, sp-alert--hover, sp-alert--focus, sp-alert--active), then extend or add unit/snapshot tests around the Alert recipe (referencing AlertRecipeOptions and the recipe function that produces classes) to assert those class outputs and update snapshots; run the repository validation commands (npm run validate:css-contract and npm test) to ensure the manifest and tests are consistent with the new surface.
🤖 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.
Outside diff comments:
In `@src/recipes/alert.ts`:
- Around line 21-31: Update the alert contract and tests to cover the expanded
AlertRecipeOptions: add the new states
"interactive","hovered","focused","active" to the getAlertClasses entry in
ui-contract.manifest.json so the manifest expects corresponding CSS classes
(e.g. sp-alert--interactive, sp-alert--hover, sp-alert--focus,
sp-alert--active), then extend or add unit/snapshot tests around the Alert
recipe (referencing AlertRecipeOptions and the recipe function that produces
classes) to assert those class outputs and update snapshots; run the repository
validation commands (npm run validate:css-contract and npm test) to ensure the
manifest and tests are consistent with the new surface.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7907f6c7-2d46-4e26-b2df-cd71f9db2951
📒 Files selected for processing (2)
src/recipes/alert.tssrc/styles/components.css
This improvement bridges a gap in the Alert component by adding support for interactive states (hover, focus, active) and lifecycle states (disabled, loading) in both the recipe and CSS. It includes accessibility-oriented attribute selectors and standard focus ring implementation.
PR created automatically by Jules for task 10090975090971191105 started by @bradpotts
Summary by CodeRabbit