diff --git a/runtime/datamate-python/app/module/annotation/service/template.py b/runtime/datamate-python/app/module/annotation/service/template.py index 9e36950..ed7dce8 100644 --- a/runtime/datamate-python/app/module/annotation/service/template.py +++ b/runtime/datamate-python/app/module/annotation/service/template.py @@ -36,7 +36,6 @@ class AnnotationTemplateService: """ tag_config = LabelStudioTagConfig() control_types = tag_config.get_control_types() - text_object_types = {"Text", "Paragraphs", "ParagraphLabels", "HyperText", "Markdown"} def normalize_control_type(raw: Optional[str]) -> str: if not raw: @@ -49,8 +48,6 @@ class AnnotationTemplateService: return ct return raw - is_text_template = any((obj.type in text_object_types) for obj in config.objects) - # 生成对象定义 object_parts: List[str] = [] for obj in config.objects: @@ -92,21 +89,10 @@ class AnnotationTemplateService: else: # 处理简单标签类型(不需要子元素) control_parts.append(f' <{tag_type} {" ".join(label_attrs)}/>') - - if is_text_template: - # 长文本优化:将标签控件固定在右侧(sticky),避免需要滚动到页面底部才能看到控件 - xml_parts = [ - '', - ' ', - *object_parts, - ' ', - ' ', - *control_parts, - ' ', - '', - ] - return '\n'.join(xml_parts) + # 说明: + # - Label Studio Frontend 默认会将控件(control tags)渲染到右侧侧栏(side-column/controls)。 + # - 如果在 XML 中手工做“双栏布局”,会导致控件出现在主区域,从而与侧栏的结果面板重复,影响体验。 xml_parts = [''] xml_parts.extend(object_parts) xml_parts.extend(control_parts)