Skip to content

Add articles button support to ChatInput#704

Merged
abhijithsheheer merged 2 commits into
mainfrom
add-articles-button-to-chat-input
Jul 9, 2026
Merged

Add articles button support to ChatInput#704
abhijithsheheer merged 2 commits into
mainfrom
add-articles-button-to-chat-input

Conversation

@abhijithsheheer

@abhijithsheheer abhijithsheheer commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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 as onForward/onCannedResponse).
  • showArticlesFor — option types the button is visible for. Defaults to ["REPLY", "NOTE"].

Non-breaking; existing consumers are unaffected.

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.

@neeto-bugwatch neeto-bugwatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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
  }
]

Comment thread src/components/ChatInput/ChatInput.jsx
Comment thread src/components/ChatInput/ChatInput.jsx
Comment thread src/components/ChatInput/ChatInput.jsx
Comment thread src/components/ChatInput/ChatInput.jsx
@abhijithsheheer abhijithsheheer self-assigned this Jul 9, 2026
@abhijithsheheer abhijithsheheer added frontend Deals with React/JS code majorly. It can also include UI fixes without the help of the UI team. patch Releases small requests or bug fixes. labels Jul 9, 2026
@abhijithsheheer abhijithsheheer merged commit c124f97 into main Jul 9, 2026
@abhijithsheheer abhijithsheheer deleted the add-articles-button-to-chat-input branch July 9, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Deals with React/JS code majorly. It can also include UI fixes without the help of the UI team. patch Releases small requests or bug fixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant