fix(screen-context): skip selected-text capture when the clipboard can't be fully restored

Capture still used the old snapshot code: a file copied in Explorer looked
empty and was cleared, and Excel's own formats were dropped on restore. It
now uses the shared clipboard snapshot policy and leaves the clipboard
alone when it couldn't put everything back.
This commit is contained in:
Yun Chan 2026-10-20 22:51:51 +09:00
parent 9d0548f871
commit 95656b098a
3 changed files with 31 additions and 55 deletions

View file

@ -65,6 +65,9 @@ vi.mock('electron', () => ({
readHTML: vi.fn(() => ''),
readRTF: vi.fn(() => ''),
readImage: vi.fn(() => ({ isEmpty: () => true, toPNG: () => Buffer.alloc(0) })),
availableFormats: vi.fn((): string[] => []),
readBuffer: vi.fn(() => Buffer.alloc(0)),
writeBuffer: vi.fn(),
write: vi.fn(),
},
shell: {