-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1014): implement text file editor for NEO File Explorer #4966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
1 similar comment
|
|
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟡 | Statements | 62.41% (-1.09% 🔻) |
259/415 |
| 🔴 | Branches | 41.83% (-0.47% 🔻) |
151/361 |
| 🔴 | Functions | 48.94% (-1.06% 🔻) |
46/94 |
| 🟡 | Lines | 64.01% (-1.14% 🔻) |
233/364 |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟡 | helper/index.ts | 61.01% (-2.88% 🔻) |
43.75% (-1.12% 🔻) |
53.33% (-3.81% 🔻) |
64.06% (-3.46% 🔻) |
Test suite run success
186 tests passing in 9 suites.
Report generated by 🧪jest coverage report action from db0061c
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.9% (-0.02% 🔻) |
589/12026 |
| 🔴 | Branches | 4.46% (-0.02% 🔻) |
377/8462 |
| 🔴 | Functions | 2.74% (-0.01% 🔻) |
101/3687 |
| 🔴 | Lines | 4.73% (-0.01% 🔻) |
555/11744 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🔴 | ... / TextFileEditorModal.tsx |
0% | 0% | 0% | 0% |
Test suite run success
173 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from db0061c
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34bddf9 to
2029a95
Compare
|
This PR continues the work from #4943, which was closed during Jira issue number correction (FR-1869 → FR-1014). @nowgnuesLee Could you please tag Copilot as a reviewer? The previous Copilot review comments on #4943 were very helpful and we'd like to continue addressing them here. |
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Show resolved
Hide resolved
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Outdated
Show resolved
Hide resolved
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Show resolved
Hide resolved
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Outdated
Show resolved
Hide resolved
…ions - Replace useEffect-based file loading with useTanQuery - Replace manual save handling with useTanMutation - Add useErrorMessageResolver for standardized error handling - Replace Button with BAIButton in FileItemControls - Add Tooltip to More options dropdown button - Replace Typography.Text with BAIText - Replace Alert with BAIAlert - Make onRequestClose success parameter optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I edit one file, the editor shows the changes made to other files. And I think it would be good to include the text file editing feature in the BUI. What do you think?
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Show resolved
Hide resolved
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Show resolved
Hide resolved
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Outdated
Show resolved
Hide resolved
packages/backend.ai-ui/src/components/baiClient/FileExplorer/FileItemControls.tsx
Outdated
Show resolved
Hide resolved
…anagement - Use BAIButton action prop for automatic loading state in download button - Replace isEdited state with null-check pattern for cleaner content tracking - Add user-friendly error messages with BAILogger for detailed error logging - Add FailedToLoadFileDescription i18n key for all 21 supported languages - Replace useMutation with useTanMutation for consistency - Remove unnecessary Tooltip wrapper from more options dropdown
- Add tooltip to explain why file editing is disabled for unsupported formats - Show tooltip when file is a directory or not a text file - Add UnsupportedFileFormat i18n key to all 21 locale files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screen.Recording.Jan.9.2026.from.Graphite.mov
When I edit the text file, the file browser is closed and frozen. I cannot re-open the file browser before refreshing. I made the text file by this way.
- In the terminal,
touch test.txt - Add some contents
- Upload that file
This issue has been fixed in commit fc42770. The problem was that the getLanguageFromExtension function was returning raw file extensions (like txt, md, py) directly to CodeMirror, but CodeMirror doesn't recognize these as valid language names. This caused CodeMirror to fail when trying to load syntax highlighting, which froze the file browser. The fix includes: Created a proper extensionToLanguageMap that maps file extensions to valid CodeMirror language names (e.g., txt → markdown, py → python, sh → shell) |
Resolves #3686 (FR-1014)
Summary
Implement the ability to directly edit and save simple text files within the NEO File Explorer.
Background
Users frequently need to modify configuration files such as yaml, toml, and json within vfolders for model serving. Currently, this requires downloading the file → editing locally → re-uploading, which results in a poor user experience.
Implementation
Key Features
Components Added
TextFileEditorModal.tsx: Main editor modal with BAICodeEditorFileItemControls.tsx: Added More menu with Edit optionBAIFileExplorer.tsx: AddedenableEditandonClickEditFilepropsFolderExplorerModal.tsx: Integration with TextFileEditorModalTechnical Details
request_download_token→fetch→blob.text()new File()→FileUploadManager.uploadFiles()(overwrites)write_contentpermissionbaiClient._config.maxFileUploadSizei18n Support
comp:FileExplorer.EditFile: "Edit"data.explorer.EditFile: "Edit File"Checklist:
write_contentpermission on vfoldertest
2026-01-09.5.48.50.mov