-
Notifications
You must be signed in to change notification settings - Fork 19.5k
feat(embedding-process): implement embedding process components and polling logic #30622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…olling logic - Added , , , and for managing and displaying the embedding process. - Introduced utility functions for document lookup and indexing status management. - Enhanced the main component to utilize new components and hooks for improved functionality and user experience. - Implemented tests for new components to ensure reliability and correctness.
Summary of ChangesHello @CodingOnStar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors and enhances the user interface for monitoring the document embedding process. By introducing modular components and a dedicated polling hook, it provides a clearer, more organized, and robust way for users to track the status of their documents, understand the applied processing rules, and receive relevant upgrade notifications. The changes aim to improve the overall user experience and maintainability of the embedding process feature. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant and well-executed refactoring of the embedding process components. The logic has been broken down into smaller, more manageable pieces, including new components, utility functions, and a dedicated polling hook. This greatly improves the maintainability and testability of the code, as demonstrated by the comprehensive new test suite.
My review focuses on a few areas for improvement:
- Correcting a bug in the polling logic due to an inconsistent status list.
- Simplifying some redundant code for better clarity.
- Improving the accuracy of a test description to avoid confusion.
Overall, this is a high-quality contribution that enhances the codebase structure.
web/app/components/datasets/create/embedding-process/use-indexing-status-polling.ts
Outdated
Show resolved
Hide resolved
web/app/components/datasets/create/embedding-process/index.spec.tsx
Outdated
Show resolved
Hide resolved
web/app/components/datasets/create/embedding-process/rule-detail.tsx
Outdated
Show resolved
Hide resolved
- Fixed the description of a test case in index.spec.tsx to accurately reflect its purpose. - Added 'waiting' status to the EMBEDDING_STATUSES constant in use-indexing-status-polling.ts for improved status tracking.
…ile extensions - Added comprehensive tests for the DocumentFileIcon component to cover multiple file extensions, including handling of unknown, uppercase, mixed case, and filenames with multiple dots or no extension. - Removed outdated snapshot tests to streamline the test suite.
There was a problem hiding this 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 a comprehensive embedding process management system with polling, progress tracking, and UI components for document indexing in a dataset creation workflow.
Key Changes:
- Introduces a polling hook for real-time indexing status updates with automatic cleanup
- Refactors a monolithic component into smaller, focused, reusable components
- Adds utility functions for document lookup and status calculation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
utils.ts |
Provides utility functions for document lookup, status checking, and progress calculations |
use-indexing-status-polling.ts |
Custom hook implementing polling logic with 2.5s intervals and automatic stop on completion |
upgrade-banner.tsx |
Simple banner component prompting users to upgrade for faster document processing |
rule-detail.tsx |
Component displaying document processing rules, indexing type, and retrieval settings |
indexing-progress-item.tsx |
Individual progress bar item showing document status, icons, and completion percentage |
index.tsx |
Main refactored component orchestrating all sub-components with improved structure |
index.spec.tsx |
Comprehensive test suite with 1562 lines covering all components and edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
web/app/components/datasets/create/embedding-process/index.spec.tsx
Outdated
Show resolved
Hide resolved
web/app/components/datasets/create/embedding-process/rule-detail.tsx
Outdated
Show resolved
Hide resolved
web/app/components/datasets/create/embedding-process/rule-detail.tsx
Outdated
Show resolved
Hide resolved
…e name retrieval logic - Updated the test case description in index.spec.tsx for clarity. - Refined the logic in rule-detail.tsx to ensure only valid rule names are returned, improving robustness in handling undefined or non-string rule names.
WTW0313
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
feat(embedding-process): implement embedding process components and polling logic
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods