feat: add copy paste feature for folder (#6097)

* feat: add copy paste feature for folder

* add: playwright test

* fix

* fix

* add: keyboardFocusBg in light mode

* fix: copy paste in yaml collection

* improvement
This commit is contained in:
Pooja
2025-12-02 15:29:32 +05:30
committed by GitHub
parent bc4062b950
commit 06a024a1d9
12 changed files with 383 additions and 68 deletions

View File

@@ -773,7 +773,7 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
});
// delete file/folder
ipcMain.handle('renderer:delete-item', async (event, pathname, type) => {
ipcMain.handle('renderer:delete-item', async (event, pathname, type, collectionPathname) => {
try {
if (type === 'folder') {
if (!fs.existsSync(pathname)) {
@@ -781,7 +781,7 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
}
// delete the request uid mappings
const requestFilesAtSource = await searchForRequestFiles(pathname);
const requestFilesAtSource = await searchForRequestFiles(pathname, collectionPathname);
for (let requestFile of requestFilesAtSource) {
deleteRequestUid(requestFile);
}
@@ -947,7 +947,12 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
items.forEach(async (item) => {
if (['http-request', 'graphql-request', 'grpc-request'].includes(item.type)) {
const content = await stringifyRequestViaWorker(item, { format });
const filePath = path.join(currentPath, item.filename);
// Use the correct file extension based on target format
const baseName = path.parse(item.filename).name;
const newFilename = format === 'yml' ? `${baseName}.yml` : `${baseName}.bru`;
const filePath = path.join(currentPath, newFilename);
safeWriteFileSync(filePath, content);
}
if (item.type === 'folder') {