Add save actions and cross-platform file manager support (#848)

* files-download-feature

* feat: add save option to file directory context menus and viewer

* fix: open files in the system file manager
This commit is contained in:
Dave Otero
2026-04-16 23:33:55 +03:00
committed by GitHub
parent 79a9f93ae2
commit fd8972a7d9
7 changed files with 102 additions and 6 deletions
+1
View File
@@ -521,6 +521,7 @@ export interface FilesAPI {
rename?(oldPath: string, newPath: string): Promise<{ success: boolean; path: string }>;
revealPath?(path: string): Promise<{ success: boolean }>;
execCommands?(commands: string[], cwd: string): Promise<{ success: boolean; results: CommandExecResult[] }>;
downloadFile?(path: string): Promise<void>;
}
export interface ProjectEntry {
+11
View File
@@ -16,6 +16,17 @@ export const isMacOS = (): boolean => {
return /Macintosh|Mac OS X/.test(navigator.userAgent || '');
};
export const isWindows = (): boolean => {
if (typeof navigator === 'undefined') return false;
return /Windows/.test(navigator.userAgent || '');
};
export const getRevealLabel = (): string => {
if (isMacOS()) return 'Reveal in Finder';
if (isWindows()) return 'Open in File Explorer';
return 'Open in File Manager';
};
/**
* Checks if the platform-appropriate modifier key is pressed.
* On macOS desktop app: Cmd (metaKey), on other platforms or web: Ctrl (ctrlKey).