fix(annotation): 修复段落导航栏布局问题

- 修改段落导航容器为 flex-nowrap 防止换行
- 为段落标签添加 shrink-0 类避免压缩
- 使用 flex-1 min-w-0 优化段落列表容器
- 添加 overflow-x-auto 和 whitespace-nowrap 实现横向滚动
- 为右侧控制区域添加 shrink-0 和 whitespace-nowrap 类
This commit is contained in:
2026-01-24 16:28:07 +08:00
parent 0e30e658e9
commit 03402e4559

View File

@@ -718,9 +718,12 @@ export default function LabelStudioTextEditor() {
<div className="flex-1 flex flex-col min-h-0">
{/* 段落导航栏 */}
{segmented && segments.length > 0 && (
<div className="flex items-center gap-2 px-3 py-2 bg-gray-50 border-b border-gray-200">
<Typography.Text style={{ fontSize: 12 }}></Typography.Text>
<div className="flex gap-1 flex-wrap">
<div className="flex flex-nowrap items-center gap-2 px-3 py-2 bg-gray-50 border-b border-gray-200">
<Typography.Text style={{ fontSize: 12 }} className="shrink-0">
</Typography.Text>
<div className="flex-1 min-w-0">
<div className="flex gap-1 overflow-x-auto whitespace-nowrap">
{segments.map((seg) => (
<Button
key={seg.idx}
@@ -736,8 +739,9 @@ export default function LabelStudioTextEditor() {
)}
</Button>
))}
</div>
</div>
<div className="flex items-center gap-2 ml-auto">
<div className="flex items-center gap-2 ml-auto shrink-0 whitespace-nowrap">
<Tag color="blue">{currentSegmentIndex + 1} / {segments.length}</Tag>
<Typography.Text style={{ fontSize: 12 }}></Typography.Text>
<Switch