0.3.1 UI修复
This commit is contained in:
@@ -119,10 +119,10 @@ export function FileTree({
|
||||
index >= dragOverRange.startIndex &&
|
||||
index < dragOverRange.endIndex;
|
||||
const baseClass =
|
||||
"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]";
|
||||
"group flex items-center gap-2 px-3 py-[2px] min-h-[27px] w-full select-none cursor-pointer rounded-[3px] text-wolai-text-primary text-[14px] font-medium hover:bg-wolai-bg-hover transition-colors duration-150 data-[active=true]:bg-wolai-bg-active";
|
||||
const activeClass =
|
||||
row.kind === "index"
|
||||
? "text-[#2563eb] font-medium"
|
||||
? "text-[#2563eb]"
|
||||
: row.kind === "doc"
|
||||
? "text-[#2563eb]"
|
||||
: "";
|
||||
@@ -135,9 +135,10 @@ export function FileTree({
|
||||
className={cn(
|
||||
baseClass,
|
||||
active && activeClass,
|
||||
selected && "bg-[#e8f2ff] text-[#2563eb]",
|
||||
selected && "bg-wolai-bg-active text-[#2563eb]",
|
||||
inDropFeedback && "bg-gray-200/70",
|
||||
)}
|
||||
data-active={active}
|
||||
style={{ paddingLeft }}
|
||||
onClick={(event) => onRowClick(row, event)}
|
||||
onDoubleClick={(event) => onRowDoubleClick(row, event)}
|
||||
@@ -228,19 +229,19 @@ export function FileTree({
|
||||
event.stopPropagation();
|
||||
onToggleExpand(row.docId);
|
||||
}}
|
||||
className="flex h-5 w-5 items-center justify-center rounded-md hover:bg-gray-100"
|
||||
className="flex h-5 w-5 items-center justify-center rounded-md hover:bg-gray-100 shrink-0"
|
||||
>
|
||||
<ChevronRight
|
||||
className={cn(
|
||||
"h-3.5 w-3.5 transition-transform",
|
||||
"w-4 h-4 text-wolai-text-secondary transition-transform group-hover:text-wolai-text-primary",
|
||||
row.isExpanded && "rotate-90",
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
) : (
|
||||
<span className="h-5 w-5" />
|
||||
<span className="w-5 h-5 shrink-0" />
|
||||
)}
|
||||
<Folder className="h-4 w-4 text-[#2563eb]" />
|
||||
<Folder className="w-4 h-4 text-[#2563eb] shrink-0" />
|
||||
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
|
||||
<button
|
||||
type="button"
|
||||
@@ -249,15 +250,15 @@ export function FileTree({
|
||||
event.stopPropagation();
|
||||
onCreateChild(row.docId);
|
||||
}}
|
||||
className="rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-700"
|
||||
className="rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-700 shrink-0"
|
||||
>
|
||||
<Plus className="h-3.5 w-3.5" />
|
||||
<Plus className="w-4 h-4" />
|
||||
</button>
|
||||
</>
|
||||
) : row.kind === "index" ? (
|
||||
<>
|
||||
<span className="h-4 w-4" />
|
||||
<FileText className="h-4 w-4 text-gray-500" />
|
||||
<span className="w-4 h-4 shrink-0" />
|
||||
<FileText className="w-4 h-4 text-wolai-text-secondary shrink-0" />
|
||||
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
|
||||
</>
|
||||
) : row.kind === "asset-folder" ? (
|
||||
@@ -270,25 +271,25 @@ export function FileTree({
|
||||
event.stopPropagation();
|
||||
onToggleAssetFolderExpand?.(row.asset.id);
|
||||
}}
|
||||
className="flex h-5 w-5 items-center justify-center rounded-md hover:bg-gray-100"
|
||||
className="flex h-5 w-5 items-center justify-center rounded-md hover:bg-gray-100 shrink-0"
|
||||
>
|
||||
<ChevronRight
|
||||
className={cn(
|
||||
"h-3.5 w-3.5 transition-transform",
|
||||
"w-4 h-4 text-wolai-text-secondary transition-transform group-hover:text-wolai-text-primary",
|
||||
row.isExpanded && "rotate-90",
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
) : (
|
||||
<span className="h-5 w-5" />
|
||||
<span className="w-5 h-5 shrink-0" />
|
||||
)}
|
||||
<Folder className="h-4 w-4 text-[#2563eb]" />
|
||||
<Folder className="w-4 h-4 text-[#2563eb] shrink-0" />
|
||||
<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="w-4 h-4 shrink-0" />
|
||||
<Paperclip className="w-4 h-4 text-wolai-text-secondary shrink-0" />
|
||||
<span className="min-w-0 flex-1 truncate text-left">{label}</span>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user