MGMT-21122: Add feedback form to the Chatbot responses#3051
MGMT-21122: Add feedback form to the Chatbot responses#3051ammont82 merged 1 commit intoopenshift-assisted:masterfrom
Conversation
|
@celdrake: This pull request references MGMT-21122 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. 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. |
|
""" WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BotMessage
participant ChatBotWindow
participant Backend
User->>BotMessage: Clicks feedback (positive/negative)
BotMessage->>ChatBotWindow: Calls onFeedbackSubmit(req)
ChatBotWindow->>Backend: POST /v1/feedback (with conversationId, question, answer, feedback, sentiment)
Backend-->>ChatBotWindow: Returns response
ChatBotWindow-->>BotMessage: Resolves feedback submission
Suggested labels
Suggested reviewers
Poem
""" Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
libs/chatbot/lib/components/ChatBot/BotMessage.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "@openshift-assisted/eslint-config" to extend from. Please check that the name of the config is correct. The config "@openshift-assisted/eslint-config" was referenced from the config file in "/libs/chatbot/.eslintrc.cjs". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "@openshift-assisted/eslint-config" to extend from. Please check that the name of the config is correct. The config "@openshift-assisted/eslint-config" was referenced from the config file in "/libs/chatbot/.eslintrc.cjs". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningslibs/chatbot/lib/components/ChatBot/BotMessage.tsx (1)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (5)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@celdrake: This pull request references MGMT-21122 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. 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.
Actionable comments posted: 3
🧹 Nitpick comments (3)
libs/chatbot/lib/components/ChatBot/BotMessage.tsx (2)
34-34: Remove unnecessaryvoidoperator.The
onClickhandler doesn't expect a return value, so thevoidoperator is unnecessary.- void navigator.clipboard.writeText(text); + navigator.clipboard.writeText(text);
15-52: Consider extracting hardcoded strings for internationalization.The hardcoded strings in
getActionsanduserFeedbackFormshould be extracted to support internationalization if this is a requirement for your application.libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1)
200-212: Verify backend endpoint and add tests.Ensure that:
- The
/v1/feedbackendpoint is implemented on the backend- Unit tests are added for the feedback functionality
Would you like me to help generate unit tests for the feedback functionality?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
libs/chatbot/lib/components/ChatBot/BotMessage.tsx(1 hunks)libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx(8 hunks)
🔇 Additional comments (5)
libs/chatbot/lib/components/ChatBot/BotMessage.tsx (1)
3-3: Avoid importing from internal distribution pathsDeep imports from
/dist/cjs/are fragile and can break when the library is updated. Based on the current PatternFly ChatBot documentation and published package metadata,UserFeedbackPropsis not exposed from the main@patternfly-6/chatbotentry point.• Verify whether
UserFeedbackPropsappears in the package’s TypeScript declaration files (e.g. inspectnode_modules/@patternfly-6/chatbot/dist/esm/index.d.ts).
• If it isn’t publicly exported:
– File an issue or PR against PatternFly ChatBot to expose this type in the main entry.
– Or define a local equivalent interface forUserFeedbackPropsuntil an official export is available.libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (4)
27-29: Good use of constants for role values.Extracting role strings as constants improves maintainability and reduces the chance of typos.
53-71: Well-implemented helper function.The function correctly handles edge cases and uses defensive programming with the
String()conversion.
89-92: Clean implementation of scroll callback.Good use of
useCallbackfor performance optimization.
270-287: Clean implementation of conditional message rendering.The logic properly distinguishes between bot and user messages, and the key generation strategy is appropriate.
fdb4883 to
65004e3
Compare
|
@celdrake: This pull request references MGMT-21122 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. 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. |
65004e3 to
bad36f4
Compare
|
/lgtm |
|
/cherry-pick releases/v2.43 |
|
@ammont82: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ammont82, celdrake 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 |
|
@ammont82: new pull request created: #3052 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 kubernetes-sigs/prow repository. |
Adds a new Feedback form to the Chatbot's responses.
chatbot-feedback-final.mp4
Summary by CodeRabbit
New Features
Improvements