fix(frontend): New Session Context: Keyup/KeyDown event listeners, fix repo "badge X" does not work#1072
Conversation
The Badge component's `[&>svg]:pointer-events-none` CSS rule blocks click events on direct child SVGs, preventing the X icon's onClick from firing. Wrap the X icon in a <button> element so the click target is an HTML element unaffected by the SVG pointer-events rule. Also adds a unit test covering the add-then-remove badge flow. Made-with: Cursor
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 42 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds tests for repository-add UI and input history behavior, replaces an inline icon click handler with an accessible Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
…t modal tests Refactor InputWithHistory to use Radix Popover for proper layering, add ArrowDown/ArrowUp to reopen the dropdown after Escape, and wire up ARIA attributes. Also adds unit tests for AddContextModal. Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@components/frontend/src/app/projects/`[name]/sessions/[sessionName]/components/__tests__/new-session-view.test.tsx:
- Around line 43-49: The mock for AddContextModal uses an incorrect
onAddRepository signature; update the mock component (AddContextModal) so its
prop type for onAddRepository matches the real component: (url: string, branch:
string, autoPush?: boolean) => Promise<void>, and ensure the mock's onClick
calls onAddRepository with appropriate arguments (e.g., url and branch) and
returns a resolved Promise (Promise.resolve()) so tests reflect the real async
contract.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: cc5fdeac-becc-4cf0-a5c3-d481c143bf7a
📒 Files selected for processing (2)
components/frontend/src/app/projects/[name]/sessions/[sessionName]/components/__tests__/new-session-view.test.tsxcomponents/frontend/src/app/projects/[name]/sessions/[sessionName]/components/new-session-view.tsx
...rc/app/projects/[name]/sessions/[sessionName]/components/__tests__/new-session-view.test.tsx
Show resolved
Hide resolved
Address CodeRabbit review: update onAddRepository type to match the real (url, branch, autoPush?) => Promise<void> signature. Made-with: Cursor
|
dogfooding/agentic session here for 3:15PM Future Bob: https://ambient-code.apps.rosa.vteam-uat.0ksl.p3.openshiftapps.com/projects/agentic-crons/scheduled-sessions/schedule-109e0d34-5f6f-4a2f-9f2f-81af052dd314 |
Summary
Fixes RHOAIENG-55732 — UX Bug: Adding context to new conversations does not allow keyup/keydown, and has a problem with deleting added contexts
1. Repo badge X (remove) button does not work
/projects/[name]/new) was non-functional — clicks were silently swallowed[&>svg]:pointer-events-noneto all direct child SVGs, which blocked the<X>icon'sonClickhandler from ever firing<X>SVG in a<button>element so the click target is an HTML element unaffected by the pointer-events rule. Addede.stopPropagation()to prevent tooltip interference andaria-labelfor accessibility2. Input history dropdown cannot be reopened with arrow keys
handleKeyDownhandler only processed arrow keys when the dropdown was already openAcceptance Criteria
Test plan
NewSessionViewtests passInputWithHistorytests pass/projects/<name>/new, add a repo via the + menu, confirm the X button on the badge removes itMade with Cursor