feat: harden local shell, SFTP, and desktop session reliability
Finder-launched terminals now inherit a login PATH so tools like ollama resolve, destructive SFTP/editor actions require confirmation, and terminal search plus window dragging work again. SSH forwards and RDP sessions keep listeners and survive reconnect without FastPath crashes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
188f3556ed
commit
08696896f9
223 files changed
+13493
-3423
No files matched your search
+52
-31
@@ -5,6 +5,8 @@
|
||||
* - 仅使用 data-tauri-drag-region 处理拖拽和双击缩放
|
||||
* - 不叠加 CSS app-region 或 React 双击处理,避免一次双击切换两次
|
||||
* - 标签栏空白区也由 Tauri 原生拖拽区处理
|
||||
*
|
||||
* RDP/VNC 全屏时只隐藏 chrome,保持 TabContent 挂载,避免会话 remount 立刻退出全屏。
|
||||
*/
|
||||
|
||||
import type { ReactNode } from 'react'
|
||||
@@ -15,7 +17,9 @@ import TabBar from '../components/layout/TabBar'
|
||||
import TabContent from '../components/layout/TabContent'
|
||||
import StatusBar from '../components/layout/StatusBar'
|
||||
import type { Session } from '../stores'
|
||||
import { useDesktopFullscreenStore } from '../stores/desktopFullscreenStore'
|
||||
import { getDesktopPlatform } from '../platform/runtime'
|
||||
import { startWindowDragging } from '../platform/tauri'
|
||||
|
||||
export interface AppShellProps {
|
||||
activeTabId: string | null
|
||||
@@ -42,7 +46,11 @@ function TitleBar() {
|
||||
return (
|
||||
<header
|
||||
data-tauri-drag-region
|
||||
className="bg-dark-900/95 flex h-10 flex-shrink-0 select-none items-center border-b border-dark-800"
|
||||
onMouseDown={(event) => {
|
||||
if (event.button !== 0) return
|
||||
void startWindowDragging()
|
||||
}}
|
||||
className="relative z-20 bg-dark-900/95 flex h-10 flex-shrink-0 select-none items-center border-b border-dark-800"
|
||||
>
|
||||
<div data-tauri-drag-region className="h-full w-[78px] flex-shrink-0" aria-hidden />
|
||||
<div data-tauri-drag-region className="flex h-full min-w-0 flex-1 items-center justify-center px-2" />
|
||||
@@ -114,13 +122,18 @@ export default function AppShell({
|
||||
}
|
||||
|
||||
const desktopSidebarHidden = !isMobile && sidebarCollapsed
|
||||
const desktopFullscreen = useDesktopFullscreenStore((state) => state.active)
|
||||
|
||||
return (
|
||||
<div className="flex h-screen flex-col overflow-hidden bg-dark-900 text-content-primary">
|
||||
<TitleBar />
|
||||
<div
|
||||
className={`flex h-screen flex-col overflow-hidden text-content-primary ${
|
||||
desktopFullscreen ? 'bg-black' : 'bg-dark-900'
|
||||
}`}
|
||||
>
|
||||
{!desktopFullscreen && <TitleBar />}
|
||||
|
||||
<div className="flex min-h-0 flex-1 overflow-hidden">
|
||||
{isMobile && mobileSidebarOpen && (
|
||||
{!desktopFullscreen && isMobile && mobileSidebarOpen && (
|
||||
<div
|
||||
className="titlebar-no-drag fixed inset-0 z-40 bg-black/50 transition-opacity duration-300"
|
||||
onClick={onCloseMobileSidebar}
|
||||
@@ -128,32 +141,38 @@ export default function AppShell({
|
||||
/>
|
||||
)}
|
||||
|
||||
<aside
|
||||
className={`titlebar-no-drag h-full flex-shrink-0 transition-[width,transform] duration-200 ease-in-out ${
|
||||
isMobile
|
||||
? `fixed inset-y-0 left-0 top-10 z-50 ${mobileSidebarOpen ? 'translate-x-0' : '-translate-x-full'}`
|
||||
: desktopSidebarHidden
|
||||
? 'w-0 overflow-hidden border-0'
|
||||
: ''
|
||||
} `}
|
||||
aria-hidden={desktopSidebarHidden}
|
||||
>
|
||||
<Sidebar
|
||||
onNewSession={handleSidebarNewSession}
|
||||
onQuickConnect={handleSidebarQuickConnect}
|
||||
onEditSession={handleSidebarEditSession}
|
||||
onCollapse={isMobile ? undefined : onToggleSidebar}
|
||||
/>
|
||||
</aside>
|
||||
{!desktopFullscreen && (
|
||||
<aside
|
||||
className={`titlebar-no-drag h-full flex-shrink-0 transition-[width,transform] duration-200 ease-in-out ${
|
||||
isMobile
|
||||
? `fixed inset-y-0 left-0 top-10 z-50 ${mobileSidebarOpen ? 'translate-x-0' : '-translate-x-full'}`
|
||||
: desktopSidebarHidden
|
||||
? 'w-0 overflow-hidden border-0'
|
||||
: ''
|
||||
} `}
|
||||
aria-hidden={desktopSidebarHidden}
|
||||
>
|
||||
<Sidebar
|
||||
onNewSession={handleSidebarNewSession}
|
||||
onQuickConnect={handleSidebarQuickConnect}
|
||||
onEditSession={handleSidebarEditSession}
|
||||
onCollapse={isMobile ? undefined : onToggleSidebar}
|
||||
/>
|
||||
</aside>
|
||||
)}
|
||||
|
||||
<main className="flex min-w-0 flex-1 flex-col bg-dark-800">
|
||||
<div className="flex items-stretch">
|
||||
{isMobile && <MobileMenuButton onClick={onToggleMobileSidebar} />}
|
||||
{desktopSidebarHidden && <ExpandSidebarButton onClick={onToggleSidebar} />}
|
||||
<div className="min-w-0 flex-1">
|
||||
<TabBar onOpenLauncher={onOpenLauncher} />
|
||||
<main
|
||||
className={`flex min-w-0 flex-1 flex-col ${desktopFullscreen ? 'bg-black' : 'bg-dark-800'}`}
|
||||
>
|
||||
{!desktopFullscreen && (
|
||||
<div className="flex items-stretch">
|
||||
{isMobile && <MobileMenuButton onClick={onToggleMobileSidebar} />}
|
||||
{desktopSidebarHidden && <ExpandSidebarButton onClick={onToggleSidebar} />}
|
||||
<div className="min-w-0 flex-1">
|
||||
<TabBar onOpenLauncher={onOpenLauncher} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="titlebar-no-drag min-h-0 flex-1 overflow-hidden">
|
||||
<TabContent
|
||||
@@ -167,9 +186,11 @@ export default function AppShell({
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div className="titlebar-no-drag">
|
||||
<StatusBar />
|
||||
</div>
|
||||
{!desktopFullscreen && (
|
||||
<div className="titlebar-no-drag">
|
||||
<StatusBar />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="titlebar-no-drag">{children}</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user