From 2006a0a0892a59489bd51a961caac45a561bf3d8 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Wed, 24 Sep 2025 07:52:29 +0800 Subject: [PATCH] FIX: Replace all text editors with unified CodeMirror interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit enhances the user experience by standardizing all text editing components to use CodeMirror, providing consistent functionality across the entire application. **Text Editor Unification**: - Replaced all textarea elements with CodeMirror editors - Unified syntax highlighting and line numbering across all text inputs - Consistent oneDark theme implementation throughout the application **Fixed Components**: - FileViewer: Enhanced file editing with syntax highlighting for all file types - CredentialEditor: Improved SSH key editing experience with code editor features - HostManagerEditor: Better SSH private key input with proper formatting - FileManagerGrid: Fixed new file/folder creation in empty directories **Key Technical Improvements**: - Fixed oneDark theme import path from @uiw/codemirror-themes to @codemirror/theme-one-dark - Enhanced createIntent rendering logic to work properly in empty directories - Added automatic createIntent cleanup when navigating between directories - Configured consistent basicSetup options across all editors **User Experience Enhancements**: - Professional code editing interface for all text inputs - Line numbers and syntax highlighting for better readability - Consistent keyboard shortcuts and editing behavior - Improved accessibility and user interaction patterns Users now enjoy a unified, professional editing experience whether working with code files, configuration files, or SSH credentials. The interface is consistent, feature-rich, and optimized for developer workflows. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../Apps/Credentials/CredentialEditor.tsx | 48 +++++++++++++------ .../Apps/File Manager/FileManagerGrid.tsx | 4 +- .../Apps/File Manager/FileManagerModern.tsx | 26 ++++++---- .../File Manager/components/FileViewer.tsx | 26 +++++++--- .../Apps/Host Manager/HostManagerEditor.tsx | 24 ++++++---- 5 files changed, 91 insertions(+), 37 deletions(-) diff --git a/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx b/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx index fbd8c404..cedef336 100644 --- a/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx +++ b/src/ui/Desktop/Apps/Credentials/CredentialEditor.tsx @@ -28,6 +28,8 @@ import { generateKeyPair, } from "@/ui/main-axios"; import { useTranslation } from "react-i18next"; +import CodeMirror from "@uiw/react-codemirror"; +import { oneDark } from "@codemirror/theme-one-dark"; import type { Credential, CredentialEditorProps, @@ -908,23 +910,31 @@ export function CredentialEditor({ -