@agent-link/server 0.1.186 → 0.1.187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app.js +1 -1
- package/web/modules/fileBrowser.js +22 -3
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -854,7 +854,7 @@ const App = {
|
|
|
854
854
|
},
|
|
855
855
|
workdirMenuCopyPath() {
|
|
856
856
|
workdirMenuOpen.value = false;
|
|
857
|
-
|
|
857
|
+
fileBrowser.copyToClipboard(workDir.value);
|
|
858
858
|
},
|
|
859
859
|
// Memory management
|
|
860
860
|
memoryPanelOpen, memoryFiles, memoryDir, memoryLoading,
|
|
@@ -256,13 +256,31 @@ export function createFileBrowser(deps) {
|
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
function copyToClipboard(text) {
|
|
260
|
+
// Use ClipboardItem with explicit text/plain to prevent Chrome (especially
|
|
261
|
+
// mobile) from URL-encoding paths that look like URL schemes (e.g. Q:\...)
|
|
262
|
+
if (navigator.clipboard && window.ClipboardItem) {
|
|
263
|
+
const blob = new Blob([text], { type: 'text/plain' });
|
|
264
|
+
const item = new ClipboardItem({ 'text/plain': blob });
|
|
265
|
+
return navigator.clipboard.write([item]);
|
|
266
|
+
}
|
|
267
|
+
// Fallback for older browsers
|
|
268
|
+
const textarea = document.createElement('textarea');
|
|
269
|
+
textarea.value = text;
|
|
270
|
+
textarea.style.position = 'fixed';
|
|
271
|
+
textarea.style.opacity = '0';
|
|
272
|
+
document.body.appendChild(textarea);
|
|
273
|
+
textarea.select();
|
|
274
|
+
document.execCommand('copy');
|
|
275
|
+
document.body.removeChild(textarea);
|
|
276
|
+
return Promise.resolve();
|
|
277
|
+
}
|
|
278
|
+
|
|
259
279
|
function copyPath() {
|
|
260
280
|
const menu = fileContextMenu.value;
|
|
261
281
|
if (!menu) return;
|
|
262
282
|
const path = menu.path;
|
|
263
|
-
|
|
264
|
-
// Fallback: some browsers block clipboard in non-secure contexts
|
|
265
|
-
});
|
|
283
|
+
copyToClipboard(path).catch(() => {});
|
|
266
284
|
// Brief "Copied!" feedback — store temporarily in menu state
|
|
267
285
|
fileContextMenu.value = { ...menu, copied: true };
|
|
268
286
|
setTimeout(() => {
|
|
@@ -369,6 +387,7 @@ export function createFileBrowser(deps) {
|
|
|
369
387
|
closeContextMenu,
|
|
370
388
|
askClaudeRead,
|
|
371
389
|
copyPath,
|
|
390
|
+
copyToClipboard,
|
|
372
391
|
insertPath,
|
|
373
392
|
refreshTree,
|
|
374
393
|
handleDirectoryListing,
|