feat: support multi-file drag and drop of images (#14832)

This commit is contained in:
Jack Wotherspoon
2025-12-12 12:14:35 -05:00
committed by GitHub
parent 299cc9bebf
commit 1e734d7e60
4 changed files with 308 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ import fs from 'node:fs';
import os from 'node:os';
import pathMod from 'node:path';
import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
import { unescapePath, coreEvents, CoreEvent } from '@google/gemini-cli-core';
import { coreEvents, CoreEvent } from '@google/gemini-cli-core';
import {
toCodePoints,
cpLen,
@@ -17,6 +17,7 @@ import {
stripUnsafeCharacters,
getCachedStringWidth,
} from '../../utils/textUtils.js';
import { parsePastedPaths } from '../../utils/clipboardUtils.js';
import type { Key } from '../../contexts/KeypressContext.js';
import type { VimAction } from './vim-buffer-actions.js';
import { handleVimAction } from './vim-buffer-actions.js';
@@ -1675,8 +1676,10 @@ export function useTextBuffer({
}
potentialPath = potentialPath.trim();
if (isValidPath(unescapePath(potentialPath))) {
ch = `@${potentialPath} `;
const processed = parsePastedPaths(potentialPath, isValidPath);
if (processed) {
ch = processed;
}
}