3 Commits
Author SHA1 Message Date
viettranx 4d31fe0dda fix(workspace): fix file move bugs, migrate DnD to @dnd-kit
- Fix cross-scope move in team workspace "All" view (prevented invalid
  nested paths by detecting mismatched chat_id scopes)
- Add error toast on move failure instead of silent catch
- Auto-create destination subdirectories on move (os.MkdirAll)
- Add admin bypass for team workspace HTTP auth (matching RPC pattern)
- Clear stale activePath after move in storage page
- Migrate file tree DnD from native HTML5 to @dnd-kit with:
  - PointerSensor (distance=8 prevents accidental drags)
  - DragOverlay via portal (fixes offset in Radix Dialog)
  - Folder auto-expand on 800ms hover during drag
- Silent refresh after move to prevent tree flash/scroll loss
2026-03-25 22:17:33 +07:00
viettranx ae18f24cd9 feat(ui): drag-and-drop file/folder move in Storage and Workspace
Backend:
- PUT /v1/storage/move?from=&to= — admin-only, atomic os.Rename
  with protected dir, path traversal, symlink escape, and overwrite
  prevention checks.
- PUT /v1/teams/{teamId}/workspace/move — same security with team
  membership check and EventWorkspaceFileChanged broadcast.

Frontend:
- Files and folders are draggable in the file tree (HTML5 drag API).
- Folders are drop targets with visual ring highlight on dragover.
- Root-level drop zone for moving items to root directory.
- Guards: can't drop into self, can't drop folder into descendant,
  can't drop into protected dirs (server-side enforced).
- Wired in both Storage page and Team Workspace dialog.
2026-03-25 08:20:10 +07:00
viettranx 9ee82be219 feat(ui): add file upload to Team Workspace and Storage pages
Allow admins/operators to upload files via the web UI so agents can
read them with read_file during collaboration.

Backend:
- POST /v1/teams/{teamId}/workspace/upload — multipart upload with
  team membership check, tenant isolation, blocked extensions, 10MB
  limit, 100-file quota, symlink escape prevention, and real-time
  EventWorkspaceFileChanged broadcast.
- POST /v1/storage/files — admin-only storage upload with protected
  dir rejection and size cache invalidation.
- Export MaxFileSizeBytes, MaxFilesPerScope, IsBlockedExtension from
  tools package for reuse in HTTP handlers.

Frontend:
- Reusable FileUploadDialog component (drop zone, multi-file,
  per-file status, client-side validation).
- Upload button added to Team Workspace dialog (scope-aware) and
  Storage page (folder-aware).
- i18n strings for en/vi/zh.
2026-03-24 22:48:11 +07:00