Skip to content

Conversation

@AjitPadhi-Microsoft
Copy link
Contributor

@AjitPadhi-Microsoft AjitPadhi-Microsoft commented Oct 6, 2025

Purpose

  • This pull request improves citation handling in answers, enhances error messaging for empty proposal sections, and updates the document generation button logic to prevent generating documents with no sections. Below are the most important changes grouped by theme:

Citation Handling Improvements

  • Refactored the citation parsing logic in AnswerParser.tsx to reindex citations, remove invalid markers, and ensure only valid citations are displayed in the formatted answer text. This prevents duplicate and out-of-range citations from appearing in the UI.

Template Section Error Handling

  • Added a new error message EmptySectionsError to contentTemplateSections in helpers.ts for cases when no sections are selected in a proposal.
  • Updated generateTemplateSections in helpers.ts to return the new EmptySectionsError message if the template contains no sections, improving user feedback for empty proposals.

Document Generation Button Logic

  • Modified the document generation button in Chat.tsx to be disabled if the draft document has no sections, preventing users from generating empty documents.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • I have built and tested the code locally and in a deployed app
  • For frontend changes, I have pulled the latest code from main, built the frontend, and committed all static files.
  • This is a change for all users of this app. No code or asset is specific to my use case or my organization.

Other Information

Copy link

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 fixes citation handling and improves error messaging for document generation. The changes ensure citations are properly reindexed, provide better error messages for empty proposal sections, and prevent generation of documents with no content.

  • Refactored citation parsing to properly reindex and filter valid citations
  • Added error handling for empty proposal templates
  • Updated document generation button to prevent creating empty documents

Reviewed Changes

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

File Description
Chat.tsx Added check to disable document generation when no sections exist
helpers.ts Added new error message for empty sections and validation logic
AnswerParser.tsx Refactored citation parsing to properly handle reindexing and invalid citations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@microsoft microsoft deleted a comment from Copilot AI Oct 7, 2025
@microsoft microsoft deleted a comment from Copilot AI Oct 7, 2025
@Roopan-Microsoft Roopan-Microsoft merged commit fd3461c into dev Oct 7, 2025
5 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the PSL-BUG-24399 branch October 7, 2025 12:44
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants