chore(cleanup): remove document drag-and-drop
Remove the feature that let a user drop a .txt/.md/.csv/.docx/.pdf file onto the avatar to feed its text into the chat: the dropped-files IPC handler and extractText() in main, and getPathForFile/sendDroppedFiles in the preload API and renderer App.tsx. This fed documents into the general-purpose chat loop, which is being phased out in favor of the server-side coach pipeline. Uninstall mammoth and pdf-parse, now unused. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
6cb38a2f36
commit
acdd8a08d3
@@ -29,8 +29,6 @@ vi.mock('../../../src/renderer/src/voice/useProactiveSpeech', () => ({
|
||||
|
||||
let onUpdateAvailableCb: (() => void) | undefined
|
||||
let onUpdateReadyCb: (() => void) | undefined
|
||||
const sendDroppedFiles = vi.fn()
|
||||
const getPathForFile = vi.fn(() => 'C:\\fichier.txt')
|
||||
const showContextMenu = vi.fn()
|
||||
const getWindowBounds = vi.fn(async () => ({ x: 0, y: 0, width: 100, height: 100 }))
|
||||
const setWindowPosition = vi.fn()
|
||||
@@ -51,8 +49,6 @@ function setupWindowApi(): void {
|
||||
}),
|
||||
onToggleListening: vi.fn(() => () => {}),
|
||||
onProactiveSpeech: vi.fn(() => () => {}),
|
||||
getPathForFile,
|
||||
sendDroppedFiles,
|
||||
showContextMenu,
|
||||
getWindowBounds,
|
||||
setWindowPosition,
|
||||
@@ -107,21 +103,6 @@ describe('<App />', () => {
|
||||
expect(screen.getByText(/prochaine fermeture/)).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should forward dropped files to the main process', () => {
|
||||
render(<App />)
|
||||
const container = screen.getByTestId('avatar-viewer').parentElement!
|
||||
fireEvent.drop(container, { dataTransfer: { files: [{ name: 'a.txt' }] } })
|
||||
expect(getPathForFile).toHaveBeenCalled()
|
||||
expect(sendDroppedFiles).toHaveBeenCalledWith(['C:\\fichier.txt'])
|
||||
})
|
||||
|
||||
it('should not call sendDroppedFiles when nothing is dropped', () => {
|
||||
render(<App />)
|
||||
const container = screen.getByTestId('avatar-viewer').parentElement!
|
||||
fireEvent.drop(container, { dataTransfer: { files: [] } })
|
||||
expect(sendDroppedFiles).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should request the context menu with the current listening state', () => {
|
||||
// Faux par defaut (ecoute non activee tant qu'aucun compte n'est connecte, voir
|
||||
// getAuthStatus ci-dessus qui renvoie loggedIn: false).
|
||||
|
||||
Reference in New Issue
Block a user