Description
Group records by reference in the annotation queue to improve the user experience when working with document extraction data. This issue is part of the larger workspace-level schema configuration enhancement and leverages the new SchemaService for intelligent record grouping.
Problem
- Records from the same document/reference appear scattered throughout the annotation queue
- Users need to switch between different records that are part of the same document
- No consistent grouping mechanism exists for related records
- Current implementation doesn't leverage workspace schema configuration
Proposed Solution
- Leverage Workspace Schema Configuration: Use the workspace schema configuration to understand document structure and references
- Integrate with SchemaService: Use the new SchemaService to determine proper grouping logic
- Enhance Backend Search API: Modify the search API to support schema-aware reference grouping
- Update Frontend Components: Update UI to display grouped records with schema context
Implementation Details
Dependencies
- Workspace schema configuration infrastructure must be implemented first
- SchemaService must be available for reference resolution
- Document-centric APIs should be available for optimal implementation
Backend Changes
The search API in argilla-server/src/argilla_server/api/handlers/v1/datasets/records.py needs to be modified to:
-
Use SchemaService for grouping logic:
schema_service = SchemaService(workspace_id, db)
reference_field = schema_service.get_reference_field()
grouping_config = schema_service.get_grouping_configuration()
-
Add workspace-aware grouping parameter to the search query
-
Sort records by reference and schema order using workspace configuration
-
Return schema context in the API response for proper frontend rendering
Frontend Changes
The frontend record handling needs to:
- Fetch workspace schema configuration on dataset load
- Use schema-aware grouping in record retrieval
- Display records with schema context and proper ordering
- Support navigation between related records within the same reference group
Related Files
extralit/argilla-server/src/argilla_server/services/SchemaService.py - Core grouping logic
extralit/argilla-server/src/argilla_server/api/handlers/v1/datasets/records.py - Enhanced search API
extralit/argilla-frontend/v1/domain/usecases/get-records-by-criteria-use-case.ts - Updated record retrieval
extralit/argilla-frontend/components/features/record-grouping/ - New grouping components
Acceptance Criteria
Related Issues
This is part of the strategic workspace-level schema management enhancement:
Description
Group records by reference in the annotation queue to improve the user experience when working with document extraction data. This issue is part of the larger workspace-level schema configuration enhancement and leverages the new SchemaService for intelligent record grouping.
Problem
Proposed Solution
Implementation Details
Dependencies
Backend Changes
The search API in
argilla-server/src/argilla_server/api/handlers/v1/datasets/records.pyneeds to be modified to:Use SchemaService for grouping logic:
Add workspace-aware grouping parameter to the search query
Sort records by reference and schema order using workspace configuration
Return schema context in the API response for proper frontend rendering
Frontend Changes
The frontend record handling needs to:
Related Files
extralit/argilla-server/src/argilla_server/services/SchemaService.py- Core grouping logicextralit/argilla-server/src/argilla_server/api/handlers/v1/datasets/records.py- Enhanced search APIextralit/argilla-frontend/v1/domain/usecases/get-records-by-criteria-use-case.ts- Updated record retrievalextralit/argilla-frontend/components/features/record-grouping/- New grouping componentsAcceptance Criteria
Related Issues
This is part of the strategic workspace-level schema management enhancement: