0.1.08 文件树视图修复

This commit is contained in:
liaibo
2026-01-08 18:17:07 +08:00
parent 9af8b9e489
commit e7350c87c6
2 changed files with 21 additions and 11 deletions
@@ -44,7 +44,7 @@ export function FileTree({
return (
<div
className="space-y-0.5"
className="w-full min-w-0 max-w-full space-y-0.5 overflow-x-hidden"
onDragOver={(event) => {
if (!onDropFiles) return;
event.preventDefault();
@@ -77,7 +77,7 @@ export function FileTree({
const draggable =
row.kind === "doc" || (row.kind === "asset" && isRealFileAsset(row.asset));
const baseClass =
"flex select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm text-gray-700 hover:bg-[#f5f7fb]";
"flex w-full min-w-0 max-w-full select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm text-gray-700 hover:bg-[#f5f7fb]";
const activeClass =
row.kind === "index"
? "text-[#2563eb] font-medium"
@@ -156,6 +156,7 @@ export function FileTree({
if (onDropFiles && event.dataTransfer.files?.length) {
event.preventDefault();
event.stopPropagation();
onDropFiles(row.docId, event.dataTransfer.files);
}
}}
@@ -185,7 +186,7 @@ export function FileTree({
<span className="h-5 w-5" />
)}
<Folder className="h-4 w-4 text-[#2563eb]" />
<span className="flex-1 truncate text-left">{label}</span>
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
<button
type="button"
aria-label="新建子页面"
@@ -202,13 +203,13 @@ export function FileTree({
<>
<span className="h-4 w-4" />
<FileText className="h-4 w-4 text-gray-500" />
<span className="flex-1 truncate text-left">{label}</span>
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
</>
) : (
<>
<span className="h-4 w-4" />
<Paperclip className="h-4 w-4 text-gray-500" />
<span className="flex-1 truncate text-left">{label}</span>
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
</>
)}
</div>