⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@marker-dao
Copy link
Contributor

No description provided.

@marker-dao marker-dao self-assigned this Jan 13, 2026
@marker-dao marker-dao marked this pull request as ready for review January 13, 2026 19:21
@marker-dao marker-dao requested review from a team as code owners January 13, 2026 19:21
Copilot AI review requested due to automatic review settings January 13, 2026 19:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request integrates an Accordion component into the Chat widget's MessageBubble to display function call metadata. The feature allows chat messages to include information about AI assistant function calls, showing the function name, arguments, and results in an expandable accordion interface.

Changes:

  • Added TypeScript type definitions for FunctionCall, FunctionCallArgument, and MetaData types
  • Extended TextMessage type to include optional metadata field
  • Implemented accordion rendering in MessageBubble to display function call details
  • Added localization strings for function call UI labels across all supported languages
  • Updated playground example to demonstrate the new functionality

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/devextreme/js/ui/chat.d.ts Added TypeScript definitions for function call metadata types and extended TextMessage
packages/devextreme/js/__internal/ui/chat/messagegroup.ts Passed metadata from message to MessageBubble options
packages/devextreme/js/__internal/ui/chat/messagebubble.ts Implemented accordion rendering for function call metadata, added element creation and option change handling
packages/devextreme/js/localization/messages/*.json Added localization strings for function call labels in 31 language files
packages/devextreme/playground/jquery.html Updated playground to demonstrate Chat widget with function call metadata

Copilot AI review requested due to automatic review settings January 14, 2026 20:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 37 changed files in this pull request and generated 6 comments.

Comment on lines +34 to +35
focusStateEnabled?: boolean;
hoverStateEnabled?: boolean;
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The focusStateEnabled and hoverStateEnabled properties are being added to MessageBubble specifically to pass through to the Accordion component. However, these options shadow the inherited focusStateEnabled and hoverStateEnabled from the parent Widget class. This creates ambiguity: MessageBubble is a Widget that has its own focus/hover states, but these properties are being used exclusively for the nested Accordion. Consider using namespaced properties like accordionFocusStateEnabled and accordionHoverStateEnabled to avoid confusion and maintain clear separation between the MessageBubble's state and the Accordion's state.

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +54
focusStateEnabled: true,
hoverStateEnabled: true,
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Setting default values for focusStateEnabled and hoverStateEnabled to true overrides the parent Widget class defaults. Since these are now being used to control the Accordion's state rather than the MessageBubble's own state, this could lead to unexpected behavior if the parent class has different defaults or if these properties are meant to control the MessageBubble itself. Consider whether these defaults should be set at the Accordion initialization level instead.

Suggested change
focusStateEnabled: true,
hoverStateEnabled: true,

Copilot uses AI. Check for mistakes.
Comment on lines +273 to +276
case 'focusStateEnabled':
case 'hoverStateEnabled':
this._renderFunctionCall();
break;
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

When focusStateEnabled or hoverStateEnabled options change, the entire function call accordion is re-rendered by calling _renderFunctionCall(). This completely destroys and recreates the Accordion component even when only state options need to be updated. Consider updating the existing Accordion instance's options using this._accordionInstance.option(name, value) instead of full re-rendering for better performance.

Copilot uses AI. Check for mistakes.
Comment on lines +208 to +215
this._createComponent(this._$functionCall, Accordion, {
dataSource: accordionItems,
collapsible: true,
multiple: false,
selectedIndex: -1,
focusStateEnabled,
hoverStateEnabled,
});
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The Accordion component instance is created but not stored as a class property (e.g., this._accordionInstance). This makes it impossible to update the component's options later without re-creating it entirely. Store the instance returned by _createComponent to enable efficient updates when options change.

Copilot uses AI. Check for mistakes.
"dxChat-fileViewLabel": "File list",
"dxChat-downloadButtonLabel": "Download file {0}",
"dxChat-fileLimitReachedWarning": "You selected too many files. Select no more than {0} files and retry.",
"dxChat-functionCallTitle": "function called",
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Inconsistent capitalization: 'function called' should be 'Function Called' to match the capitalization pattern of other similar labels in the localization file.

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 3
"use strict";

/* Comment lines below for the widgets you don't require and run "devextreme-bundler" in this directory, then include dx.custom.js in your project */
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The entire file appears to be a complete rewrite of the bundle template. This is a 194-line file that seems to be auto-generated or a template file. If this is auto-generated, it should not be in the PR. If it's a manual template update, the PR should clarify why this file needed to be regenerated or modified as part of this feature.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant