From 1f6c821cbc6dddb3bc36392645a198e04d7e4b82 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 6 Feb 2026 15:17:51 +0800 Subject: [PATCH] fix(annotation): show new version warning even without annotation Change has_new_version logic to compare current file version with latest version, regardless of whether annotation exists. Before: Only show warning if annotation exists and version is outdated After: Show warning if current file is not the latest version This ensures users are informed when viewing an old file version, even if they haven't started annotating yet. --- .../app/module/annotation/service/editor.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/datamate-python/app/module/annotation/service/editor.py b/runtime/datamate-python/app/module/annotation/service/editor.py index b74285b..7160f77 100644 --- a/runtime/datamate-python/app/module/annotation/service/editor.py +++ b/runtime/datamate-python/app/module/annotation/service/editor.py @@ -1706,12 +1706,9 @@ class AnnotationEditorService: annotation is not None and annotation_file_version is None ) - # 判断是否有新版本:最新版本 > 标注时的版本 - has_new_version = ( - latest_file_version > annotation_file_version - if annotation_file_version is not None - else False - ) + # 判断是否有新版本:最新版本 > 当前文件版本 + # 无论是否有标注,只要传入的文件不是最新版本就提示 + has_new_version = latest_file_version > file_record.version return { "fileId": file_id,