-
Notifications
You must be signed in to change notification settings - Fork 19.5k
feat: implement step two of dataset creation with comprehensive UI components and hooks #30681
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
…mponents and hooks - Added new components for general chunking options, parent-child options, preview panel, and step two footer. - Introduced hooks for document creation, indexing configuration, indexing estimation, preview state, and segmentation state. - Created types for step two props and integrated them into the components. - Implemented escape and unescape utility functions for handling special characters. - Established a structured approach for managing dataset creation workflow, enhancing user experience and functionality.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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 refactors the step-two component of the dataset creation workflow by extracting logic into custom hooks and smaller components, improving maintainability and testability.
Key Changes:
- Extracted state management into 5 custom hooks (useSegmentationState, usePreviewState, useIndexingConfig, useIndexingEstimate, useDocumentCreation)
- Split monolithic component into 5 focused sub-components (GeneralChunkingOptions, ParentChildOptions, IndexingModeSection, PreviewPanel, StepTwoFooter)
- Added comprehensive test coverage with 2185 lines of tests
- Created escape/unescape utility functions for handling special characters
Reviewed changes
Copilot reviewed 15 out of 19 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| index.tsx | Refactored main component to use extracted hooks and sub-components |
| types.ts | Defined StepTwoProps interface |
| hooks/* | Implemented 5 custom hooks for state management and business logic |
| components/* | Created 5 focused sub-components for UI sections |
| escape.ts/unescape.ts | Utility functions for character escaping |
| index.spec.tsx | Comprehensive test suite covering hooks and components |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
web/app/components/datasets/create/step-two/components/preview-panel.tsx
Show resolved
Hide resolved
web/app/components/datasets/create/step-two/components/parent-child-options.tsx
Show resolved
Hide resolved
web/app/components/datasets/create/step-two/hooks/use-document-creation.ts
Outdated
Show resolved
Hide resolved
web/app/components/datasets/create/step-two/hooks/use-document-creation.ts
Outdated
Show resolved
Hide resolved
web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx
Show resolved
Hide resolved
web/app/components/datasets/create/step-two/components/indexing-mode-section.tsx
Show resolved
Hide resolved
- Updated test case to clarify handling of complex strings without backslashes. - Added new test case to document behavior for strings containing existing backslashes, highlighting the non-symmetrical nature of escape/unescape functions. - Improved code readability and understanding of string manipulation scenarios.
e782ab6 to
88db000
Compare
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: implement step two of dataset creation with comprehensive UI components and hooks
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods