You've already forked DataMate
refactor(annotation): 简化任务选择逻辑并移除未使用的状态管理
- 移除了 resolveSegmentSummary 函数调用以简化完成状态判断 - 删除了未使用的 segmentStats 相关引用和缓存清理代码 - 简化了重置模式下的状态更新逻辑
This commit is contained in:
@@ -330,8 +330,6 @@ export default function LabelStudioTextEditor() {
|
||||
|
||||
const updateTaskSelection = useCallback((items: EditorTaskListItem[]) => {
|
||||
const isCompleted = (item: EditorTaskListItem) => {
|
||||
const summary = resolveSegmentSummary(item);
|
||||
if (summary) return summary.done >= summary.total;
|
||||
return item.hasAnnotation;
|
||||
};
|
||||
const defaultFileId =
|
||||
@@ -392,9 +390,6 @@ export default function LabelStudioTextEditor() {
|
||||
if (mode === "reset") {
|
||||
prefetchSeqRef.current += 1;
|
||||
setPrefetching(false);
|
||||
segmentStatsSeqRef.current += 1;
|
||||
segmentStatsCacheRef.current = {};
|
||||
segmentStatsLoadingRef.current = new Set();
|
||||
}
|
||||
if (mode === "append") {
|
||||
setLoadingMore(true);
|
||||
|
||||
Reference in New Issue
Block a user