Skip to content

feat:dynamic retrieval display on frontend#97

Merged
siyuan-youtu merged 6 commits intomainfrom
dynamic_retrieval_display
Oct 8, 2025
Merged

feat:dynamic retrieval display on frontend#97
siyuan-youtu merged 6 commits intomainfrom
dynamic_retrieval_display

Conversation

@siyuan-youtu
Copy link
Copy Markdown
Contributor

No description provided.

@siyuan-youtu siyuan-youtu changed the title Dynamic retrieval display feat:Dynamic retrieval display Oct 8, 2025
@siyuan-youtu siyuan-youtu changed the title feat:Dynamic retrieval display feat:dynamic retrieval display on frontend Oct 8, 2025
@siyuan-youtu siyuan-youtu requested a review from Copilot October 8, 2025 13:48
Copy link
Copy Markdown
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 implements dynamic retrieval display functionality on the frontend by adding multi-language support with real-time progress tracking and comprehensive WebSocket-based communication for Q&A operations.

Key Changes:

  • Multi-language support: Replaced hardcoded Chinese text with dynamic English/Chinese language switching functionality
  • Real-time WebSocket communication: Added comprehensive WebSocket messaging for live Q&A progress updates with sub-question tracking and IRCoT step visualization
  • Streamlined backend processing: Removed complex security hardening and simplified file upload handling while adding async processing for better performance

Reviewed Changes

Copilot reviewed 17 out of 29 changed files in this pull request and generated 8 comments.

File Description
frontend/index.html Complete frontend overhaul with dynamic language switching, real-time Q&A progress display, and WebSocket integration
backend.py Simplified upload logic, added comprehensive WebSocket Q&A progress updates, and improved async processing
docs/* Removed entire documentation directory and related files
.github/workflows/publish-docs.yml Removed GitHub Pages documentation deployment workflow

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

Comment on lines +6 to 8

import os
import re
import sys
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The removed import re is still used in the file at line 774 where it's imported as _re. Consider importing re at the top of the file instead of importing it within the function for better code organization.

Copilot uses AI. Check for mistakes.
<div id="upload" class="tab-content">
<div class="card">
<h2 data-i18n="upload_documents_title">上传文档</h2>
<h2 id="uploadDocumentsTitle">Upload Documents</h2>
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation detected. This line has excessive indentation compared to surrounding lines which may indicate a formatting issue.

Suggested change
<h2 id="uploadDocumentsTitle">Upload Documents</h2>
<h2 id="uploadDocumentsTitle">Upload Documents</h2>

Copilot uses AI. Check for mistakes.
Comment on lines +1086 to +1095
<h2 id="uploadDocumentsTitle">Upload Documents</h2>
<div class="upload-area" id="uploadArea">
<div class="upload-icon">📁</div>
<h3 data-i18n="drag_drop_files">拖拽文件到此处</h3>
<p data-i18n="or_click_browse">或点击浏览文件</p>
<p style="font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 12px;" data-i18n="supported_formats">
当前支持格式:.json
<h3 id="uploadDragTitle">Drag & Drop Files Here</h3>
<p id="uploadDragDesc">or click to browse files</p>
<p id="uploadSupports" style="font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 12px;">
Currently supports: .json
</p>
<div style="margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.1); border-radius: 10px; text-align: left; font-size: 11px; color: rgba(255,255,255,0.8);">
<div style="font-weight: 600; margin-bottom: 8px;" data-i18n="sample_format">📄 示例格式 (.json)</div>
<pre style="margin: 0; font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 5px; overflow-x: auto;" id="sample-format-content">
<div id="uploadSampleHeader" style="font-weight: 600; margin-bottom: 8px;">📄 Sample Format (.json):</div>
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation pattern with excessive whitespace. Lines 1089-1092 have irregular indentation that doesn't follow the established pattern in the file.

Copilot uses AI. Check for mistakes.
<div style="margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.1); border-radius: 10px; text-align: left; font-size: 11px; color: rgba(255,255,255,0.8);">
<div style="font-weight: 600; margin-bottom: 8px;" data-i18n="sample_format">📄 示例格式 (.json)</div>
<pre style="margin: 0; font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 5px; overflow-x: auto;" id="sample-format-content">
<div id="uploadSampleHeader" style="font-weight: 600; margin-bottom: 8px;">📄 Sample Format (.json):</div>
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Excessive indentation that's inconsistent with the surrounding code structure. This should be aligned with the proper indentation level.

Suggested change
<div id="uploadSampleHeader" style="font-weight: 600; margin-bottom: 8px;">📄 Sample Format (.json):</div>
<div id="uploadSampleHeader" style="font-weight: 600; margin-bottom: 8px;">📄 Sample Format (.json):</div>

Copilot uses AI. Check for mistakes.
Comment on lines +1115 to +1116
<button class="btn" id="uploadBtn" disabled onclick="uploadFiles()">Upload Files</button>
<button class="btn btn-secondary" id="clearUploadBtn" onclick="clearFiles()">Clear</button>
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation with excessive whitespace that doesn't match the established indentation pattern in the file.

Copilot uses AI. Check for mistakes.
backend.py Outdated
await send_progress_update(client_id, "construction", 2, "Cleaning old cache files...")


await send_progress_update(client_id, "construction", 2, "清理旧缓存文件...")
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Hard-coded Chinese text in progress messages should use the same i18n approach as the frontend to maintain consistency and support multiple languages.

Copilot uses AI. Check for mistakes.
backend.py Outdated
await send_progress_update(client_id, "construction", 5, "Initializing graph builder...")

await send_progress_update(client_id, "construction", 5, "初始化图构建器...")
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Hard-coded Chinese text in progress messages should use the same i18n approach as the frontend to maintain consistency and support multiple languages.

Copilot uses AI. Check for mistakes.
backend.py Outdated
await send_progress_update(client_id, "construction", 10, "Loading configuration and corpus...")

await send_progress_update(client_id, "construction", 10, "加载配置和语料库...")
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Hard-coded Chinese text in progress messages should use the same i18n approach as the frontend to maintain consistency and support multiple languages.

Copilot uses AI. Check for mistakes.
@siyuan-youtu siyuan-youtu requested a review from Copilot October 8, 2025 15:34
Copy link
Copy Markdown
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 17 out of 29 changed files in this pull request and generated 4 comments.


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

<div id="upload" class="tab-content">
<div class="card">
<h2 data-i18n="upload_documents_title">上传文档</h2>
<h2 id="uploadDocumentsTitle">Upload Documents</h2>
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Excessive indentation found. The line has too many leading spaces compared to surrounding code.

Copilot uses AI. Check for mistakes.
Comment on lines +1089 to +1092
<h3 id="uploadDragTitle">Drag & Drop Files Here</h3>
<p id="uploadDragDesc">or click to browse files</p>
<p id="uploadSupports" style="font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 12px;">
Currently supports: .json
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation levels. These lines have excessive leading spaces and should be aligned consistently with surrounding HTML elements.

Copilot uses AI. Check for mistakes.
<div style="margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.1); border-radius: 10px; text-align: left; font-size: 11px; color: rgba(255,255,255,0.8);">
<div style="font-weight: 600; margin-bottom: 8px;" data-i18n="sample_format">📄 示例格式 (.json)</div>
<pre style="margin: 0; font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 5px; overflow-x: auto;" id="sample-format-content">
<div id="uploadSampleHeader" style="font-weight: 600; margin-bottom: 8px;">📄 Sample Format (.json):</div>
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Excessive indentation found. This line has significantly more leading spaces than necessary.

Copilot uses AI. Check for mistakes.
Comment on lines 7 to 9
import os
import re
import sys
import json
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Removed import statement for 're' module but regular expressions are still used later in the code (lines 774, _re.search). This will cause a runtime error.

Copilot uses AI. Check for mistakes.
@siyuan-youtu siyuan-youtu requested a review from Copilot October 8, 2025 15:43
Copy link
Copy Markdown
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 17 out of 29 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

frontend/index.html:1

  • [nitpick] Missing spaces after commas in the file extension list for better readability.
<!DOCTYPE html>

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

from utils.logger import logger
import ast
import main as graphrag_main

Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The line import main as graphrag_main was removed but the import statement appears to be incomplete or missing context. Ensure all necessary imports are properly maintained.

Suggested change
import main as graphrag_main

Copilot uses AI. Check for mistakes.
@siyuan-youtu siyuan-youtu merged commit bae8ff3 into main Oct 8, 2025
1 check passed
@siyuan-youtu siyuan-youtu deleted the dynamic_retrieval_display branch October 10, 2025 11:16
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.

2 participants