[release-4.19] OLS-2892: Use separate menu for the Ask/Troubleshooting mode#1867
Conversation
Made-with: Cursor
📝 WalkthroughWalkthroughThe PR updates locale strings and refactors the mode-switching UI component from using a MessageBar label within a dropdown to a dedicated Select control with menu toggle, while updating corresponding tests to use the new selector. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@kyoto: This pull request references OLS-2892 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/tests/lightspeed-install.cy.ts (1)
370-383: Consider asserting placeholder text when mode changes.This test already validates persistence well; adding placeholder assertions would directly cover the new Ask/Troubleshooting prompt copy behavior too.
✅ Suggested test augmentation
cy.get(modeToggle).should('include.text', 'Ask'); + cy.get(promptInput).should('have.attr', 'placeholder', 'Ask a question...'); cy.get(modeToggle).click(); cy.contains('[role="option"]', 'Troubleshooting').click(); cy.get(modeToggle).should('include.text', 'Troubleshooting'); + cy + .get(promptInput) + .should('have.attr', 'placeholder', "Describe the issue you're troubleshooting..."); @@ cy.get(modeToggle).click(); cy.contains('[role="option"]', 'Ask').click(); cy.get(modeToggle).should('include.text', 'Ask'); + cy.get(promptInput).should('have.attr', 'placeholder', 'Ask a question...');Also applies to: 389-389
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/tests/lightspeed-install.cy.ts` around lines 370 - 383, After each mode switch using the modeToggle (when you click and select 'Troubleshooting' or 'Ask'), assert that the chat input's placeholder text updates to the expected prompt copy for that mode; specifically, after selecting 'Troubleshooting' assert the input placeholder equals the troubleshooting prompt and after switching back to 'Ask' assert the input placeholder equals the ask prompt. Use the existing modeToggle click/selection flow and add cy.get('<chatInputSelector>').should('have.attr', 'placeholder').and('include', '<expectedPlaceholderText>') (replace <chatInputSelector> with your chat input selector and <expectedPlaceholderText> with the exact Ask/Troubleshooting copy) adjacent to the existing cy.get(modeToggle).should(...) checks so the placeholder behavior is validated alongside the visible mode label.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/tests/lightspeed-install.cy.ts`:
- Around line 370-383: After each mode switch using the modeToggle (when you
click and select 'Troubleshooting' or 'Ask'), assert that the chat input's
placeholder text updates to the expected prompt copy for that mode;
specifically, after selecting 'Troubleshooting' assert the input placeholder
equals the troubleshooting prompt and after switching back to 'Ask' assert the
input placeholder equals the ask prompt. Use the existing modeToggle
click/selection flow and add cy.get('<chatInputSelector>').should('have.attr',
'placeholder').and('include', '<expectedPlaceholderText>') (replace
<chatInputSelector> with your chat input selector and <expectedPlaceholderText>
with the exact Ask/Troubleshooting copy) adjacent to the existing
cy.get(modeToggle).should(...) checks so the placeholder behavior is validated
alongside the visible mode label.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f65ed98a-bc6b-4907-9bb2-62efb72b7fe5
📒 Files selected for processing (3)
locales/en/plugin__lightspeed-console-plugin.jsonsrc/components/Prompt.tsxtests/tests/lightspeed-install.cy.ts
8ed95da
into
openshift:release-4.19
Cherry pick of #1837
Made-with: Cursor
Summary by CodeRabbit
New Features
Tests