Skip to content

Conversation

@emlimlf
Copy link
Collaborator

@emlimlf emlimlf commented Oct 28, 2025

In this PR

  • Made the copilot modal charts on demand
  • Fix small chat widget not disappearing when the user sent the first chat
  • Fix feedback not showing up if there are no data results given by the AI

Tickets

IN-801
IN-800

Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@emlimlf emlimlf requested review from Copilot, epipav and gaspergrom and removed request for Copilot October 28, 2025 07:30
Copilot AI review requested due to automatic review settings October 29, 2025 06:31
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 PR enhances the Data Copilot feature by implementing a chart generation workflow with user opt-in and adding feedback functionality. The changes improve the user experience by allowing users to explicitly request chart visualization rather than generating it automatically.

Key changes:

  • Added isChartRequested state flag to track when users request chart generation
  • Implemented chat response feedback mechanism with isEndResponse flag to mark the final message in a conversation
  • Modified the results UI to show a prompt banner for chart generation instead of automatically displaying charts
  • Removed unused loading state UI elements from the loading-state component

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/app/components/shared/modules/copilot/types/copilot.types.ts Added isEndResponse optional property to AIMessage interface
frontend/app/components/shared/modules/copilot/store/copilot.store.ts Added isChartRequested reactive state and initialization logic
frontend/app/components/shared/modules/copilot/store/copilot.api.service.ts Enhanced stream processing to track and propagate chatResponseId throughout the message lifecycle
frontend/app/components/shared/modules/copilot/components/shared/loading-state.vue Removed unused "Data successfully processed" UI block and isDataReady prop usage
frontend/app/components/shared/modules/copilot/components/results/results-toggle.vue Made results tabs dynamic based on isChartRequested state
frontend/app/components/shared/modules/copilot/components/results/results-section.vue Added chart generation prompt banner with opt-in button and handler logic
frontend/app/components/shared/modules/copilot/components/copilot-sidebar.vue Set isEndResponse flag on the last message when chat response completes
frontend/app/components/shared/modules/copilot/components/chat-history/copilot-chat-item.vue Added conditional feedback component for router-status messages
frontend/app/components/modules/widget/components/shared/widget-menu-popover.vue Added @action-done event handler to close popover after action completion
Comments suppressed due to low confidence (1)

frontend/app/components/shared/modules/copilot/components/shared/loading-state.vue:39

  • The isDataReady prop is now unused since the related UI block was removed. This prop should be removed from the component's interface to keep the API clean.
    isDataReady?: boolean;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<lfx-copilot-results-header
:is-empty="isEmpty"
:is-loading="isLoading || isChartLoading"
:is-loading="isLoading"
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The isChartLoading parameter has been removed from the header's :is-loading prop binding, but the local isChartLoading ref at line 120 and its related handlers (handleChartLoading at line 162) are still present. If chart loading state is no longer needed in the header, consider removing the unused isChartLoading local state and its handler, or document why they're retained.

Copilot uses AI. Check for mistakes.
}
if (messages.value.length > 0) {
messages.value[messages.value.length - 1]!.isEndResponse = true;
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

[nitpick] Using non-null assertion operator (!) without prior length check could be risky. Although there's a length check in the if condition above, consider using optional chaining for defensive programming: messages.value[messages.value.length - 1].isEndResponse = true or add a null check inside the if block.

Suggested change
messages.value[messages.value.length - 1]!.isEndResponse = true;
messages.value[messages.value.length - 1]?.isEndResponse = true;

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants