Commit Graph

82 Commits

Author SHA1 Message Date
yyh
9e10b73b54 refactor(skill): replace @remixicon/react imports with CSS icon classes
Migrate all Remixicon component imports in workflow/skill to Tailwind CSS
icon utility classes (i-ri-*), reducing JS bundle size. Update MenuItem
to accept string icon classes alongside React components. Adjust test
selectors that relied on SVG element queries.
2026-02-09 19:51:05 +08:00
yyh
db0c527ce8 Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox 2026-02-09 18:43:04 +08:00
yyh
a761ab5cee test(skill): add comprehensive unit tests for file-tree domain 2026-02-07 16:53:58 +08:00
yyh
11d5efc13e refactor(skill): regroup skill body, file tree, and tree hooks 2026-02-07 14:20:01 +08:00
yyh
d3b32645f4 feat(skill-editor): add opacity style to dragged node's original position
Apply the same opacity-50 visual feedback used for cut nodes to nodes
being dragged, so the source position is visually dimmed during drag.
2026-02-06 15:50:04 +08:00
yyh
3bfa495795 refactor(skill-editor): add single/double click and optimize re-renders in search results
Extract SearchResultRow component with useDelayedClick to match file
tree behavior (single-click preview, double-click pin). Subscribe to
derived boolean instead of raw activeTabId to avoid unnecessary
re-renders across all rows.
2026-02-06 15:39:00 +08:00
yyh
f1100b82f9 feat(skill-editor): render flat search result list in file tree
Replace the tree-filtered search with a flat list that shows icon + name
on the left and parent path on the right, matching the Figma design.
Clicking a file opens its tab; clicking a folder clears the search and
reveals the folder in the tree.
2026-02-06 15:39:00 +08:00
yyh
44fd58853c fix(skill-editor): remove redundant focus ring and suppress row outline
Remove isFocused ring style from TreeNode since focus-visible already
handles keyboard focus indication. Add rowClassName="outline-none" to
suppress the default browser outline on react-arborist row containers.
2026-02-06 14:31:56 +08:00
yyh
4d1d83b509 test(skill-editor): add tests for TreeEditInput filename stem selection 2026-02-06 14:31:38 +08:00
yyh
f0ba739e44 fix(skill-editor): select only filename stem when renaming files
Use setSelectionRange to exclude the file extension from the initial
selection, matching the behavior of VS Code and Finder.
2026-02-06 14:27:52 +08:00
yyh
799d0c0d0b feat(skill-editor): auto-focus editor on file creation and improve tree-tab sync
Add editorAutoFocusFileId state to automatically focus the editor when
a new text file is created. Improve tree-tab synchronization by adding
syncSignal/isTreeLoading guards, deduplicating rAF calls, and skipping
redundant select/openParents operations when the node is already active.
2026-02-06 14:21:33 +08:00
yyh
ecbcd5803b fix(workflow): avoid nested button in skill file tree menu 2026-02-06 14:21:32 +08:00
yyh
b60f9c7703 refactor(web): use FileAdd and FolderAdd icons in skill menus
Replace RiFileAddLine and RiFolderAddLine with custom FileAdd and
FolderAdd icons for new file/folder menu items in skill sidebar.
2026-02-05 16:56:27 +08:00
yyh
9893bf267e feat(web): add import skills menu item with tooltip to skill file tree
Add "Import skills(.zip)" option to root-level context menu and sidebar
add menu with a question mark tooltip showing usage hint. Update menu
item labels and icons for consistency with design.
2026-02-05 16:56:27 +08:00
yyh
2df0d540a9 fix: remove unreachable polling from artifacts-section
The Skill view is locked (ViewPicker disabled) while a workflow
is running or chatflow is responding, so ArtifactsSection is never
mounted during runs. Polling there is dead code.
2026-02-04 17:31:44 +08:00
yyh
d0200e90d2 feat: poll sandbox files every 5s during workflow/chatflow runs
Add conditional refetchInterval to Artifacts components so the file
list refreshes automatically while a workflow debug run or chatflow
preview is in progress, stopping once the run completes.
2026-02-04 16:59:09 +08:00
yyh
178421a8ac fix: pass appId instead of userId to sandbox file API calls
The backend route /apps/{app_id}/sandbox/files expects the actual app ID
as the URL parameter and derives sandbox_id from the logged-in user
internally. The frontend was incorrectly passing userProfile.id (user ID)
as the appId, resulting in wrong storage paths.
2026-02-03 17:59:21 +08:00
yyh
561f383cbc Revert "refactor(skill): replace React icon components with CSS Icons"
This reverts commit 919d7ef5cd.
2026-01-30 12:42:20 +08:00
zhsama
1a51f52061 Merge remote-tracking branch 'origin/feat/support-agent-sandbox' into feat/support-agent-sandbox 2026-01-29 23:53:34 +08:00
yyh
919d7ef5cd refactor(skill): replace React icon components with CSS Icons
Migrate all icon usage in the skill directory from @remixicon/react
and custom SVG components to Tailwind CSS icon classes (i-ri-*, i-custom-*).
Update MenuItem API to accept string class names instead of React.ElementType.
2026-01-29 21:57:17 +08:00
yyh
ff71816373 refactor: use query data for selected file download, keep mutation for tree downloads
The toolbar download button now uses the already-fetched download URL
from useQuery (zero extra requests), while tree node downloads keep
using useMutation with React Query-managed isPending state instead of
a hand-rolled useState wrapper.
2026-01-29 20:48:58 +08:00
yyh
92731bffba feat: add ArtifactSlice and integrate artifact preview into skill editor tabs
Introduce a dedicated Zustand ArtifactSlice to manage artifact selection
state with mutual exclusion against the main file tree. Artifact files
from the sandbox can now be opened as tabs in the skill editor, rendered
via a lightweight ArtifactContentPanel that reuses ReadOnlyFilePreview.
2026-01-29 17:52:41 +08:00
yyh
5c91311077 fix: use downloadUrl utility instead of window.open for file downloads
Replace window.open with downloadUrl from utils/download to trigger
proper file downloads instead of opening files in a new browser tab.
2026-01-29 17:05:01 +08:00
hjlarry
079484d21c feat: sync file tree 2026-01-29 16:33:33 +08:00
yyh
bacc5c32f5 feat(portal): add useContextMenuFloating hook for coordinate-based context menus
Replace useClickAway + fixed positioning in file tree context menu with
a floating-ui based hook that provides collision detection (flip/shift),
ARIA role="menu", Escape/outside-click dismiss, and scroll dismiss via
passive capture listener with ref-stabilized callback.
2026-01-29 14:01:36 +08:00
yyh
8326b9e3e5 refactor(skill): remove React.FC type annotations from all components
Replace FC<Props> pattern with direct props typing in function parameters
for better TypeScript inference and modern React best practices.
2026-01-28 23:34:08 +08:00
yyh
fb78a4450d feat: implement node reordering functionality in file tree component 2026-01-28 19:38:41 +08:00
yyh
3c7f641f60 fix(skill): remove non-functional copy menu item from file tree context menu 2026-01-28 16:34:57 +08:00
yyh
000bdf6bc0 style: uploading state for upload folder 2026-01-28 16:34:57 +08:00
yyh
a784121070 fix(skill): align upload tooltip with Figma design
Replace animated pulse background with static progress bar using
design tokens and increase upload icon to 24px.
2026-01-28 15:58:49 +08:00
yyh
543802cc65 feat(skill): add three-state upload progress tooltip
Replace simple uploading/success indicator with a full three-state
tooltip (uploading, success, partial_error) that overlays the DropTip
position. Add upload slice to skill editor store and wire progress
tracking into file/folder upload operations.
2026-01-28 15:52:08 +08:00
yyh
ab52550abe feat(sandbox): use extension field for file icon type mapping
Enhance getFileIconType to accept an extension parameter and cover all
13 FileAppearanceTypeEnum types using an O(1) Map lookup. Update all
call sites to pass the API-provided extension for accurate icon display.
2026-01-27 16:21:03 +08:00
yyh
d098e72c13 feat(variable-inspect): add Artifacts tab with sandbox file tree browser
Refactor the variable inspect panel into a tabbed layout with Variables
and Artifacts tabs. Extract variable logic into VariablesTab, add new
ArtifactsTab with sandbox file tree selection and preview pane, and
improve accessibility across tree nodes and interactive elements.
2026-01-27 15:05:11 +08:00
yyh
bf12445960 fix(workflow): make FileTree and ArtifactsSection scroll independently
The sidebar layout was broken when ArtifactsSection expanded - it would
squeeze the FileTree and neither area could scroll. This restructures the
layout so each section has its own scroll container with proper height
constraints.
2026-01-27 00:14:33 +08:00
yyh
2c02c8ac18 fix(sandbox): fetch artifacts on mount for blue dot indicator
Remove enabled condition so data is fetched when component mounts,
allowing blue dot to show when files exist even before expanding.
TanStack Query handles request deduplication automatically.
2026-01-26 16:53:16 +08:00
yyh
e5e43bc2b9 fix(sandbox): fix guide line offset and use spinner for loading
- Adjust TreeGuideLines lineOffset to 2 to center lines under folder icons
- Replace skeleton loading with spinner in header area
2026-01-26 16:37:51 +08:00
yyh
70d88bc522 refactor(sandbox): align artifacts tree with file tree styles
Reuse TreeGuideLines for indent lines, use FileTypeIcon for file icons,
and match folder open/close icons with the main file tree component.
2026-01-26 16:19:28 +08:00
yyh
765b548be4 fix(a11y): improve accessibility for artifacts tree
Add aria-label, aria-expanded attributes and focus-visible styles
for folder buttons. Hide loading skeleton from assistive tech.
2026-01-26 16:01:22 +08:00
yyh
d396d92059 feat(sandbox): implement artifacts section UI
- Replace placeholder with functional ArtifactsSection component
- Add ArtifactsTree component for file tree rendering
- Support expand/collapse with lazy loading
- Show blue dot indicator when collapsed with files
- Add empty state card with hint text
- Add download button on file hover
- Add i18n translations (en-US, zh-Hans)
2026-01-26 15:43:06 +08:00
yyh
98a050e664 chore: support folder upload in root file tree 2026-01-23 21:17:49 +08:00
yyh
c4714d757d style(file-tree): node menu item 2026-01-23 15:49:11 +08:00
yyh
45a76fa90b fix: improve accessibility for file-tree components
- Convert clickable div to semantic button in artifacts-section
- Add aria-hidden to decorative icons
- Add aria-label to rename inputs and hidden file inputs
- Add i18n keys for artifacts section and rename labels
- Support ignore file extensions (.gitignore, etc.)
2026-01-21 15:13:50 +08:00
yyh
0092254007 Revert "refactor(web): remove redundant useUnifiedDrag abstraction layer"
This reverts commit ee91c9d5f1.
2026-01-20 18:09:25 +08:00
yyh
ee91c9d5f1 refactor(web): remove redundant useUnifiedDrag abstraction layer
Simplify file drop hooks by removing the unnecessary useUnifiedDrag
wrapper that became redundant after internal node drag was migrated
to react-arborist's built-in system. Now useFolderFileDrop and
useRootFileDrop directly use useFileDrop, reducing code complexity
and eliminating unused treeChildren prop drilling.
2026-01-20 18:09:08 +08:00
yyh
2151676db1 refactor: use react-arborist built-in drag for internal node moves
Switch from native HTML5 drag to react-arborist's built-in drag system
for internal node drag-and-drop. The HTML5Backend used by react-arborist
was intercepting dragstart events, preventing native drag from working.

- Add onMove callback and disableDrop validation to Tree component
- Sync react-arborist drag state (isDragging, willReceiveDrop) to Zustand
- Simplify use-node-move to only handle API execution
- Update use-unified-drag to only handle external file uploads
- External file drops continue to work via native HTML5 events
2026-01-20 18:09:08 +08:00
yyh
dc9658b003 perf(web): avoid per-node tree query subscription 2026-01-20 18:09:08 +08:00
yyh
b527921f3f feat: unified drag-and-drop for skill file tree
Implement unified drag system that supports both internal node moves
and external file uploads with consistent UI feedback. Uses native
HTML5 drag API with shared visual states (isDragOver, isBlinking,
DragActionTooltip showing 'Move to' or 'Upload to').
2026-01-20 18:09:08 +08:00
yyh
cf5e8491df chore: optimize code quality and performance 2026-01-20 15:54:31 +08:00
yyh
53f828f00e feat: paste operation for skill file tree 2026-01-20 15:42:53 +08:00
yyh
357489d444 feat: multi select for file tree & clipboard support 2026-01-20 15:42:53 +08:00