Commit Graph
277 Commits
Author SHA1 Message Date
lly 93fa27b54a merge: update SSH reconnect branch with upstream main 2026-09-03 17:02:47 +08:00
lly 0faa75dc0f fix(terminal): harden SSH reconnect cwd restoration 2026-09-03 16:36:44 +08:00
Kang 2c77b77e90 style(codeMirror): update search panel styling to use theme colors (#558)
- Enhanced the styling of the CodeMirror search panel by removing the light button gradient and implementing theme colors for buttons and inputs.
- Added focus ring and checkbox accent styles to improve accessibility and visual consistency.
- Updated tests to verify the new styling rules for the search panel.
2026-09-03 10:29:20 +08:00
lly b97f759f25 fix(terminal): harden reconnect cwd restore per review 2026-09-03 09:49:31 +08:00
Kang 7c8f9cf424 fix(file-drop): replace isDropPositionInsideElement with isDropPositionTopmostWithinElement for improved drop target detection
- Updated the file drop logic in both useExternalFileDrop and useTerminalFileDrop hooks to utilize isDropPositionTopmostWithinElement, enhancing accuracy in determining if a drop event occurs over the intended target.
- Added unit tests for the new isDropPositionTopmostWithinElement function to ensure correct behavior in various scenarios, including covered elements and position validation.
2026-09-02 19:31:00 +08:00
lly 8878f0a71e feat(terminal): restore last working directory on SSH reconnect 2026-09-02 16:33:58 +08:00
Kang 3685459dd1 feat(ai): enhance AI stream control event handling and add localization for MCP errors
- Introduced `classifyAIStreamControlEvent` to categorize AI stream events as "warning", "done", or "error", improving event management.
- Updated `AIAssistantPanel` to handle new event types, displaying appropriate warnings and error messages based on the event kind.
- Added localization for external agent MCP fallback and startup errors in multiple languages.
- Created tests for the new event classification logic and ensured proper handling of localized error messages.
2026-09-02 16:22:23 +08:00
Kang 688bbfd615 Merge upstream main into PR #521 2026-09-02 00:49:05 +08:00
Kang 468c1d4902 Merge pull request #537 from agogo233/feat/context-menu-quick-command
feat: add context menu action to save terminal selection as quick com…右键菜单支持将终端选中内容保存为快捷命令
2026-09-02 00:10:53 +08:00
lly 5c379d61b8 feat(editor): support Ctrl+wheel font zoom in builtin file editor 2026-09-01 19:10:32 +08:00
Kang 576d1899d5 feat(mcp): implement MCP session open request handling and permission modes
- Added support for handling MCP session open requests, including the ability to respond to session creation with success or error messages.
- Introduced new permission modes for AI interactions, including "full_access", and updated the permission handling logic to accommodate these changes.
- Refactored the AiPermissionSelect component to manage permission modes more effectively and added corresponding tests to ensure functionality.
- Updated translations for new permission modes and improved the UI to reflect changes in session handling.
2026-08-31 21:12:30 +08:00
agogo233 1c115b2463 feat: add context menu action to save terminal selection as quick command 2026-08-31 09:01:16 +00:00
Kang aa695182a2 Merge pull request #533 from llyVictory/fix/editor-selection-terminal-color
fix(editor): 内置文件编辑器选区复用终端选区颜色
2026-08-31 14:43:05 +08:00
Kang 93c5aeaa3e perf(terminal): add tests and enhancements for terminal refresh effects and keyword highlighting
- Introduced unit tests for the `useTerminalRefreshEffects` hook to validate terminal repainting behavior and texture invalidation on DPI scale changes.
- Updated the `useTerminalRefreshEffects` hook to prevent unnecessary texture atlas clearing during active terminal refreshes.
- Added a new `shouldSuspendKeywordHighlighter` function to manage keyword highlighting based on terminal visibility and performance mode, with corresponding tests to ensure correct behavior.
- Enhanced the `useKeywordHighlighter` hook to support session-specific keyword highlighting and cache management.
- Refactored performance configurations for keyword highlighting to optimize refresh rates and decoration limits.
2026-08-31 11:49:06 +08:00
lly 5f5a456284 fix(editor): reuse terminal selection color in builtin file editor
The builtin file editor rendered selections in a pale white that
obscured file content, unlike the terminal.

- Publish the terminal theme's selectionBackground as the
  --df-terminal-selection CSS variable and use it (with !important)
  for .cm-selectionBackground, so the editor selection matches the
  terminal selection color instead of CodeMirror's #d7d4f0 default.
- Move the .cm-activeLine highlight onto a ::before pseudo-element
  with z-index -3 (below the selection layer at -2) and clear the
  element background, so the active line highlight no longer washes
  out the selection on the cursor line (visible when selecting
  upwards, where the top line holds the cursor).

Add regression tests for the published CSS variable and the compiled
selection/active-line rules.
2026-08-31 11:15:32 +08:00
Kang 877a970e03 feat(interaction): implement terminal right-click action settings (#530)
- Introduced a new setting for terminal right-click actions, allowing users to choose between "none", "menu", and "paste" options.
- Updated the InteractionTab component to include a tabbed interface for selecting the right-click action.
- Refactored the TerminalContextMenu to handle the new right-click action logic, ensuring appropriate behavior based on user selection.
- Added tests for the terminal right-click action functionality to validate expected behaviors and interactions.
- Migrated legacy right-click paste settings to the new terminal right-click action configuration.
2026-08-30 21:44:01 +08:00
mengshouer 1d18807b8e feat: add dynamic terminal tab titles 2026-08-29 02:28:53 +08:00
Kang b51501988e feat(asset-monitoring): enhance asset monitoring patch handling and session validation (#512)
- Updated the `handleAssetMonitoringPatch` function to accept both source and target session IDs, ensuring patches are only recorded when they match.
- Improved the asset monitoring cache management by adding validation for session ownership, preventing mismatched session data from being retained.
- Refactored related hooks (`useRemoteGpuOverview`, `useRemoteNpuOverview`, and `useRemoteStats`) to align with the new session validation logic.
- Introduced unit tests for asset monitoring functionality, ensuring robust handling of session changes and patch recording.
2026-08-28 14:36:05 +08:00
Kang 3be20a6bb0 feat(mcp): MCP (#226)
- Added the McpApprovalHost component to handle external MCP approval requests, enhancing user interaction with external tools.
- Updated the App component to include the McpApprovalHost, ensuring it is rendered within the application layout.
- Introduced external MCP settings in the AiTab component, allowing users to configure MCP options such as enabling/disabling and permission modes.
- Implemented state management for MCP runtime status and client configurations, improving the overall functionality and user experience.
- Added default settings for external MCP in the AI settings module, ensuring a consistent initial configuration.
2026-08-27 23:35:51 +08:00
Kang 5c3a24a320 perf(terminal): implement OutputAckCoordinator for managing output acknowledgments
- Introduced the OutputAckCoordinator class to handle acknowledgment of output bytes in terminal sessions, allowing for better management of session state and error handling.
- Added comprehensive unit tests to validate the functionality of the OutputAckCoordinator, including scenarios for ACK handling, failure requeuing, and backoff strategies.
- Updated XTerminal and xterminalOutputController to integrate the new OutputAckCoordinator, enhancing output management capabilities.
- Refactored session command handling to utilize session_command_channel for improved command processing.
2026-08-27 19:30:52 +08:00
Kang b5ef14de1c style(backgroundImage): update terminal surface background handling for transparency
- Modified the terminal surface background variable to use "var(--df-bg-terminal)" instead of "transparent" for improved consistency with background image settings.
- Updated the test description to clarify the behavior of background-image transparency in xterm and terminal wrappers.
2026-08-25 12:12:07 +08:00
Kang f65b0b8a50 perf(terminal): refactor event listener management and introduce async unlisten bag (#486)
- Replaced the previous unlistener array with an `asyncUnlistenBag` for better management of event listeners in the XTerminal component.
- Updated the setup of wake listeners to utilize the new unlisten bag, improving code clarity and efficiency.
- Added a new utility for handling asynchronous unlisten operations, ensuring proper cleanup of listeners.
- Introduced tests for the async unlisten bag to validate its functionality and reliability.
2026-08-24 09:19:17 +08:00
Kang e7a2daa3fa feat(session): implement external local session handling and working directory validation (#487)
- Added `createExternalLocalSession` function to facilitate the creation of local terminal sessions with specified working directories.
- Introduced `connectExternalLocalSession` in the `App` component to manage external local session connections.
- Enhanced `extract_external_open_urls` to support local session requests with optional working directory arguments.
- Updated `create_local_session` to handle explicit working directory inputs and validate their existence before session creation.
- Added tests for local session handling, including scenarios for missing directories and explicit working directory overrides.
- Improved `LocalSessionConfig` to include a flag for handling missing working directories during session initialization.
2026-08-24 01:22:14 +08:00
Kang 7b09cfc152 feat(editor): implement file editor open mode resolution and internal editor display settings
- Added new functions `resolveFileEditorOpenTarget` and `resolveInternalEditorDisplay` to determine the appropriate editor mode based on user settings.
- Introduced a test suite for the file editor open mode to validate the new resolution logic.
- Updated the `FileExplorer` component to utilize the new editor resolution functions, enhancing file handling capabilities.
- Modified the `TransferTab` and context providers to include `internal_editor_display` settings, defaulting to "workspace".
- Enhanced type definitions to support the new editor settings and ensure type safety across components.
2026-08-24 01:14:10 +08:00
Kang 16247d0581 feat(floating-panels): implement floating panel functionality and state management (#448)
- Introduced a new `FloatingPanel` component to support left and right floating panels, enhancing the user interface for better panel management.
- Added state management for floating panels in the `App` component, allowing users to open, close, and move panels between sides.
- Implemented logic to handle panel open modes, enabling users to switch between docked and floating modes seamlessly.
- Updated the `ActivityBar` and `AppLayout` components to integrate floating panel features, including context menu options for toggling panel modes.
- Enhanced tests to cover new floating panel functionalities and ensure robust behavior across different scenarios.
2026-08-24 00:27:05 +08:00
Kang f54597f049 feat(activity-bar): enhance activity bar management with reset and visibility features
- Introduced new components for managing activity bar overlays, including `ActivityBarResetDialog` and `AppOverlayDialogs`.
- Added functionality to hide and show activity bar items, improving user control over the interface.
- Implemented reset layout functionality for the activity bar, allowing users to restore default settings.
- Updated the `ActivityBar` component to support hidden items and context menu interactions for better usability.
- Refactored related hooks and context providers to manage activity bar state effectively.
- Enhanced tests to cover new features and ensure robust functionality.
2026-08-23 23:22:35 +08:00
Kang b2b33a1d08 feat(ssh): introduce SSH runtime mode handling in connection management (#410)
- Added support for SSH runtime modes ("standard" and "terminal") across various components, including session creation and external connection parsing.
- Updated the `ExternalOpenIntent` and related types to include runtime mode specifications.
- Enhanced the temporary link parsing to handle runtime modes, ensuring proper configuration for SSH connections.
- Implemented tests to validate runtime mode functionality and its integration with existing features.
- Refactored relevant functions to accommodate the new runtime mode logic, improving overall connection management.
2026-08-23 22:22:56 +08:00
Kang 642a483bc9 feat(terminal): implement foreground frame fallback handling and related tests (#479)
- Added support for foreground frame fallback in the TerminalOutputDrain class to manage scenarios where animation frames are starved.
- Introduced a new interface, TerminalOutputForegroundFrameFallbackStats, to encapsulate statistics related to foreground fallbacks.
- Enhanced the onForegroundFrameFallback callback to provide detailed logging of fallback events.
- Implemented tests to validate the behavior of foreground frame fallback, including scenarios for cancellation and sustained backlog draining.
- Updated performance configuration to define the fallback delay for foreground operations.
2026-08-23 19:17:18 +08:00
Kang 9da9b6f477 feat(childWindowLifecycle): enhance lifecycle management and testing for child windows (#483)
- Added new utility functions to improve shell readiness checks, including `hasMountedShell` and `hasLayoutableShell`.
- Updated lifecycle emission logic to ensure proper handling of shell readiness based on layout conditions.
- Introduced comprehensive tests for shell readiness scenarios, including fallback handling and polling until the shell mounts.
- Improved test setup with real timers and manual animation frame management for better simulation of lifecycle events.
2026-08-23 16:16:31 +08:00
Kang d04eff32bb feat(aiSettings): introduce API format selection for AI provider credentials (#455)
- Added support for selecting API formats in the AI settings, specifically for OpenAI and compatible providers.
- Implemented a new `supportsApiFormatSelection` function to determine if a provider allows API format selection.
- Updated the `AiProviderCredential` type to include an `api_format` field, defaulting to "chat_completions".
- Enhanced the UI to allow users to select between "chat_completions" and "responses" formats when configuring credentials.
- Updated schema version to 6 to reflect changes in the settings structure.
- Added tests to ensure proper handling of API format defaults and selection logic.
2026-08-23 16:00:15 +08:00
Kang 511d54a880 feat(terminal): enhance background drain handling and add related tests
- Introduced a new interface `TerminalOutputBackgroundDrainStats` to encapsulate background drain statistics.
- Updated the `onBackgroundDrain` callback to utilize the new stats interface, improving data handling during background operations.
- Enhanced the `TerminalOutputDrain` class to manage background catch-up logic and scheduling more effectively.
- Added multiple tests to validate the behavior of background draining under various conditions, including catch-up scenarios and mode transitions.
- Refactored the hibernation controller to track output activity and prevent premature hibernation based on recent output events.
2026-08-22 16:17:00 +08:00
Kang dea1b11305 feat(terminal): enhance terminal surface background handling and add tests (#485)
- Introduced a new CSS variable `--df-terminal-surface-bg` to manage terminal surface backgrounds more effectively.
- Updated various components to utilize the new background variable, ensuring consistent styling across the terminal interface.
- Added tests for the terminal surface background variables to validate behavior under different appearance settings, including transparency and custom themes.
- Refactored the `installRemoteColorOscGuard` function to support blocking default background OSCs based on session type and options.
2026-08-22 12:36:38 +08:00
Kang 7236e88878 feat(aiSettings): update Ollama provider base URL and add tests for default settings (#469)
- Changed the default base URL for the Ollama provider from the v1 path to the root URL.
- Added tests to ensure the Ollama provider uses the correct base URL and migrates legacy URLs appropriately.
- Introduced helper functions to manage Ollama provider settings and ensure compatibility with legacy configurations.
2026-08-20 23:27:08 +08:00
Kang 6d7450158c feat(webview): add hard reload shortcut handling in webviewReloadGuard
- Introduced a new function to detect hard reload shortcuts (Ctrl/Cmd + Shift + R) and prevent default behavior when triggered inside the terminal.
- Updated the preventReservedWebviewShortcut function to handle hard reloads separately from other reserved shortcuts, enhancing user experience in terminal contexts.
2026-08-19 12:15:02 +08:00
Kang 5fd84b37df refactor: add AppOverlayDialogs component and related hooks for session management
- Implemented AppOverlayDialogs component to manage various overlay dialogs including session quick switcher, temporary SSH link, external connection match, unsaved changes, and post-login confirmation.
- Created useFileDocumentCloseGuard hook to handle file document close requests, including saving and discarding unsaved changes.
- Developed useSessionRuntimeState hook to manage session recording statuses and live session information.
- Introduced appExternalDialogs module to define types for external connection choices and dialog states.
- Added appSessionFactory module to handle session creation logic for different connection types.
- Implemented appWorkspaceClose module to manage pending file document closures and tab management.
2026-08-19 00:53:20 +08:00
Kang 9ff4685c4e feat(send-command-panel): add support for "allWindows" target in session selection 2026-08-19 00:10:15 +08:00
Kang 44129a3924 feat(zmodem): enhance upload error handling and conflict resolution
- Introduced a new function `getUploadFailureDescription` to provide user-friendly error messages for upload failures.
- Updated `failPendingZmodemUpload` to accept an options parameter for UI handling, improving error management.
- Implemented `isZmodemUploadErrorHandled` to check if upload errors have been addressed in the UI.
- Enhanced the `handleTerminalFileDrop` function to conditionally display error messages based on upload error handling.
- Added tests for Zmodem upload behavior, including handling of skipped files and overwrite conflicts.
2026-08-18 11:22:40 +08:00
Kang 4fa8b2b212 refactor: improve child window loading experience and enhance file handling
- Removed the `signalChildWindowReady` function and replaced it with a loading shell in `ChildWindowRouter` to provide a better user experience during loading.
- Updated `FolderDialog` to prevent multiple submissions when pressing Enter and clicking Save simultaneously.
- Enhanced file handling in `FileDocumentEditor` and related components by adding `contentHash` and `mtimeNanos` properties for better file state management.
- Added tests for new functionality in `FolderDialog` and `FileDocumentEditor` to ensure reliability.
- Introduced `AlternateScreenStateTracker` and `Dec2026FrameGate` for improved terminal handling and performance metrics.
2026-08-16 14:45:10 +08:00
Kang 325d07905c feat(child-window): enhance command queue with failure handling and recovery
- Updated `ChildWindowCommandQueue` to manage command states using a status system (`loading`, `ready`, `failed`) instead of a boolean flag.
- Implemented methods to mark commands as failed, drop queued commands, and recover from failed states when new tokens are registered.
- Added tests to verify the behavior of failure handling and recovery scenarios in the command queue.
- Enhanced `windowManager` to close failed child windows and clear their lifecycle appropriately.
2026-08-15 15:39:22 +08:00
litcc 8595375488 perf(window): streamline child window startup
Split the main app provider from the lightweight child context, reveal child windows after a stable shell is rendered, and queue commands until listeners are ready.
2026-08-14 22:04:40 +08:00
litcc 44763a00b2 Merge remote-tracking branch 'upstream/main' into perf/window 2026-08-14 16:31:52 +08:00
litcc a3393fb998 perf(window): optimize child startup and macOS title bar alignment 2026-08-14 16:09:07 +08:00
Kang 8b90294294 Merge https://github.com/nyakang/nyaterm 2026-08-14 16:08:29 +08:00
Kang 83b8ca713b perf(terminal): implement alternate screen state tracking and output scheduling
- Added `AlternateScreenStateTracker` to manage and detect alternate screen states in terminal output.
- Introduced `TerminalOutputScheduler` to optimize write chunk sizes and manage foreground delays based on screen state.
- Enhanced `TerminalOutputDrain` to support low-latency flushing and improved performance during foreground operations.
- Added comprehensive tests for both the alternate screen state tracker and output scheduling functionalities.
- Updated `XTerminal` to integrate the new tracking and scheduling logic, ensuring consistent behavior across terminal operations.
2026-08-14 15:04:56 +08:00
llyVictory 7de86ac05f Merge branch 'nyakang:main' into fix/native-file-editor-followup 2026-08-14 10:31:39 +08:00
lly 702c8e412a test(workspace): 补充工作区与会话生命周期回归测试 2026-08-13 18:11:55 +08:00
lly d8094cd813 test(file-editor): 补充文件编辑与未保存提示回归测试 2026-08-13 18:11:54 +08:00
lly 5ac405652a feat(file-editor): 实现文件文档编辑与安全关闭流程 2026-08-13 18:11:54 +08:00
litcc 6ecc011b57 Merge remote-tracking branch 'upstream/main' into feat/agent-forward-config
# Conflicts:
#	src-tauri/src/cmd/connection.rs
#	src-tauri/src/config/connection.rs
#	src-tauri/src/config/mod.rs
2026-08-13 17:44:08 +08:00
litcc a4792c023b feat(ssh): add configurable SSH Agent forwarding
- decouple authentication endpoints from forwarding configuration
- support multiple external Agent endpoints and NyaTerm stored keys
- add shared fingerprint allowlist and AllowAll policies
- add Agent broker with protocol limits, signing controls, timeouts, and key-change invalidation
- migrate legacy Agent forwarding settings
- update runtime IPC, import/snapshot handling, UI, i18n, documentation, tests
2026-08-13 17:27:03 +08:00