feat(remote): 添加文件传输功能页面

- 新增 FileTransferPage 组件,支持本地与远程文件传输
- 添加 LocalFilePanel 和 RemoteFilePanel 组件
- 实现 TransferQueue 传输队列组件,支持拖动调整高度
- 优化侧边栏拖动条样式,修复拖动偏移问题
- 统一文件列表样式为灰白极简风格
- 支持 file-transfer-panel 协议打开文件传输标签页
This commit is contained in:
2026-03-08 17:03:21 +08:00
parent 7b2a88f27e
commit afe43c5ff9
11 changed files with 294 additions and 147 deletions

View File

@@ -1,11 +1,14 @@
import { useCallback, useEffect, useState } from 'react'
import { useCallback, useEffect, useRef, useState } from 'react'
export const useSidebarResize = (initialWidth: number = 250) => {
const [sidebarWidth, setSidebarWidth] = useState(initialWidth)
const [isResizing, setIsResizing] = useState(false)
const offsetX = useRef(0)
const startResizing = useCallback((e: React.MouseEvent) => {
e.preventDefault()
const rect = (e.target as HTMLElement).getBoundingClientRect()
offsetX.current = e.clientX - rect.left
setIsResizing(true)
}, [])
@@ -14,7 +17,7 @@ export const useSidebarResize = (initialWidth: number = 250) => {
const stopResizing = () => setIsResizing(false)
const resize = (e: MouseEvent) => {
const newWidth = e.clientX
const newWidth = e.clientX - offsetX.current
if (newWidth > 150 && newWidth < 600) {
setSidebarWidth(newWidth)
}