Add articles button support to ChatInput#704
Merged
Merged
Conversation
Adds optional onArticles and showArticlesFor props. When onArticles is passed, a BookOpen icon button is rendered in the footer action row (next to canned responses), shown only for the option types listed in showArticlesFor (defaults to REPLY and NOTE). Needed by neeto-desk-rn to attach neetoKB help articles to ticket replies.
There was a problem hiding this comment.
🤖 NeetoBugWatch Review
I've analyzed your pull request and found some potential improvements that might be worth considering. Please review the specific line comments below for helpful suggestions.
💡 To trigger a re-review of this PR, add a comment with neeto-bugwatch-run on its own line (not inside a code block or blockquote).
Tip
Verdict: Good to merge — no significant issues found
Click to copy prompt for AI agent
Verdict: clean
The following are code review comments from an AI reviewer that only has access
to the PR diff, not the full codebase. Treat every comment as a hypothesis,
not a fact. For each comment:
1. Investigate the verification questions against the full codebase first.
2. Go beyond the provided questions. Use your full codebase access to ask your
own questions, check related code paths, and consider edge cases that the
reviewer could not have seen from the diff alone.
3. Only implement the suggested fix if your investigation confirms the issue is real.
4. If the issue is not real, skip it entirely. Do not implement speculative fixes.
Items are tagged with a kind:
- finding: a potential defect. Verify against the codebase first; fix only if real.
- note: informational or minor polish. Act only when the change is cheap and clearly right.
- product_decision: a behavior or product question. Do NOT implement a change for it; surface it to a human for a decision.
Prioritize by severity (critical > major > minor > trivial) and confidence score.
Only attend to comments with confidence below 0.5 if your investigation proves them valid.
[
{
"kind": "product_decision",
"location": "inline",
"file_path": "src/components/ChatInput/ChatInput.jsx",
"line_number": 154,
"comment": "Default showArticlesFor excludes FORWARD\n\nThe default value for `showArticlesFor` is `[OPTION_TYPES.REPLY, OPTION_TYPES.NOTE]`. If the intended parity with web includes attaching help articles during 'Forward' flows, `OPTION_TYPES.FORWARD` should be added to the default array. If attaching articles is intentionally disabled when forwarding, this default is correct.",
"verification_questions": [],
"specialists_agreeing": 1
},
{
"kind": "note",
"location": "inline",
"file_path": "src/components/ChatInput/ChatInput.jsx",
"line_number": 423,
"comment": "Potential runtime crash if showArticlesFor is null\n\nThe expression `showArticlesFor.includes(selectedOption)` assumes `showArticlesFor` is always an array. While it defaults to an array and is typed with PropTypes, if a consumer explicitly passes `showArticlesFor={null}`, this will throw a `TypeError` and crash the application. Consider using optional chaining: `showArticlesFor?.includes(selectedOption)`.",
"confidence": 0.9,
"severity": "minor",
"verification_questions": [],
"raw_confidence": 0.9,
"specialists_agreeing": 2
},
{
"kind": "note",
"location": "inline",
"file_path": "src/components/ChatInput/ChatInput.jsx",
"line_number": 424,
"comment": "Missing accessibility label for icon-only button\n\nThe new `IconButton` for articles lacks an `accessibilityLabel`. While this appears to be a systemic omission in `ChatInput` (siblings like `ChatBubble`, `Notes`, and `CannedResponses` also lack labels), adding one here (e.g., `accessibilityLabel=\"Open help articles\"`) is recommended so screen readers can announce the button's purpose.",
"confidence": 0.9,
"severity": "minor",
"verification_questions": [],
"raw_confidence": 0.9,
"specialists_agreeing": 4
},
{
"kind": "note",
"location": "file",
"file_path": "src/components/ChatInput/ChatInput.jsx",
"line_number": 15,
"start_line": 11,
"comment": "JSDoc example not updated with new prop\n\nThe JSDoc usage example for the `ChatInput` component (lines 72-113) includes example usage of `onCannedResponse` and `onForward` but was not updated to include the new `onArticles` prop. Keeping documentation examples in parity with the API surface helps consumers discover the new feature.",
"confidence": 1.0,
"severity": "trivial",
"verification_questions": [],
"raw_confidence": 1.0,
"specialists_agreeing": 2
}
]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two optional props to
ChatInput:onArticles— callback for a new BookOpen icon button rendered in the footer action row, next to the canned-responses button. The button is rendered only when this prop is passed (same gating pattern asonForward/onCannedResponse).showArticlesFor— option types the button is visible for. Defaults to["REPLY", "NOTE"].Non-breaking; existing consumers are unaffected.