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
@@ -0,0 +1,40 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { fitContextMenuToViewport } from '../../../src/components/sftp/contextMenuPosition'
|
||||
|
||||
describe('fitContextMenuToViewport', () => {
|
||||
it('keeps the menu below/right of the click when there is room', () => {
|
||||
expect(fitContextMenuToViewport(100, 80, 180, 200, 1000, 800)).toEqual({
|
||||
left: 100,
|
||||
top: 80,
|
||||
})
|
||||
})
|
||||
|
||||
it('flips above the click when near the bottom edge', () => {
|
||||
// Click near bottom; menu taller than remaining space → open upward.
|
||||
expect(fitContextMenuToViewport(200, 540, 180, 280, 1000, 600)).toEqual({
|
||||
left: 200,
|
||||
top: 260, // 540 - 280
|
||||
})
|
||||
})
|
||||
|
||||
it('clamps into the viewport when flipped menu would still overflow', () => {
|
||||
expect(fitContextMenuToViewport(900, 540, 360, 400, 997, 592)).toEqual({
|
||||
left: 540, // 900 - 360 (flip left of click)
|
||||
top: 140, // 540 - 400 (flip above click), still within [8, 184]
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps an oversized menu inside the top-left margin', () => {
|
||||
expect(fitContextMenuToViewport(20, 20, 400, 600, 320, 480)).toEqual({
|
||||
left: 8,
|
||||
top: 8,
|
||||
})
|
||||
})
|
||||
|
||||
it('flips left of the click when near the right edge', () => {
|
||||
expect(fitContextMenuToViewport(920, 100, 200, 120, 1000, 800)).toEqual({
|
||||
left: 720, // 920 - 200
|
||||
top: 100,
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user