You've already forked DataMate
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user